Wednesday, 2 March 2011

The Timer Class

For one of my main characters i wanted a little pause on a particular frame for a few seconds.
After my research i found out how to do it- with the timer class.

there is a good explanation available here.

The code is pretty simple. Basically, you create  a Timer and specify the delay and how many times it will repeat or  the repeat count . Then u create a function to call every time the delay has passed.


 the delay property is measured in milliseconds.




Here i'm telling my creature to stop for 5000 milliseconds just once, and then continue playing till the end.

No comments:

Post a Comment