Stage 2 · Lesson 4 of 7
Small scripts and composition
Good gameplay code is built from small parts with one job each: a health , a mover, a damage dealer, a pickup. attaches components to . Godot builds scenes from child nodes.
Unreal adds to Actors. Building objects from parts like this is called composition. You can make a new enemy by combining existing pieces, instead of writing a new class or copying code.
It also makes bugs easier to find, because each part is small. (one class extending another) still has a place, such as a base enemy class, but keep those family trees shallow.
Common trapa single player script of thousands of lines that handles input, health, animation, sound and UI together.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeLearn GDScript From Zero
GDQuest · Beginner
A free browser app that teaches GDScript from zero with checked exercises
- CourseFreeGodot Docs: Your First 2D Game
Godot Engine · Beginner
The official complete first game: scenes, signals, input, spawning and a HUD
Practise
Keep handy
Also worth your time
The official guide to connecting, declaring and emitting signals
- Game Programming PatternsGo deeper
Free book on the state, observer, component and other patterns games rely on