Making animations die

Started by
2 comments, last by kzar 18 years, 5 months ago
Hi in my animation class I added a loop option so you can make an animation only play through once or carry on forever. But I would like to make it so if the animation only plays once at the end it is removed. I searched around a bit and I read that making class's "suicide" is bad practice for a few different reasons. So how could I do this? Thanks, David
Advertisement
mark your animation as "dead" (bool alive=false) and dont update/render/etc. dead animations. remove dead animations from animation list after update/render loop.

You can also use Function Pointers , this is more helpful when your object has some more other states which originally need if/switch statements.

V@T
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Cool thanks for the replys.

This topic is closed to new replies.

Advertisement