thebman at October 20th, 2012 22:11 — #1
In my app I have a bunch of enemy characters that are moving by CCAnimations (CCActions). They are set to a certain animation speed, however at certain times I need to either increase or decrease the speed of the animation that are currently doing.
Now is this possible? I have looked around have seen nothing mentioned about it. Can anyone point me to somewhere that can explain how to do this or if you have any tips or advice on how to achieve this, that would be great!
shadaz at October 20th, 2012 22:16 — #2
It may be best to handle the animations yourself so you will have more control:
look up: setDisplayFrame or setDisplayFrameWithAnimationName
you can then control the speed and many other things (ie:sync animations w/other animations or sound)
thebman at October 20th, 2012 22:20 — #3
Is that the only possible way? Do you have any links where I can see of an example in this?
hareball at October 20th, 2012 22:25 — #4
I think it's possible to wrap multiple animations under the one action... create an animation for each speed that you need, and run them in a sequenceable action.
Haven't tried this myself, but in theory it should work!
thebman at October 20th, 2012 22:27 — #5
@hareball Unfortunately I cannot do that. I know I said each is a certain speed but to elaborate, it is set to a random speed for each so each has their own 'certain' speed. Bottom line its a random float so it will most likely never be the same number twice.
Sorry for the confusion!
shadaz at October 20th, 2012 22:31 — #6
Look at this post pay attention to the animationInterval variable - you can set that to what ever you want.
thebman at October 21st, 2012 00:13 — #7
Ok I'll look at it tomorrow. Ill post back if I have any questions!