Hi all
I need to animate my game and please, I have 2 questions :
Question 1) for the 2 below functions :
- Runtime:addEventListener( “enterFrame”, fctAnime) -----> using fps = 60
- performWithDelay( 16, fctAnime, 0) -----> note that 1000 ms / 60 fps = 16,6
Imagine that my function fctAnime() last 1 full second (=1000 ms), so what will happen ?
With (1) and (2) then : several fctAnime() will be launched at the same time, or do fctAnime() have to be finished BEFORE another fctAnime() is able to start ?
Question 2) My second question is :
30 FPS (1 frame each 33 ms) is too slow for my game and 60 FPS (1 frame each 16 ms) is to speed.
How could i be able to launch my fctAnime() every 20 ms ?
Should I use performWithDelay like above, or runtime/enterframe and calculate inside if I could launch my animation code or if I should exit the function for this time to reach the speed I need?
Thanks