Adding Background Objects to the Game – GDevelop


In our previous lesson we learned how to add a jump through platform. In this lesson we are going to learn how to add background objects to our game and, we are going to extend the platform for our player to run.

Step 1

Well adding background Objects are simple. All you have to do is add some sprite objects. We are going to add four background objects. Add Sprite Objects of Tree, Bush, Flower and Cloud. All these images can be found in our assets folder. (assets folder > Background).


Once you have added these objects, you can drag and place these objects in the canvas as you wish. When you are placing these objects, you may notice that the player goes behind these objects.


This can be fixed by adjusting the Z-Order of the object. To change the Z-Order of the object, you have to select the object, then you can see some settings in the Properties panel in the left-hand side. This Properties panel shows properties of a selected object like width, height, position etc. Now change the Z Order of those background objects to something like “-2”. Yes, you can insert negative values too. This will arrange the background objects behind our player.


To understand this let’s take a simple example. Think we have two object A and B. A has Z order set to 3 and B has Z order set to 4. So, B will appear on top of A. If you need to bring A on top of B, then either you have to increase the Z Order of A to 5 or above, or else you need to decrease Z order of B to something below 3.


Step 2

Figure 1 - Open the layers editor
Ok, now we have some background objects placed, let’s change the background color. For that, click Open the layers editor button (Figure 1) on the top tool bar. This will open the Layers Editor popup window. There, click the gray color button next to Background color. This will open a color picker. Select a color that is similar to sky blue. Now close the Layers editor. You can see the background color has changed now.


Now we are going to extend the platform, so our player will have some space to run. This is I’m not going to explain much. The things you have learned so far is enough to do this. I’m going to show how I did this using a video. You don’t need to do exactly what I did. Just let your inner creativity to take over this situation. And with this video, I’m going to close this lesson. After watching the video and completing your platform design, move on to the next lesson.

And feel free to ask your question down below in the comment section.

Note: To clone/copy an object press and hold Ctrl while dragging the object. To Zoom the canvas, use the mouse wheel.