Making animations die
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
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
V@T
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement