Hi everyone,
My game involves using vehicles to catch the opponent. Vehicles travel in a fixed path (Route). Movement is done using MoveTo and RotateTo actions. Now I plan to add power-ups to the game. One such power-up is increasing speed of the boarded vehicle for few seconds. If I had implemented movement manually in update method, then this would have been simple. But since I am using MoveTo and RotateTo actions, implementing this power-up seems to be a bit tricky. I am aware of setTimeScale method but that will speed up all animations present in the game. Is there something similar that increases/reduces speed of only selected animations?
Why not just increase the speed? All Actions have this.
Example from our Programmers Guide:
auto mySprite = Sprite::create("mysprite.png");
// Move a sprite to a specific location over 2 seconds.
auto moveTo = MoveTo::create(2, Vec2(50, 0));
mySprite->runAction(moveTo);
// Move a sprite 50 pixels to the right, and 0 pixels to the top over 2 seconds.
auto moveBy = MoveBy::create(2, Vec2(50, 0));
mySprite->runAction(moveBy);