Game Development Community

dev|Pro Game Development Curriculum

Animation speed multiplier for t2dAnimatedSprite

by Andreas Kirsch · 02/23/2006 (10:49 am) · 0 comments

Download Code File

I've added a mSpeedFactor private to the class and the corresponding get/set functions setSpeedFactor and getSpeedFactor. Additionally and more importantly the new feature is exposed to TS as "speedFactor" field. I've also added support for the field to the serialize functions and increased the version number to 5 (the old version is still supported nevertheless).
About the implementation:
The speedFactor just scales the elapsed time that is passed to the animation controller's integrate function. This is pretty clean and straight-forward - and works perfectly fine for me.