Snake Game
🐍 Classic Snake Game – Python
Project Type: Personal / Educational
Technologies Used: Python, Pygame
This project is a recreation of the classic Snake game that many of us remember from old mobile phones. It was one of the first games I coded when learning Python and helped me understand key programming concepts like loops, collision detection, and game logic.
The objective is simple: guide the snake to eat food, avoid walls and itself, and grow as long as possible. I kept the design clean and functional, focusing on gameplay mechanics rather than visuals.
This project was a fun challenge and a great introduction to real-time game loops, grid-based movement, and keyboard input handling in Python.
Main.py
The main.py file has the screen setup and loops as wel as if statements to control the snake it also imports the snake, scoreboard and food.
It also controls the game to ensure it is still running and also determine when a wall was hit and the game is over.
This also sets the keys that will be used to control the snake.
scoreboard.py
In the scoreboard the Turtle module is imported, and where the score is displayed, the color is set, and three functions control how he scoreboard functions. These are called and altered in the main.py
snake.py
In this file, the snake shape is set up as well as how it must turn the keys are set up in main.py.
This also creates the snake at a starting position.
food.py
The food is created here, and the color is set. there is also a random function that is used to ensure that it appears randomly on the screen every time.