Skip to main content

Welcome to Godot

Godot is a free, open-source game engine. Games and tools are written in GDScript β€” a Python-like language built for Godot.

These lessons teach GDScript basics for programmers. You run scripts in the browser sandbox (Piston), not the full Godot editor.

What You'll Learn​

LessonTopicsEnd-of-chapter exercises
Lesson 1aFirst script, print, strings3 β€” two lines β†’ score label β†’ battle cry
Lesson 2aVariables, types, formatting3 β€” HP line β†’ after hit β†’ status board
Lesson 3aif / elif / else3 β€” parity β†’ HP band β†’ can attack
Lesson 4aLoops and arrays3 β€” countdown β†’ names β†’ highest score
Lesson 4bFunctions, params, returns3 β€” triple β†’ status line β†’ clamp
Lesson 4cDicts, classes, iterating objects3 β€” loot bag β†’ coin purse β†’ alive names
Lesson 5aVector2 + game_kit actors3 β€” length β†’ walk β†’ in range
Lesson 6aCharacter / Static / Rigid bodies (mocked)3 β€” floor β†’ static β†’ impulse
Lesson 7aAreas, overlap, collision layers3 β€” far β†’ mask β†’ fix mask
Lesson 8aMini arena (chase, score, goals)3 β€” score β†’ goal β†’ kite

Each chapter teaches a couple of ideas, then a mini quiz and a graded challenge. The Exercises block at the end is ordered easy β†’ harder β€” finish them in order.

Real engine vs mocks​

Available hereNeeds the Godot editor
Vector2, Color, Time, arrays, classesScene tree editing, InputMap, AnimationPlayer
game_kit.gd actors & body/area mocksReal CharacterBody2D physics frames

Piston copies game_kit.gd into every run as res://game_kit.gd:

var Kit = preload("res://game_kit.gd")

How scripts run here​

GDScript uses 4 spaces for indentation in these lessons (the editor Tab key inserts spaces). Mixing tabs and spaces causes a parse error. If a starter looks flat, click Reset.

  1. extends SceneTree
  2. Start work in _init()
  3. Call quit() when finished (or the sandbox will hang until timeout)
extends SceneTree

func _init():
print("Hello Godot")
quit()

Class rhythm​

Same pattern as Python / C++:

  • Teach 1–2 ideas, then a mini quiz or graded challenge
  • End the chapter with Exercises (at least three, getting harder)
  • Run code with Piston (lang="godot")