• Advertisement

Peter Stephenson

  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Peter Stephenson

  • Rank
  1. My football manager game

    that code looks good.. only thing (cus im an OO freak :P ) is that i would make the vector of players and the function either class level members of the Player class or make a factory class for them ;)
  2. My football manager game

    ok, this is how I would do it: in the team class, add a collection of pointers to players add methods to the team class that will add/remove POINTERS to the players to this array then use these methods in your control code (menu buttons, cli, whatever ;) ) to create the teams (you would create the players using a UI and the computers with AI, or just random if your lazy ;) ) if you think it would be usefull you could also add a pointer in the player class to the team they are a member of (2 way link) so you wind up with an array of players which contains all possible players in the game and then each team will link to the players using pointers any clearer?
  3. My football manager game

    Heres a few things: i assume you have a collection of football-players that the game-player must choose from implementing this i would give each of the football-teams a collection of pointers to players, and have a method on the team addPlayer taking a pointer to the player to add, you would then call this function from your UI/AI you might want to make the linkage 2 way so you can tell if the player is already on a team, or remove it from your collection of football-players and only keep the reference in your team array- i would go with the 2 way linkage I would make the constructor take an array of players (im assuming you would need to load multiple players at once after restoring a saved game) and a default constructor (new game teams are probably blank?) Hope that helped :)
  4. [web] .NET Query issue

    Anybody ever had a problem where a stored procedure will run in sub second in query analyser then time out in .NET at runtime?? (Exactly the same code) and if so... anybody know how to fix it??
  5. Windows language (not a programming one)

    I can confirm that it is not possible (at least to my knowledge) to change the output language of windows ;) I have a German OS on my laptop and tried so hard to change it at first... Lets just say it was easier to learn German ;)
  6. Inventory

    just a minor additional point If you wanted to use it as a weapon after determining it is one you will need to type cast it in c#: foreach (Item item in inventory) { if (item is Weapon) { (item as Weapon).whatever(); // Do stuff } } *edit* corrected source tags
  7. VB - Java

    Hi there quick google search turned up a couple of hits... http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD:2005-13,GGLD:en&q=visual+basic+to+java You should be warned that Java and VB are very different syntax-wise. Java uses a lot more symbols etc. You should also note that Java and Visual Basic (IM ASSUMING 6.. if ur using .NET IGNORE THIS ;) ) tend to take a different approach to life. Unless you get advanced VB6 is just event driven forms (the O-O stuff is hidden) where as Java is VERY Object Orientated. Hope thats useful Peter
  8. Looking for some intermediate coders to add to my MSN list

    Hi Im happy for ppl to add me.. Can program in: C++ (for 5 or 6 years now) Java (more recent.. only a few years and quite rusty) PHP/PERL/javascript (pretty sharp on these seeing as its my current job...yeah web monkey skills- i know :S) Im a student, learning to make games.. current objective is DirectX (when I get time!) At the moment im interning as a programmer (webby stuff mostly :( ) thelastbesthope@hotmail.com
  9. Problems calling constructor

    Im not 100% sure on this from the code that uve posted but is: WManager.GameWindow set up where u are trying to use it in the second example? to achieve what ur trying to do is this any better: SpriteManager *Sprite; //Declared like a global variable so that all functions can use it void GameLoop() { Sprite = new SpriteManager("data/sprite.bmp",WManager.GameWindow); Sprite->DrawSprite(); SDL_Flip(WManager.GameWindow); } void CloseProgram() { Sprite->Free(); atexit(SDL_Quit); // etc. }
  10. C vs C++

    thanks for the answers all
  11. C++ while in a if else

    If i was u i would validate your input as soon as it was entered e.g. #include <iostream> using namespace std; int main() { int CountGames; cout << "How many games do you have: "; cin >> CountGames; while(CountGames <0) { cout << "you cannot have less then 0 games. duh\n"; cout << "How many games do you have: "; cin >> CountGames; } if(CountGames > 30 || CountGames == 30) { cout << "You got a lot games. you are a game freak\n\n\n"; } else if(CountGames < 30 && CountGames > 0) { cout << CountGames << " Isn't much but atleast you got some\n\n\n"; } else if(CountGames == 0) { cout << "You got no games. wtf you should get on.\n\n\n"; } system("pause"); return 0; }
  12. C vs C++

    ok thanks for the help (like you i personally prefer object orioented programming to procedural code)
  13. C vs C++

    does using inheritance have an impact on performance? (i know the use of virtual functions does but other than that?)
  14. C vs C++

    Ive been programming for a few years now and consider myself to be a reasonably strong intermediate programmer. I am trying to teach myself game development (with the help of a few books) and have a question that I would like answering if possible (I apoligise if this has been asked b4 i usually search forums but the search is down) Which is better to use? the procedural and structure based approach of C or the Object Oriented development of C++ im concerned with both efficiency of the method of programming and with the ammount it is used in the industry as well as any other important factors Any help with this would be appriciated Thanks Peter
  • Advertisement