Hi, Liam. Well, one of the major advantage for classes in games is the variable is created the same time as the object is constructed. When you call the destructor on the object all the class variables are removed from memory freeing up memory for something else. If you have one level with 10 robots and when you are done with it and don't need the robots any more you call the distructor and all the memory reserved for them is whiped clean. The next level you have 10 aliens you call the constructors for the objects for them and memory is now reserved for them. It makes memory management quite nice and easy. The old structured way you created x number of global variables which wind up being in memory all the time and waiste memory and system resources unnecessarily.
Liam Erven wrote: > I kind of do that now, but with user defined types, but it would be nice to > use classes more. do loops are your friend. _______________________________________________ Gamers mailing list .. [email protected] To unsubscribe send E-mail to [EMAIL PROTECTED] You can visit http://audyssey.org/mailman/listinfo/gamers_audyssey.org to make any subscription changes via the web.
