What is this?
A small Snake game written in Python with pygame. It also runs in the browser through pygbag, which is why you can play it on itch.io.
The rules are what set it apart from the usual version:
The food
Red circle · 1 point
Always on the board. Fills two cells when eaten (its own plus one random extra), so it is the fastest way to finish.
Green square · 5 points
Jumps to a new spot every 5 seconds and shrinks as its timer runs out. Fills one cell.
Blue triangle · 5 points
Appears each time the total score passes another 10 points. Gives a speed boost that stacks and wears off after 10 seconds.
The game speeds up as you score, so late-game fills get tense.
Modes and controls
| Mode | Controls | How it ends |
|---|---|---|
| 1 Player | P1 WASD | Fill the board and beat your best score. |
| 2 Players | P1 WASD P2 arrow keys | Highest score when the board fills wins. |
Space pauses (1 player only). Q or Esc returns to the menu at any time. R restarts from the end screen.
Board sizes
Pick Small (15×12), Medium (30×25) or Large (45×35) on the start screen. Your best score is saved separately for each size in snake_highscore.json, next to the script.
Run it locally
You need Python 3 and pygame.
pip install pygame
python snake.py
Replace snake.py with the name of the script in this repo.
Make it yours
The tunable values sit at the top of the script with comments. You can change:
- Board sizes, by adding a row to
PRESETS - Starting speed and speed cap (
FPS_START,FPS_MAX) - Blue boost strength and decay time (
BLUE_BOOST,BLUE_DECAY) - How often green food moves (
GREEN_CYCLE) - Every color in the game, in the colors block