O'Reilly logo

Getting Started with SpriteKit by Jorge Jordán

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we focused our efforts on incorporating playability in the game that we initialized in Chapter 1, The First Step toward SpriteKit.

We explored the different ways through which we can handle touch interaction, and we used them to detect where the user touched the screen and deploy it on the movements of the main character.

In order to make the rabbit move, we had a look at the methods provided by the SKAction class in order to create and manage actions. Thanks to these utilities, we managed the rabbit's lateral movement and the looped movement of the wall and doors. In this way, we created a group of objects that the user will need to avoid.

Next, we added one of the bases of all games, namely collision detection. As the rabbit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required