A polished Snake game in Python with 6 modes, power-ups, mazes, versus play and a smart AI.

The complete version of our Snake tutorial: smooth movement, an input buffer that never drops a turn, power-ups, 5 handcrafted mazes, Time Attack, local 2-player and Versus-AI modes, and an A* AI that checks it can still reach its own tail before it commits to a path.
Upgrades the free tutorial: How to Make a Snake Game in Python
Everything the tutorial leaves as an exercise, done properly.
Classic, Wraparound, Maze Adventure, Time Attack, Versus AI and local 2 Players.
A* pathfinding with a safety check and flood-fill fallback. It survives 1,500+ moves in tests.
The head and tail glide between cells while the corners stay crisp, with a 3-turn input buffer.
Golden apples, slow motion and shrink, with glow, particles and popups.
Plain-text maze layouts. Eat 8 apples to unlock the next one.
Per-mode leaderboards with name entry, plus settings for grid, smoothing and volume.
Sound effects and an original chiptune loop generated in code.
16 pytest tests cover movement, collisions, power-ups, mazes and the AI.
Real, unedited screenshots of the game. Every pixel is drawn by the code you get.
The tutorial is great for learning the basics. This is the version you'd actually ship.
| Free tutorial | Snake Pro | |
|---|---|---|
| Movement | Jumps cell to cell | Smooth, interpolated |
| Fast turns | Can be dropped | 3-turn input buffer |
| Game modes | 1 | 6 + Watch the AI |
| Opponents | — | AI snake or a 2nd player |
| Power-ups and mazes | — | 3 power-ups, 5 mazes |
| Menus, pause, high scores | — | ✓ |
| Sound & music | — | ✓ synthesized |
| Tests | — | 16 pytest tests |
Clean, commented, modular Python. Here's the start of snake_pro/ai.py:
def choose(game: Game, me: Snake) -> str:
"""Return the direction the AI snake should take next."""
blocked = _obstacles(game, me)
targets = []
if game.power and game.power.kind != "shrink":
targets.append(game.power.pos)
if game.food:
targets.append(game.food)
targets.sort(key=lambda t: _distance(game, me.head, t))
for target in targets:
path = astar(game, me.head, target, blocked)
if path and _safe_after(game, me, path):
d = _direction_to(game, me.head, path[0])
The Game Dev Pro Pack includes Snake Pro plus our other premium games, for $21.75 instead of $63 when bought one by one.
What's in the pack?
Python 3.8 or newer and pygame (pip install pygame-ce, or classic pygame). It works on Windows, macOS and Linux. There are no image or sound files to download: everything is generated in code.
You're sent straight to your download page, and we email you the link too. The link keeps working, so you can re-download updated versions later. Lost it? Recover your downloads with your email.
If you've followed our free tutorial, yes. The code is split into small, commented modules, and the README walks through the architecture. It's the ideal next step after the tutorial.
Yes. You can modify it, learn from it, and ship your own games built on it, even commercially. The only thing you can't do is redistribute or resell the source code itself.
Email us within 14 days and we'll refund you. No questions asked.
$7.50 one-time. Instant download, free updates.
An advanced Tetris-style game in Python: modern rules, AI player, juice and tests
A polished Flappy-style game in Python, plus an AI that teaches itself to fly
A complete chess game in Python with its own AI engine you can play against
A tight, modern 2D platformer in Python with 6 levels, wall jumps and a built-in level editor