Hello everybody I am developing a game with starling and i want to set a timer for example every 2 sec i want something to happen.
I used the juggler elapsed prop but i wonder is there a more effecient way to do that
thank you,
Khaled
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If this does not relate to animation, it is recommended to use a Timer for non-animated content.
Timer implementation would be higher performance than additional time calculations on enter frame handler.
If you are advancing Starling Jugglers, you can set the frame rate of the Juggler to every 2-seconds.
Jugglers also have
delayCallin which you could infinitely loop every 2-seconds if your functor redundantly called delayCall:To tie in to Starlings frame / render lifecycle, you can test time since your last call.