Dynamic Game Loop, and class derivation/polymorphism

Started by
10 comments, last by Lotan 24 years, 1 month ago
Curious to know why no one has mentioned the archaic "implemented-in-terms-of" method....

Love to be a pain.
Advertisement
Just to let everyone know, the reason a lot of these different weapons/actions have their own class that has the interface BattleAction, is because this is a real-time game in which two characters do battle using BattleActions. Its similar to the old game Archon if anyone remembers it, and the reason that everything uses the same interface is because every character has 2 BattleActions... They may have 1 weapon(ie melee) and 1 miscellaneous action(ie invisibility) or 2 miscellaneous, or 2 weapons, but the point is, they all have the same interface so I don''t have to check if its a weapon or anything else. The interface is real simple, but all of this works great, and the interface will not change since I''ve created all of the BattleActions I can think of to create, and they all work.

My real question was why polymorphism and class derivation isn''t used more often... Does it hinder speed, memory usage?

Note: I''m a little new to deriving classes, so if my terminology is off cut me some slack.

This topic is closed to new replies.

Advertisement