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