question about class design

I am working on a small game program. I use ID3DXSPRITE to draw all scenes. In this game I have several types of objects : tank, wall, spike, missile(maybe more). I have a sprite class to handle the position, velocity and other properties of sprite. Question is , should I make each of them a separate class or add all properties in one class, since they only differ on very few point(for example, tank has tankmove and tankrotate which other object cannot use)? if separate, it will be very complex when calculating collision and have some other inconvenience. if not the one class will be large and hard to manage. Maybe it is too difficult for me?...
UP...
Sounds like you're probably looking for class inheritance then, if going by what you say, there's not much difference in each class, and you're only looking to change up a bit how your movement function is supposed to work.

http://www.cplusplus.com/doc/tutorial/inheritance/
but if I use class inheritance, the collision detection function will not work for so many class(unless I write many versions to fix that)...Oh-I was wrong from the very beginning...
Hi,

Here is a book about game design.

http://gameprogrammingpatterns.com/


There is lots of other stuff on the net also, try searching modular game design.

Good Luck !! :+)
Thanks very much!!! it's really helpful.
tanks for YFGHNG too!
Hehe...tanks.
No worries :+)

Try searching for collision detection as well.
Topic archived. No new replies allowed.