In order to add animations to our endless runner game, we need to perform the following steps:
jump.atlasin the resources for this chapter. Drag-and-drop them into the project and be sure to check Copy items into destination group's folder.
ERGPlayer.h. We will use it to store animation frames:
@property (strong, nonatomic) NSMutableArray *runFrames;
[self setupAnimations]; [self runAction:[SKAction repeatActionForever:[SKAction animateWithTextures:self.runFrames timePerFrame:0.05 resize:YES restore:NO]] withKey:@"running"];
First, we will call the
setupAnimations function, ...