Python Project • Active

Snake.py

Classic arcade mechanics rebuilt in Python with Tkinter. Features 5 difficulty modes, power-up system, persistent high scores, and hidden developer cheat codes.

SCORE: 42
HIGHSCORE: 127
← → CONTROLS | SPACE = PAUSE | Q = QUIT

System Architecture

5 Difficulty Modes

Easy (75ms) → Medium (60ms) → Hard (50ms) → Extreme (40ms) → Impossible (30ms). Dynamic speed increases at 10 and 25 fruits.

Power-Up System

Random spawns with 1% probability. Blue (+2 blocks), Purple (score multiplier), Dark Green (+5 points). Strategic collection mechanics.

Persistent High Scores

Local file I/O for score tracking. Survives sessions. High score syncs across all difficulty modes.

Developer Cheats

Press '/' during gameplay to activate cheat mode:

  • slow - Reduce game speed
  • setspeed - Custom speed control
  • bigsnake - Add 10 blocks
  • biggersnake - Add 25 blocks
  • invincible - Disable collision
  • disablecheat - Exit cheat mode

Collision Detection

Precise boundary checking (±300px arena). Self-collision algorithm validates all snake blocks. Clean game-over state management.

Pause/Resume System

Spacebar toggle. State preservation during pause. Clean UI overlay. Resume countdown (3-2-1-Go).

Tech Stack

Python 3.6+ Tkinter/Turtle Graphics Random Module File I/O Event-Driven Programming State Management

Local Setup

guest@akshaj-system
guest@akshaj:~$ git clone https://github.com/aksgamigg/snake-game.git
guest@akshaj:~$ cd snake-game
# Ensure Python 3.6+ and Tkinter are installed
guest@akshaj:~/snake-game$ python snake-game.py
> Launching GUI...
> System initialized
> Select difficulty mode: Easy/Medium/Hard/Extreme/Impossible
> Game starting in 3... 2... 1... Go!