Pygame challenges
Pygame Online · 10 challenges in 3 games
Each challenge hands you a broken game and one function to write; fix them all and the whole game is your code.
Bounce
Make a ball bounce, keep a paddle on screen and aim your shots, then play the Pong you built.
Snake
Move the head, detect crashes, eat and grow, and stop U-turns: four functions make Snake.
- 1. Move the snakeThe snake is frozen: its head never moves.15 XP
- 2. Crash detectionThe snake goes through walls and through itself without a scratch.20 XP
- 3. Eat and growThe snake swims over the food and stays the same length.25 XP
- 4. No U-turnsPress the arrow pointing back and the snake bites itself at once.20 XP
Blocks
Turn pieces, check that they fit and clear full rows to build a falling-blocks puzzle.
New to pygame? The pygame fundamentals cover the game loop, drawing, keys and collisions first. Progress is kept in this browser.