Hi, I am doing my program in cocos2d. I am using NSDate to get the current time of the start of animation. And I know my animation takes 3 seconds. So I can get the time at completion of animation by using NSInterval and using the previous time and animation time. But, if If the animation time interval is not fixed how can I calculate the time interval of the animation and time at the completion of the animation ? I am animating a sprite. Please help how can I make it. Thank You.
how can we count the time interval of the animation in cocos2d ?
(3 posts) (3 voices)-
Posted 1 year ago #
-
It may be better to wrap your animation action in a CCSequence with a CCCallFunc at the end to notify you when it has completed, rather than use a time based approach. Just a suggestion...
Posted 1 year ago # -
But what if someone has to find the exact time?
I am writing the AI of my game and for that I need to know the exact time, so that I can decide what the other player will do?
I guess: ccTime interval = myAnimateAction.elapsed;
Might help but it's not working for me :(Posted 1 year ago #
Reply
You must log in to post.