Creating the player scene
Open a new scene and add a
CharacterBody2D node named
Player as the root and save the scene. Don’t forget to click the Group Selected Node(s) button. When saving the
Player scene, you should also create a new folder to contain it. This will help keep your project folder organized as you add more scenes and scripts.
Look at the properties of
CharacterBody2D in the Inspector. Notice the default values of Motion Mode and Up Direction. “Grounded” mode means the body will consider one collision direction as the “floor,” the opposite wall as the “ceiling,” and any others as “walls” – which one is determined by Up Direction.
As you’ve done in previous projects, you’ll include all the nodes the player character needs to function in the Player scene. For this game, that means handling...