I'm creating a simple 2d game with c++ and SFML, and I've got a simple framework going for animating a sprite using a "SpriteSheet" image (an big image containing all the "frames" of an animation)
I've got it working fairly well, I've attempted to copy the concept from another engine i'm familar with (Starling for Flash).. in which they use a "Juggler" which updates a sprite's properties based on a timeline, independant of the sprite...
I've got the animation working for swapping frames using a class i created called Tween... it calls a function update(float gameTime); which updates the sprites subRect to the correct frame...
I'd like to make this a more rebust solition, allowing the Tween class to do more than just frame animations.. I've been trying to use polymorphism to create Children to Tween such as "Anim", "Move", "Rotate", and "Scale" which all have a update() function which updates the sprite accordingly... The idea being a list of a number of these classes (for instance, a Scale and Rotate) can be added to a vector list and then each can call their update function, each updating their specific functions.. the problem seems to be that if i create a list of Tweens, then call update, it uses Tweens implementation of Tween.update() and not it's inherited children, I don't know how/if it's possible to allow this...