GDScript
Essentials
Master the fundamentals of GDScript before building Godot games. Learn variables, functions, control flow, and how the game engine works. No game building yet, just pure learning.
Master the fundamentals of GDScript before building Godot games. Learn variables, functions, control flow, and how the game engine works. No game building yet, just pure learning.
Understand what GDScript is, why Godot uses it, and how it connects to the game engine.
Understand what variables are and the different types of data you can store (numbers, text, booleans).
A variable is like a named container that holds a value. You can put different types of data into variables:
var health = 100var speed = 5.5var name = "Player"var is_alive = trueLearn how to use if/else statements to make your code make decisions based on conditions.
An if statement checks if a condition is true. If it is, code inside the if block runs. Otherwise, the else block runs (if it exists).
if speed >= 10:Understand for loops and while loops to repeat code efficiently.
for i in range(5):Learn how to create and call functions to organize and reuse your code.
Write a complete script that uses variables, control flow, and functions together.
Here's a complete example of a simple player script that uses variables, functions, and control flow: