A modern take on the classic Snake arcade game, built with Python and Tkinter. It includes dynamic themes (Classic, Ocean, Sunset, Retro), animated title reveal, score + session high score, and a reset flow from a Game Over screen.
Note: WASD and pause aren’t implemented in the current code.
sudo apt install python3-tk# 1) Clone
git clone https://github.com/your-username/snake-tkinter.git
cd snake-tkinter
# 2) Run
python snake.py
# or: python3 snake.py
snake.pyTHEMES + apply_theme(theme_name) which resets the game, recolors the canvas, and redraws the snake/food.next_turn() updates the snake’s head position, handles growth when eating food, and checks collisions before scheduling the next tick.Snake class stores coordinates and canvas rectanglesFood class spawns a new food circle at a random grid locationwindow.bind(...); Space starts the run.THEMES:
THEMES["Neon"] = {"bg": "#0A0A0A", "snake": "#39FF14", "food": "#FF2079"}
It will automatically appear in the dropdown.
SPEED and SPACE_SIZE.GAME_WIDTH / GAME_HEIGHT.P)Made by Conor Gregson
This project is open-source and available under the MIT License. See the LICENSE file for details.
Built with Python’s standard Tkinter GUI toolkit. Inspired by the classic Snake arcade game.