Stats
I am trying to develop a simple hex game like ogre. How would you all suggest I store the stats for each piece ie...Attack, defense, movement points, ect... in C#
Enums, Index Arrays, ArrayList ?
Thanks for any advice
RSteel
I've never played orge myself, but from a personal opinion I would either create a struct or class to store them in. I would recommend a struct more than a class as it is used for less complex problems.
----
Mike
Portfolio: Http://members.iinet.net.au/~slyons
Team AI: Http://members.iinet.net.au/~slyons/teamai
[edited by - Mike737 on January 6, 2004 2:47:23 AM]
public struct Stats{ public int attack; public int defense; public int movement; // Constructor: public Stats() { this.attack = 0; this.defense = 0; this.movement = 0; } etc.....}
----
Mike
Portfolio: Http://members.iinet.net.au/~slyons
Team AI: Http://members.iinet.net.au/~slyons/teamai
[edited by - Mike737 on January 6, 2004 2:47:23 AM]
Thanks,
Ogre is like a hex style tile game. Each individual piece ie...tank...infantry...ect..has movement points, attack pts..def...ect..
How would you go about storing each piece with its information, to be called upon? I was thinking about instantiating an object, filling the object with the information and storing it in an array. Is there an easier way?
Thanks for any help
RSteel
Ogre is like a hex style tile game. Each individual piece ie...tank...infantry...ect..has movement points, attack pts..def...ect..
How would you go about storing each piece with its information, to be called upon? I was thinking about instantiating an object, filling the object with the information and storing it in an array. Is there an easier way?
Thanks for any help
RSteel
An object could work, or like the guy above suggested, a struct.
Personally I would use a struct.
Personally I would use a struct.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement