2D Platformer: Make a level

If you would like to add your own level to the platformer, this is the step-by-step guide to doing so. Check out the video and/or follow along below.

First open a new 2D scene. Name the root Node 2D “Main”.
Attach a game_manager.gd script to the root Node 2D.
Add a Player scene to the root node and attach a Camera 2D as a child of the player.
Add a TileMapLayer as a child of the root node. Under “Tileset” on the right side, select the foreground tile set. Then with tileset selected along the bottom you can choose tiles and paint them into the 2D scene.
Next create a new subfolder under the “Levels” folder and save your scene into the folder.
Press F6 to run current scene or click the “clapboard” icon in the upper right to make sure your scene works as expected.

Next you need to make your level accessible from one of the existing levels.
Open up an existing level that you want to connect to your new level. We’ll use the Demo level.
Add in a new Portal Scene to the root node. The Portal, like Player, is a scene that has already been set up. The purpose of the Portal is to load in a new level when the player touches it.
Position the portal where you want it within the level, then with the Portal selected, edit the “Destination” field on the right side of the screen to refer to your new level. Right clicking on your level scene and choosing “Copy Path” is helpful in order to not mess this up. The text I put in for my destination is: Level03DeleteMe/Level03.tscn

As far as the basics, that’s it. You’re done. Now you can embellish your level to your heart’s content.
-Add killplanes on spikes and boundaries (see level 01)
-Add parallax backgrounds (see level01)
-Add enemies and more

For the last part of the video I fix an error message that occurs when our level doesn’t have a HUD node. Rather than making a HUD a requirement of every level, I only change the player script to only connect to the HUD if the HUD exists. This tutorial helped me out:
https://gamedevacademy.org/gdscript-get-node-tutorial-complete-guide/#Handling_Non-Existent_Nodes

2D Platformer: Player Movement and Animation

There are many excellent tutorials for how to get started moving a 2D player around the screen. The initial movement scheme in our game was based on this tutorial:

To create a new player, create a new scene and select CharacterBody2D as the root node. This should all be somewhat familiar if you made it through the tutorial video from the previous post: https://www.youtube.com/watch?v=m9ghnrdVgrI

You can make an engaging character with little more than a script attached to the CharacterBody2D and two child nodes: a Sprite2D and a CollisionShape2D.
– Sprite2D contains the image we want to use for our character.
– CollisionShape2D defines how our character collides with the environment.

If you look at the game you will not see a Sprite2D, but instead an AnimatedSprite2D. As the name suggests, the AnimatedSprite2D is like a Sprite2D, but animated. You can learn all about how to use an AnimatedSprite2D through either or both of the following tutorials:

  1. https://www.youtube.com/watch?v=-f1bHR0iiEY
  2. https://docs.godotengine.org/en/stable/tutorials/2d/2d_sprite_animation.html

Spritesheets are images consisting of rows and columns of individual frames of an animation. These are super useful for creating animated sprites and as of writing our project uses this free set of spritesheets: https://kenney.nl/assets/new-platformer-pack

2D Platformer: Getting Started

If you are interested in collaborating on a 2D Game Project with the club, this is where to get started. We will be making a platformer using the Godot Game Engine and GitHub for collaboration. You can even you can play a version of the game here: https://hackerspace.emmw.net/godot-games

Start by downloading the latest version of Godot here: https://godotengine.org/

You will need to create an account on https://github.com/

I also recommend that you download and install GitHub desktop from here: https://desktop.github.com/download/ and link to your GitHub account.

Once you have a GitHub account, you can email your username to nholtschulte [at] cnm [dot] edu, and he will give you privileges to access the code repository, which is available here: https://github.com/CNMHackerSpace/CNM-CiC-2025-Godot

Expect more blog posts to follow with tutorials and resources to add your own ideas to the project, but in the meantime (especially if you are new to game development), here is a beginner tutorial to help you get started (including a download guide for Godot):