Godot & the Game Loop
Godot Fundamentals
Chapter 1 · Godot & the Game Loop
Godot is a free, open-source game engine, and the tool this entire course is built around. Before writing a single line of GDScript, this chapter covers the two ideas everything else depends on: how Godot organises a game as a tree of Nodes, and how the game loop actually runs, frame by frame.
What Is Godot?
Godot is released under the MIT licence — genuinely free, with no royalties, even for a commercial game you go on to sell. As of this writing the current stable release is Godot 4.7, and the engine ships as a single executable rather than a heavy installer.
MIT licensed. No subscription, no revenue share, no per-seat cost — for a hobby project or a commercial release alike.
Godot's own built-in scripting language — deliberately close to Python's own syntax, covered fully in Chapter 2.
One engine handles both. This course focuses on 2D, since it's the faster, more forgiving place to actually learn the fundamentals.
Installing Godot
- Download the current stable build from
godotengine.org/downloadfor your platform. - Unlike many game engines, there's no installer to run — the download is a single executable file.
- Run it directly. Godot opens straight into the Project Manager, where you create or open a project.
The Node & Scene Paradigm
Everything in Godot is a Node. A sprite is a node. A sound player is a node. A camera is a node. A collision shape is a node. Each node type is a small, focused component that handles exactly one job.
Nodes are arranged in a tree — a parent can have any number of children, but every node has exactly one parent (except the root). This tree of nodes is called a scene, and a scene is typically saved as its own file so it can be reused — a player character, an enemy, a whole level can each be their own scene.
A first scene, conceptually
A simple player character scene might look like this: a Node2D as the root (giving the whole
thing a position, rotation, and scale), with a Sprite2D child (the visible image) and a
Camera2D child (so the view follows the player). Three specialised nodes, each doing one job,
combined into one reusable scene.
Scripts & the extends Keyword
A script attaches behaviour to a node. Every GDScript script starts by declaring which node type it
extends — meaning the script's own code effectively becomes part of that node, with access to
everything that node type already provides.
_ready() is one of Godot's own built-in lifecycle functions — it runs exactly once, the moment
this node is fully set up in the scene tree. It's a natural place for one-time setup, but it isn't the game
loop itself — that's covered next.
The Game Loop — _process vs. _physics_process
Godot calls two special functions repeatedly, for as long as the game runs, and the difference between them matters a great deal.
| Function | Runs | Use it for |
|---|---|---|
_process(delta) |
Every rendered frame — rate can vary with performance | UI updates, animation, general logic, reading input for an immediate response |
_physics_process(delta) |
A fixed rate, independent of rendering framerate | Movement, collisions, anything using move_and_slide() — physics needs a consistent, predictable timestep |
Both functions receive a delta parameter — a floating-point number representing how much time
has passed since the last call, typically around 0.0167 seconds at 60 frames per second.
delta — moving a fixed number of pixels per call, with
no delta involved, would make the game run faster or slower depending purely on how fast the
player's own machine happens to render frames. Multiplying by delta is what makes movement
frame-rate independent.
func/def
feel, and no semicolons. If you've worked through this site's own Python courses, GDScript will feel
immediately familiar in a way most other scripting languages won't. The real differences show up in Chapter 2:
GDScript is optionally statically typed, and it has Godot-specific building blocks — nodes, signals, scenes —
that Python's own standard library has no equivalent for.
Coding Challenges
Node2D as the scene's root, save the scene,
and run it (even with nothing visible yet — the goal is confirming your setup works end to end).
Node2D root named "Player," with a Sprite2D
child and a Camera2D child. Inspect the tree in Godot's own Scene panel and explain, in your
own words, why each node is a separate child rather than one combined node.
Node2D to your root node. Implement both _process(delta)
and _physics_process(delta), each printing its own delta value, and run the
scene to compare how often each one actually fires.
Quick Reference — Godot & the Game Loop
- Godot: free, MIT licensed, single-executable install, current stable release 4.7
- Everything is a Node; a tree of Nodes is a scene
- A script
extendsa node type, becoming part of that node _process(delta): every rendered frame, variable rate — UI, general logic_physics_process(delta): fixed rate — movement, collisions- Always scale movement by
deltafor frame-rate independence