๐Ÿ“š Foundation Course ยท Beginner Friendly

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.

๐Ÿง‘ Ages 10+ โฑ๏ธ ~1.5 Hours โš™๏ธ Godot 4.x โœ“ Free
๐Ÿ“ฆ Variables ๐Ÿ”ง Functions โšก Control Flow ๐ŸŽฒ Conditionals ๐Ÿ” Loops ๐Ÿ—๏ธ Objects
โญ
0 XP
Level 1
๐Ÿ”ฅ0
Your Progress 0 / 6 steps
1
๐Ÿ“š
What is GDScript?
Understand the language you're learning and what makes it special
Active
๐ŸŽฏ
Goal for this step

Understand what GDScript is, why Godot uses it, and how it connects to the game engine.

GDScript is a programming language designed for Godot

  • 1GDScript is a language made specifically for Godot Engine. It is simple to learn but powerful enough to build professional games.
  • 2It is similar to Python in syntax, making it beginner-friendly while being as fast as other languages.
  • 3Every object in Godot (called a Node) can have a script attached that controls its behavior.
  • 4Think of it like giving instructions to your game characters, platforms, and enemies, GDScript is how you write those instructions.
โ„น๏ธ
GDScript is built into Godot. You don't need to install anything extra, it's ready to use as soon as you open the engine.
โœ๏ธ
Fill in the Blanks
+15 XP
GDScript is a designed specifically for Engine.
๐Ÿง 
Knowledge Check
+15 XP
GDScript is similar to which language?
AJavaScript (used for websites)
BPython (simple and readable)
CC++ (complex and fast)
2
๐Ÿ“ฆ
Variables & Data Types
Learn how to store and organize information in your code
Locked
๐ŸŽฏ
Goal for this step

Understand what variables are and the different types of data you can store (numbers, text, booleans).

Variables hold information

A variable is like a named container that holds a value. You can put different types of data into variables:

  • 1Integers (whole numbers): var health = 100
  • 2Floats (decimal numbers): var speed = 5.5
  • 3Strings (text): var name = "Player"
  • 4Booleans (true/false): var is_alive = true
๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to create variables for a player character:
var health = var name = var is_moving =
๐Ÿ’ก Hint: Strings need quotes. Booleans are true or false.
๐Ÿง 
Knowledge Check
+15 XP
Which is a string data type?
A42
Btrue
C"Hello World"
3
โšก
Control Flow
Make decisions in your code with if statements and conditions
Locked
๐ŸŽฏ
Goal for this step

Learn how to use if/else statements to make your code make decisions based on conditions.

If statements create branches

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).

๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to check if the player is alive:
if health : print() else: print()
๐Ÿ’ก Hint: Check if health is greater than 0.
๐Ÿง 
Knowledge Check
+15 XP
What does this condition check? if speed >= 10:
AIf speed is greater than or equal to 10
BIf speed is less than 10
CIf speed equals 10
4
๐Ÿ”
Loops
Repeat code multiple times without writing it over and over
Locked
๐ŸŽฏ
Goal for this step

Understand for loops and while loops to repeat code efficiently.

Two types of loops

โšก
True or False?
+15 XP
A for loop repeats code a set number of times.
A while loop keeps running as long as a condition is true.
Loops can never be nested (one loop inside another).
๐Ÿง 
Knowledge Check
+15 XP
How many times does this code run? for i in range(5):
AOnce
B5 times (i = 0, 1, 2, 3, 4)
CInfinitely (until stopped)
5
๐Ÿ”ง
Functions
Write reusable blocks of code that do specific jobs
Locked
๐ŸŽฏ
Goal for this step

Learn how to create and call functions to organize and reuse your code.

Functions package code into reusable units

๐Ÿ’ป
Code Challenge
+20 XP
Fill in the blanks to create a function that damages the player:
func (): health amount if health <= 0: print("Dead!")
๐Ÿ’ก Hint: Function name should describe what it does. Use -= to subtract.
๐Ÿง 
Knowledge Check
+15 XP
What does a function with a return value do?
AReturns to the start of the program
BSends a value back to the code that called it
CRepeats until a value is returned
6
๐Ÿ†
Put It Together
Write a small script using everything you learned
Locked
๐ŸŽฏ
Goal for this step

Write a complete script that uses variables, control flow, and functions together.

Combine everything into one script

Here's a complete example of a simple player script that uses variables, functions, and control flow:

๐Ÿ’ป
Final Challenge
+30 XP
Complete this script that tracks player state:
var health = 100 var = 100 func heal(): health += amount if health > max_health: health = max_health func is_dead() -> : return health <= 0
๐Ÿ’ก Hint: Use max_health as a cap. -> bool means the function returns a boolean.
You Mastered GDScript Essentials!
You now understand the fundamentals of GDScript. You're ready to build your first Godot game!
๐ŸŽ‰โœจ๐ŸŽฎโœจ๐ŸŽ‰
0
XP Earned
1
Level Reached
๐Ÿš€ Start Your First Game โ†’