In this chapter, you learned some advanced techniques that will help you give a professional and complex look to your games.
We started by learning how to create nodes that are composed of several sprites and actions by creating classes that inherit SKNode
. In this way, we created a new class for the enemies in the game that consist of two SKSpriteNode
instances, two SKAction
instances, and the type of enemy.
In addition to this, we learned how we can perform actions on each of the sprites separately so that the element behaves as we want.
Furthermore, I showed you how to apply the parallax effect to our games in order to provide them with depth and a sense of motion. For this purpose, we learned how to take advantage of the update
method and combine copies of nodes to run movement actions at different speeds so that it seems that the rabbit is running.
In order to adapt the rabbit to the new movement, we learned how to animate nodes using texture atlases to avoid a decrease in performance...