In our previous game, we manipulated our sprites directly through their members, especially the
position attribute. The game loop updated each actor with the elapsed time from the previous frame.
However, our tower defense game will be based mainly on cocos2d actions, which are orders to modify object attributes such as the position, rotation, or scale. They are executed by calling the
do() method of the
CocosNode class. Therefore, any sprite, layer, or scene can be a valid target of an action.
The actions that we will cover in this section can be divided into two main groups: interval actions and instant actions.
These actions have a duration, and their execution ends after that certain duration. For instance, if ...