Adding shield animations
Other animations and methods that we might want to add are the shield animations. A shield is something that protects the player from different hazards. It has on and off animations. You can check how the effect looks in the following screenshot:
Let's check the course of the action:
- Add the following properties to
@property (strong, nonatomic) NSMutableArray *shieldOnFrames; @property (strong, nonatomic) NSMutableArray *shieldOffFrames; @property (strong, nonatomic) SKSpriteNode *shield; @property (assign, nonatomic) BOOL shielded;
- The first two properties are arrays for animation frames, ...