Finishing touches
Now that the main functionality of the game is complete, you can add a few more features to polish it up a little bit.
Death animation
When the enemy hits the player, you can add a small animation rather than just ending the game. The effect will spin the character around while shrinking its scale property.
Start by selecting the AnimationPlayer
node of the Player
and clicking the New Animation
button:

. Name the new animation die
.
In this animation, you'll be animating the Sprite's Rotation Degrees
and Scale
properties. Find the Rotation Degrees
property in the Inspector
and click the key,

, to add a track. Move the scrubber to the end of the animation, change Rotation Degrees
to 360
, and click the key again. Try playing the animation to see the character spin.
Note
Keep in mind that while degrees are typically used for Inspector properties, when writing code most Godot functions expect angles to be measured in radians.
Now, do the same thing with the Scale property. Add a keyframe...