Peggle game in Godot 3 > Tutorial 01 - Create a new project
Hello, everyone! Peggle is an awesome game. It looks simple but it's so engaging and entertaining. If you have never played it, I strongly recommend trying it. You will like it. Also, there is a new version called Peggle Blast for mobile platforms, but I played the old PC version and will base this tutorial on that experience.
Ok, let's start. As you may guess already, we will use Godot Engine. It's free, open-source, and has many cool features. If you don't have it, just download it. The current version of the engine is 3.2.
Start Godot and create a new project. For the project name let's go with Pegball Tutorial:
First, Go to Project -> Project Settings -> Display -> Window and set width and height to 1024 and 768.
How to set default (main) scene in Godot
Start the game -> Godot asks about the default scene -> choose the scene OR Go to Project -> Project Settings -> General tab -> Application -> Run -> set Main Scene
After this, the game starts and you see a window filled with grey color. Nice 🙂!
Now let's change the background color from grey to white. There are few ways to do so - in project settings or by script.
How to set background color in Godot
Go to Project -> Project Settings -> General tab -> Rendering -> Environment -> set Default Clear Color
also you can
Go to Project -> Project Settings -> General tab -> Application -> Boot Splash -> set Bg Color to change color of the load screen
This way works well, but it also changes the background for the editor itself.
In this script, we will write the main game logic and everything that need to make the game working. For now, just let's change the default background color to white. It can be any color you want, but actually, it will have no sense as soon as the game be filled with graphics.
extends Node2D
func _ready():
VisualServer.set_default_clear_color(Color(1,1,1))
How to set background color in Godot (by script)
In the game's main scene add this code: VisualServer.set_default_clear_color(Color(1,1,1))
Comments
Post a Comment