Creating animations in SpriteKit

Until this point, we have given movement to almost every node in the scene in order to make our game look realistic, but we still have our main character static and it doesn't look very normal. It looks as if the rabbit is floating over the ground.

In order to overcome this situation, we are going to animate the rabbit so that it appears as if it is running or jumping through the doors. Animating nodes consists of intercalating images with a little modification in relation to the previous one so that their visualization provides a simulation of movement.

The problem that this technique can produce is that the performance of the game can suffer alarmingly due to the large amount of images needed. To avoid this issue, ...

Get Getting Started with SpriteKit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.