Coding Park
Platformer game lab thumbnail
Python Games · Pygame · platformer · 12 steps

Platformer Game

A pirate, some platforms, gravity : and 12 micro-steps to build everything from scratch. Each step adds one mechanic: movement, jumping, animations, camera, enemies, sound. By the end, you have a real game playable in the browser.

PythonPygame
Free · No account·Beginner–Intermediate·12 steps

What you'll build

  • ✓A playable 2D platformer, built step by step from scratch
  • ✓A pirate character with gravity, jumps, movement and smooth animations
  • ✓A world wider than the screen with a camera, parallax and one-way platforms
  • ✓A complete game: coins, score, hazards, lives, autonomous enemy and soundtrack

The steps

00
Build the first scene
Discover that a game is not a linear script but a loop that runs continuously. Understand why updating the world and drawing it are kept separate.
01
Move the character
Understand the difference between reacting to an event and reading the keyboard state continuously. Discover why speed must rely on elapsed time, not on frame count.
02
Add gravity
Model physics with two lines of math: a speed that accumulates, a constant pull downward. The ground is no longer a background : it is a surface that stops the fall.
03
Make the character jump
Understand that a jump is just an upward impulse : gravity does the rest. Discover how a single boolean is enough to prevent double-jumping.
04
Build platforms
Move from one ground to a multi-surface level. Understand why landing only happens on the way down, not on the way up : something players feel without being able to explain.
05
Finish and restart the level
Give the game a goal and a consequence for failure. Understand what a game state is and why a reset function beats rewriting everything from scratch.
06
Dress the pirate world
Replace colored rectangles with real visuals. Understand why the displayed image and the collision zone are two different things : and what that changes in how the game feels.
07
Animate the pirate
Understand that an animation is simply cycling through images at the right pace. Learn to pick the correct animation based on what the character is actually doing, not what key is pressed.
08
Explore a bigger world
Discover that a level can be much wider than the window. Understand the distinction between position in the world and position on screen, and how the camera bridges the two.
09
Collect coins
Add collectible objects and a score. Understand how to represent a collection of entities and why removing items from it mid-loop requires a little care.
10
Avoid hazards
Introduce risk and lives. Understand why resetting the player and resetting the level are two distinct operations : and what you choose to keep after an accident.
11
Face the patrol
Bring an autonomous enemy to life with minimal behaviour. Understand that a code-driven character follows the same rules as the player : you just have to decide for it.
12
Add sound and music
Understand what audio adds that visuals cannot : instant feedback on every action, an atmosphere that settles in. Discover how sound turns a prototype into a game.

Skills covered

  • · Structuring a program with a game loop
  • · Handling keyboard input and time (dt)
  • · Implementing gravity and collisions
  • · Loading and animating sprites
  • · Implementing a camera with world offset
  • · Modeling entities (coins, enemies) and their states
  • · Integrating music and sound effects

Prerequisites

  • · Beginner to intermediate Python (functions, lists, variables)
  • · No game development experience required
  • · No installation: online lab