Stage 2 · Lesson 7 of 7
Debugging games
Game bugs are often visual or about timing, so debug by seeing what happens. Print values to the console. Pause the game on , lines in your code editor where the program stops so you can inspect values.
Draw debug lines, shapes and text in the game view, such as rays, , paths and velocities. Engines help here. has Debug.Log and Debug.DrawRay, has print and a visible collision shapes option, and Unreal has UE_LOG and DrawDebugLine.
Learn to attach the and step through a frame one line at a time. Always make a bug happen reliably before you try to fix it.
Common trapleaving hundreds of log lines printing every frame, which slows the game and buries the one message you need.
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