Continuing the series, I will guide you to create the background for the sence of the Game. Background (background) is very important in decorating the game to avoid boredom. Normally, you will see the background inside any game, right, if you don’t understand, you can see the picture below, which I’m sure most of you already know.
Join the channel Telegram belong to AnonyViet 👉 Link 👈 |
In the picture on the Background is the picture behind those planes, if you don’t understand it, you can understand it as the background image for the game, at this point, everyone will understand.
So now let’s get started.
Create Background For Sense
To understand this article, you should read from Lesson 0 of the series Game programming with Godot for basic knowledge.
To make this background is not very difficult, just need a few nodes.
Prepare:
+ 1 background is larger than your Window Game size or if not equal to your background, you can use 2 backgrounds or clone into 2 or reduce the map.
Here I have a background, you can go online to record the game2d background and then click on the image to come out and save it to your computer, but remember to see which image is larger than the game to see the size of the game window you make. as follows.
Click Project > project settings
Scroll down to find and select Window
Part:
- Width: width
- Height: width
So we will have 1024×600 so what do you find equal or more than 1 bit smaller is ok.
So now we’re going to start
The first step into a scene you need to add a background
Find and choose for yourself ParallaxBackground and ParallaxLayer is a child node belonging to ParallaxBackground
And add one for me Sprite is a child node of ParallaxLayer or drag the background in quickly.
And Remember To Create Background we need 2 nodes ParallaxBackground and ParallaxLayer These 2 nodes always go together in creating background.
And drag the image onto the sprite’s texture
And here’s when we dropped in
Next let’s adjust it to fit the window game
Like this or whatever as long as you feel ok
Now run the game
It looks blurry so we’ll import 2D again.
Note: If you are blurry, please re-import, if not, you don’t need to re-import
Import 2D pixels or 2D
Save background
Next we will save it under tscn so that we can put it in another sence without creating a new one.
Well, remember to lock the scene, lock it by pressing the padlock icon and the button next to the one with 4 white dots and a cross in it.
Name to save
And instance it with the instance button as shown below (blue button)
Select the background just Saved
And so we have the background for another sence easily
In the next lesson 9 will be how to create the menu ^^
Deathgm!