Summary - Godot basics
- Game Development course
- Beginner
- Lesson 66/83
- 4 min
Reinforce Godot basics with a summary task.
Godot basics summary
The viewport sits at the center of the Godot editor; the Scene panel shows the scene's nodes as a tree and the Inspector shows the properties of the node you selected. Projects live in a directory, their settings stay in project.godot and file paths start with res://. Every scene is a tree built from nodes; you create a new one with new, attach it with add_child and save the scene as a .tscn file.
func _ready():
var oyuncu = Node2D.new()
oyuncu.name = "Oyuncu"
add_child(oyuncu)
print(oyuncu.name)In this summary task you will use the pieces you have learned so far together.
Practice Final check
Inside _ready, create a Node called kok with the name "AnaSahne", create a Node2D called oyuncu with the name "Oyuncu" and add the oyuncu node under the kok node. Then print the name of the oyuncu node and the line Kayıt: res://scenes/ana_sahne.tscn.
Starter code
func _ready():
# 1) kok adında bir Node oluştur ve adını "AnaSahne" yap
# 2) oyuncu adında bir Node2D oluştur ve adını "Oyuncu" yap
# 3) oyuncu düğümünü kok düğümünün altına ekle
# 4) oyuncu düğümünün adını yazdır
# 5) "Kayıt: res://scenes/ana_sahne.tscn" satırını yazdır
passSample solution
func _ready():
var kok = Node.new()
kok.name = "AnaSahne"
var oyuncu = Node2D.new()
oyuncu.name = "Oyuncu"
kok.add_child(oyuncu)
print(oyuncu.name)
print("Kayıt: res://scenes/ana_sahne.tscn")Expected output
Oyuncu Kayıt: res://scenes/ana_sahne.tscn
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 In a new project you built your first scene, added the player node and saved it with File > Save Scene. Where does this scene file live?
- In the Godot install folder, under engine/
- In the computer's temporary files folder
- It is automatically uploaded to a remote server
- In the project directory, as a .tscn file Correct answer
Explanation: Scene files live in the project's own directory with the .tscn extension; they are not saved into the install folder or into temp folders.
2 The scene start function
func ____:
print("Hazır")
func _ready():
print("Hazır")
Explanation: The function that runs once when the scene starts must be _ready(); _process() instead runs every frame.
3 Concept recap
| Term | Meaning |
|---|---|
print |
Writes text to the Output panel |
new() |
Creates a new instance from a class |
get_parent() |
Gives the node above |
Play düğmesi |
Runs the game |