Creating the Main Game Scene

Now that we have a working title screen with a main menu, it’s time to start creating our actual game. The vast majority of our game logic is contained in a single scene, GameScene. Let’s create it now, select Scene->New Scene then select the 2D Node option. Next, I renamed the default Node2D to be GameSceneRoot, like so:

Game-Scene-Root Godot Screenshot

Now save the newly created scene as GameScene.tscn. At this point, the New Scene button we created earlier should now work… even if it just leads to an empty blue screen. So let’s do something about that!

Creating Your Level

Let’s start by creating a game level. We are going to compose our level in a couple of different node hierarchies. Let’s start with a set of mountains. Create a new Node and rename it Mountains and make sure this node is selected. Now we are going to layer several different sprites to create our level. In the folder assets/graphics/bg, locate farground_mountains.png and drag it into the 2D editor. This will prompt you how you want to create the object and select Sprite:

Add-Sprite in Godot - Screenshot

Next position it in the scene, like so:

Creating-the-foreground in Godot Screenshot

Now repeat the process with midground_mountains and foreground_mountains, making sure each time that the Mountains node is selected.

Game-Scene-Hierarchy Godot Screenshot

Your game level should now look like this:

Game-Level-WIP Godot Screenshot

One very cool feature of the graphics Robert created is they are seamless and tile-able. This means the right edge and left edge are the same, so we can now duplicate our mountains to expand our level. In the Scene tab, hold Ctrl + Left click each mountain sprite, like so:

Clipboard-Image_6

Then right-click and Duplicate. Now with the 3 new duplicates selected, move them to the right, starting where the first set of mountains end. Our level should now look something like:

Full-Mountains Game in Godot

Looking good!

 

Scroll to Top