I have three classes.
Monster derives from Animation. Animation derives from Collider. This is, monster is an animated collider.
However, I'd like to have animated objects that are not colliders.
Maybe it's a newbie question, but how?
I have three classes. Monster derives from Animation. Animation derives from Collider. This is, monster is an animated collider. However, I'd like to have animated objects that are not colliders. Maybe it's a newbie question, but how? |
|||
closed as off-topic by Byte56♦ Sep 14 '14 at 14:36This question appears to be off-topic. The users who voted to close gave this specific reason:
|
|||
|
This is one of the best examples why use composition over inheritance. When you learned coding OOP, you were very often advised to derive... and derive, and derive. This is usually not (that) bad for applications but you will run into serious problems in games very soon. Exactly whose what you posted. |
|||
|