Code of the Day
BeginnerGame Concepts

What makes a game?

Games are programs with player agency — rules, state, and a feedback loop that responds to every action.

Game DevBeginner6 min read
By the end of this lesson you will be able to:
  • Describe what distinguishes a game from other programs in terms of rules, state, and player agency
  • Identify the main components of any game — player, world, rules, and win condition
  • Explain what a feedback loop is and why it matters for game feel

A word processor is a program. A web server is a program. A game is also a program — but it has something the others lack: player agency. The player takes an action, the world responds, the player adapts to that response, and the loop continues. That cycle is the distinguishing feature of every game, from Pong to a AAA open-world title.

Understanding this before you write a single line of pygame code will save you from building things that look like games but don't feel like them.

The feedback loop

The core interaction in any game is a tight cycle:

  1. Player acts — presses a key, clicks, moves the mouse.
  2. World changes — something in the game state updates: a position, a score, a health value, an enemy's direction.
  3. Player perceives — the screen redraws (and optionally, a sound plays). The player sees the result of their action.
  4. Player adapts — they make a new decision based on what they see.

This loop needs to run fast — 30 to 60 times per second — or the game feels sluggish. We'll come back to how that works in the game loop lesson. The point right now is that the loop is the game. Strip away the graphics and sound, and what's left is this input → update → feedback cycle.

Consider Pong. The player moves a paddle up or down. The ball bounces off the paddle at an angle determined by where it hits. The player sees the new trajectory and positions themselves accordingly. That's the whole game. Everything else — sprites, scores, sounds — is decoration on top of that loop.

The four components

Most games, however simple, are built from the same four components:

Player state. The attributes that describe the player right now: position, health, score, inventory, speed. These are just variables. When the player moves left, you subtract from their x-position. When they collect a coin, you increment their score. Player state is the part of the game the player directly controls.

World state. Everything else that describes the current situation: where obstacles are, what enemies are doing, which doors are open. The world has its own rules for how it changes — enemies move on their own, timers count down without the player touching anything.

Rules. The logic that governs valid transitions. A player can't move through a wall. Hitting an enemy costs health. Reaching the exit ends the level. Rules are the if statements in your update step.

Win and lose conditions. The special rules that end the game. Health drops to zero: game over. Player reaches the goal: level complete. Without these, you have a simulation, not a game.

State and rules are already familiar from the Fundamentals track. A game is just a program where state changes in real time, in response to a human, fast enough that it feels alive.

Where to go next

Next: setting up your first pygame window — the minimum code needed to get something on screen and handle a clean exit.

Finished reading? Mark it complete to track your progress.

On this page