Doing Animation when a level ends
by ToaTerra · in Game Design and Creative Issues · 09/26/2009 (7:31 pm) · 3 replies
Hi: I would like to have some of my scene objects perform an animation (for example, a little dance) when the scence has ended. To do this I probably need to intercept the onLevelEnded event, start the animation, delay a bit, then cause the onLevelEnded event to occur. Does anyone have code or know of a tutorial/forum post that explains how to do this? Thanks in advance.
About the author
Recent Threads
#2
09/27/2009 (11:24 am)
You could also have whatever ends the level trigger the animation instead, and the animation trigger the actual end.
#3
-Run endingDance() function when player steps next to exit door
-endingDance() plays character dance animation then sets a countdown timer (danceTimer) for 3 seconds.
-When danceTimer expires, call onLevelEnd()
10/11/2009 (5:22 pm)
Ronny is correct. You wouldn't intercept the onLevelEnd() function. Think of it as technically the level is not ending until after the user sees their score or the dance animation completes. Some rough pseudo-code may be:-Run endingDance() function when player steps next to exit door
-endingDance() plays character dance animation then sets a countdown timer (danceTimer) for 3 seconds.
-When danceTimer expires, call onLevelEnd()
Torque Owner Daniel Buckmaster
T3D Steering Committee