View Single Post
Re: Quake II Full Build all setup for .NET
Old
  (#9)
stefanhendriks
RealBot Author
 
stefanhendriks's Avatar
 
Status: Offline
Posts: 3,088
Join Date: Nov 2003
Location: Netherlands
Default Re: Quake II Full Build all setup for .NET - 23-04-2004

In fact, i use C++ in a minimum way. I use classes so i keep my code more organized. It also prevents me from messing up variables which i should never modify. Classes can restrict you to that. So when a variable gets changed, its my fault

As an example, i have written a small RTS engine (yes i love RTS) in C only. It was ONE huge file (mind, this was the first in C ever i did, hence the first huge program i did in C) with tons of functions, global vars, etc. Eventually you end up with this naming convention:

int game_var_score_of_player;
int game_var_score_of_ai;

etc. Perhaps a bad example, but you get the idea. Now, i use something like:

class cGame
{
public:
tPlayers player[MAX_PLAYERS]; // x amount of players in the GAME
};

and in tPlayer:

struct tPlayer
{
int score;
int credits;
... etc
}

It keeps the code way more organized. I can send you this (compilable!) source... or a binary file to show you how it looks like and how it plays...


Author of RealBot, "Arrakis" and "Dune 2 - The Maker" | co-Founder of Bots-United | Fundynamic | Blog | E-Mail me
  
Reply With Quote