Lecture W2T1: The Game Loop, Then Paddles
September 1, 2026
LECTURE W2T1 // THE GAME LOOP, THEN PADDLES
The plan:
delta, and the two clocks. Just enough theory to build with.Housekeeping: Lab 0 is due tonight, 9:59 PM.
Four rivals, four personalities:
Also canon: figs trigger the Fig Break - for a few seconds the chase flips and the rivals run from you.
It is all in the pac-blitz README as of this morning - and each of those four personalities is a brain we will actually write in the state-machines weeks. A brain that has to think every single frame. Time to meet the frame.
Strip away the genre and the graphics card, and every game since Pong is:
blitz.gd: there is no while anywhere._process(delta) runs._process, _ready, signal handlers) is a hook into this one cycle.Thursday we discussed how * delta and Blitz’s speed changed with the machine. Here is the same line with its units written out:
speed = 260 pixels per second - a rate.delta = seconds since the last frame - a slice of time the engine hands you.delta, speed silently means pixels per frame - and nobody agreed how long a frame is.| Machine | Frame rate | delta |
Moved this frame | Moved per second |
|---|---|---|---|---|
| Gaming laptop | 240 fps | 0.004 s | ~1.1 px | 260 px |
| Lab machine | 60 fps | 0.017 s | ~4.3 px | 260 px |
| Dying potato | 30 fps | 0.033 s | ~8.7 px | 260 px |
Fast machines take many small steps; slow machines take few big ones; everyone arrives together. Never ship motion without delta - your paddle and your ball both obey this rule.
_physics_process(delta) - called every physics tick, delta always the same.| _process | _physics_process | |
|---|---|---|
| Called | per rendered frame | per physics tick |
delta |
varies | constant (1/60 s) |
| Use for | visuals, UI, input polling, your own movement math | moving physics bodies, anything the physics engine resolves |
_process. And that is the honest answer, not a shortcut:
move_and_slide, real collisions), the code moves to _physics_process.move_and_slide(), collision layers and masks - the ghost stops eating our marionberries, and your paddle game’s arithmetic becomes real physics.The proof is runnable. The demo code lives on a branch of the reference repo:
On that branch, blitz.gd wiretaps both clocks:
Run it and read the Output panel: physics: is the same number every line - the fixed clock, right there. frame: wobbles - the render clock, living its life. Two clocks, live.
frame: deltas tripled and the movement math absorbed them. physics: never flinched. Set it back to 0.main.gd on the demo branch:Uncomment it, run: the whole world in slow motion, one number. It works only because every moving thing multiplies by delta.
Run all three on your paddle game during studio time.
Lab 1: Paddle Game. A paddle you control, a marionberry that flies and bounces, a rally to keep alive - and at least one twist that makes it yours.
_process + delta, Input, clamp, and the signal doorbell from the marionberries.GUIDE.md - a milestone-by-milestone build guide with the code, plus Dials and Your call boxes where the design is yours.project.godot in Godot; open GUIDE.md next to it.main is submitting, and a half-built pushed game beats a finished unpushed one.Requirements, short version: paddle (clamped), ball (bounces, serves after a miss), a visible rally/score, one custom feature, class code style (typed vars, @export tunables, * delta). Full list in the repo README, along with the Your Submission section you fill before the deadline.
| Builds | You already met it as | |
|---|---|---|
| M1 | A paddle that obeys | Blitz’s movement, one axis |
| M2 | A berry that flies and bounces | velocity * delta, viewport bounds |
| M3 | The rally (paddle hits ball) | The marionberry’s area_entered doorbell |
| M4 | Speed-up, best rally, tuning | @export dials, compounding difficulty |
| M5 | Make it yours (required) | Your imagination, plus the menu in the guide |
M5’s menu: second player (with your first custom Input Map actions), angle control off the paddle face, lives and game over, an on-screen score Label, juice (time_scale slow-mo on a miss), or a full reskin. Or invent your own.
Build until 11:00. I am circulating - flag me down early and often.
Stuck? In order: the Nothing happened? table at the bottom of GUIDE.md → ask “which class moment is this?” → your neighbor → me.
At 11:00 sharp: status check - everyone names their M5 twist out loud. Claim it before someone else does.
Lab 0: Press Start - due tonight, 9:59 PM via Canvas. Last call.
Lab 1: Paddle Game - due Thursday, September 10, 9:59 PM. Keep building from where class left off; the guide walks the whole way.
Reading for Thursday (highly recommended): Godot: Your first 2D game - skim the player scene sections; you will recognize almost everything now.
Next time: input actions done right, real movement with velocity + move_and_slide() on the physics clock, and collision layers and masks - the ghost learns manners, and the rival cast starts becoming real.
