Stage 2 · Lesson 5 of 7
Exposed variables and tuning
is found by tweaking numbers while the game runs: speed, jump height, cooldowns, damage. So do not hard-code them. Make them that show up in the editor, where you can change them without touching code.
In use [SerializeField] fields, in @export variables, and in Unreal UPROPERTY(EditAnywhere) or variables. Then you or a designer can tune the game freely, and different enemies can share one script with different values.
Group related values, and give them sensible defaults and ranges. Later stages depend on this, especially game feel and balancing.
Common trapchanging values in play mode, finding the perfect numbers, then losing them all when you stop the game, because play mode changes are not saved.
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