Game development

Stage 2 · Lesson 4 of 7

Small scripts and composition

Programming for games

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

Practise

  • Free Godot 4 project tutorials and open source demos to build and read

  • A friendly one-sitting Godot course that builds a small platformer

Keep handy

Also worth your time

Mark this stage as not done?