We have our game integrated with collectables. Let's see how the spaceship will collect these collectables that is, coins. In character animation, we will be doing the animations on the spaceship and the coins when they collide with each other.
Before moving on to the complex animations to be applied on the entities of the scene, the understanding of actions (that is,
SKAction) and update function of scene (
SKScene) has to be there. This is so that during updation we can detect the collision between the coin and the spaceship and do some animations on both of them.
The following are the steps involved in detecting the collision and animating both the entities (coin and spaceship):