Animation frames using SKTexture
So far, we have used static images in our game, but if you will see, most of the games have animated effects, such as player running effect, car running effect, or any other effect that enhances the gameplay and creates a much better experience for all.
Adding the Run action texture to the player in the Platformer game
We had earlier added an image atlas of the name, idle.atlas
, which contained similar images of the player standing position.
Now, we are going to add running texture images for the player, which will make it look as though the player is running in the GameScene
.
Firstly, add a texture image set called bro5_run.atlas
, which we have provided. The image atlas contains sets of seven images, which are sometimes also referred to as a sprite sheet. In our case, it will be known as the player running sprite sheet. These sets of images will be running one after the other at a fast rate of time inside texture atlas.
Now, let's assign the texture image for...