Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Game with Sprite Kit Actions and Animations Basic Actions and Animations: Part 2

Hi people, i'm trying to do this game on swift. but i can't move the cat when touches the screen like in the video. help

if you can help me how this part would be on swift.

  • (void) performTap { [self runAction:self.tapAction]; }

  • (SKAction *) tapAction { if ( _tapAction != nil ){ return _tapAction; }

NSArray *textures = @[[SKTexture textureWithImageNamed:@"spacecat_2"], [SKTexture textureWithImageNamed:@"spacecat_1"]];

_tapAction = [SKAction animateWithTextures:textures timePerFrame:0.25];

return _tapAction;

}

is the part when we animate our cat when we tap the screen. i been looking everywhere and i can't find the solution.

thank you.