๐ Simple Snake Game A fun and easy-to-play Snake Game made using Python. Itโs a great project to see how computer logic and graphics work together.
๐ฎ How to Play Start: Run the Python file.
Move: Use your Arrow Keys (Up, Down, Left, Right).
Goal: Eat the Red Apples to get points.
Rules: - Every time you eat, you grow longer.
Don't hit the walls!
Don't bite your own body!
๐ก How it Works (Simple Logic) ๐ 1. The Map (Coordinates) The game sees the screen as a grid of small squares.
X moves you side-to-side.
Y moves you up and down.
Note: In coding, Down is Plus (+) and Up is Minus (-).
๐ 2. Moving the Snake The snake doesn't actually "slide." Instead, every split second:
It adds a new block at the front (where it's going).
It removes the last block from the back. This makes it look like the snake is moving!
๐ 3. Eating and Growing When the snake's head touches the apple:
We add the new block at the front.
But we don't remove the block from the back.
Result: The snake gets longer by one block!
๐ฅ 4. Game Over The game stops if:
You go off the edge of the screen.
The head touches any other part of the snake's body.
๐ ๏ธ Tech Used Python.
Tkinter: The tool used to draw the game window and snake.
๐ Want to change the game? Look at the top of the code! You can change:
SPEED: Lower number = Faster game.
SNAKE_COLOR: Change "green" to your favorite color.
GAME_WIDTH: Make the box bigger or smaller.