patrickz.aiLet’s talk ↗

Build apps / Project lab

Learn game fundamentals by building Pong

Finish a small match with deterministic scoring and restart.

About 90 minutesSome experienceStack: LÖVE (Love2D) · LuaUses a coding agentRead free · No sign-up

Before you start

A coding agent, LÖVE and Lua installed using their official instructions, and a practice folder.

Why this lesson exists

The original Pong game in LÖVE and Lua added menus and sound only after a full match worked, then power-ups one at a time. This lab stops at a restartable match with deterministic scoring, because more effects will not fix the physics.

Do the exercise

  1. Set your boundary

    Start with paddles, a ball, movement, collision, scoring and a serve state. Leave power-ups and particles until a match works.

  2. Draw paddles and a ball

    Draw two paddles and a ball.

  3. Move with delta time

    Update positions using delta time.

  4. Handle collisions

    Handle wall and paddle collisions.

  5. Add scoring and a serve

    Add scoring and a serve state. Each point counts exactly once.

  6. Make restart reset score and ball state

    Make restart reset score and ball state, so a new match starts clean.

Next sessions, not today

  • AI opponent Add one predictable AI opponent.
  • Menus and sound Add menus and sound only after a full match works.
  • Power-ups Add power-ups one at a time with expiration rules.

A prompt to adapt

Replace the bracketed parts with your own details.

Help me build Pong in LÖVE and Lua in a new practice folder, without giving me the whole solution at once. First version only: paddles, a ball, movement, collision, scoring and a serve state, until one match works. No AI opponent, menus, sound, power-ups or particles yet. List the setup commands before changing any files. Then work in five checkpoints; at each, explain the math, give a small code target and a manual test before continuing:
1. Two paddles and a ball.
2. Positions updated using delta time.
3. Wall and paddle collisions.
4. Scoring and a serve state, with each point counted exactly once.
5. A restart that resets score and ball state.
Paddle keys: [keys for each player]. Winning score: [a number].

More prompts to adapt ↗

Run this experiment

Test a wall bounce, paddle bounce, missed ball, score increase and reset. Try a slow frame rate to look for tunneling and speed changes.

Check your result

Use evidence from your output. A confident explanation from the AI is not enough.

If it isn’t working

If the ball passes through a paddle, inspect collision timing and step size. More visual effects will not repair the physics.

Where this came from

Public project repository ↗. The practice lesson is an adaptation, not a verbatim transcript. About the sources.

Prepared September 2026. Tools and interfaces change; use current official setup instructions. Session lengths are estimates.

KEEP GOING

Your next useful step

Browse all 57 guides ↗