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?...
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.
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...