Godot Tutorials #1 - Hello World

Godot is a game engine like Unity, Unreal Engine, but It's also very light and new by them and that's what I like in game engines. I downloaded this game engine from the official website of Godot. (link: https://godotengine.org/download) I downloaded Mono Version because I will use C# programming language in the scripts.

After download operation, create new project in your chosen directory. I want to make a two-dimensional game, because of that I clicked 2D button on the topbar. You can see the light blue lines that define the camera boundaries.

I want to add a background. A background is actually an game object. The game objects can be known as node in Godot. So, to add node in the Godot, look at the hierarchy panel on the left and if you see the "+" button then click, and there is a window that will be appeared on the popup. In this popup, there are a lot of kind nodes. However, we are only interested in the nodes contained in Node2D:

Nodes in Node2D

I said I want to create a background in the game. So I just create a simple and empty node that called Background at first. After that, I clicked RMB on the Background node in the hierarchy that located left panel, and clicked "Add Child Node" and search TextureRect and add this.

I'm going to draw a background image with Aseprite. You can use it.
example background that I drew
I grabbed my hand as quickly as possible. This image should be in the resource directory in the game. So, I dragged to background image to the texture box in the properties of the TextureRect node that located in the right panel. Probably It probably won't fill the screen completely due to the size of the background image. As a solution, I chose the scale option in the stretch mode. Let's run the project. To run the project, you can click the this button or press F6 key:
run godot game

And the final result is like that:
final result of the game

This is our magnificent "hello" world!. The general view of the project on Godot is as follows:
General view of the Godot project

No comments:

Post a Comment