Help Me With Class Please?!
I really suck at making an RTS-engine...
No, I dont actually, but Im stuck with CUnit!
How do I make a CUnit?! What must I write or move into it?
Need it to have Collide with it? Or just a bool to tell if alive?!
Plz help me with this! Thanks!
Well, your question is not an easy one to answer, but I am making an RTS game too and I''ll tell you what I have been doing.
First of all, I''m not entirely sure what you mean by "Unit" so I''ll just explain my entire organization.
Simply put, I have one base class, CObject. CObject stores health and visibility and any other variable that every single object in the entire game has.
Then I have 3 child classes from that (This is called inheritance. Every thing from the parent class gets passed on to the child class). These three classes are Foot-Soldiers, Tanks, and Buildings. These all have many different functions of there own. Because of the concept of inheritance, they have life, visibility, and anything else that CObject had. Then I break it down further from foot-soldiers (using another child class...grandchildren u could call them). I break it down into Marines, Navy, Police Officers, etc. I use a linked list to link each police officer to each other, each navy officer to each other, etc.
I really need to learn more specifics about your design before I can answer your question properly. But I would definitely have anything that moves have a collision detection. Buildings could possibly only have a bool for determinining if their alive, but you probably will want them to be able to do other things....for instance, be repaired.
If you have any other questions, feel free to email me at NYYanks432@hotmail.com
First of all, I''m not entirely sure what you mean by "Unit" so I''ll just explain my entire organization.
Simply put, I have one base class, CObject. CObject stores health and visibility and any other variable that every single object in the entire game has.
Then I have 3 child classes from that (This is called inheritance. Every thing from the parent class gets passed on to the child class). These three classes are Foot-Soldiers, Tanks, and Buildings. These all have many different functions of there own. Because of the concept of inheritance, they have life, visibility, and anything else that CObject had. Then I break it down further from foot-soldiers (using another child class...grandchildren u could call them). I break it down into Marines, Navy, Police Officers, etc. I use a linked list to link each police officer to each other, each navy officer to each other, etc.
I really need to learn more specifics about your design before I can answer your question properly. But I would definitely have anything that moves have a collision detection. Buildings could possibly only have a bool for determinining if their alive, but you probably will want them to be able to do other things....for instance, be repaired.
If you have any other questions, feel free to email me at NYYanks432@hotmail.com
Feel free to email me at NYYanks432@hotmail.com if you have any questions
quote: Original post by Pipo DeClown
I really suck at making an RTS-engine...
No, I dont actually, but Im stuck with CUnt!
How do I make a CUnt?! What must I write or move into it?
Need it to have Collide with it? Or just a bool to tell if alive?!
Plz help me with this! Thanks!
hmm
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement