PySnake is a modern version of the classic Snake game, developed in Python with Pygame. Your goal is to collect as many fruits as possible, avoid obstacles and enemies, and achieve a high score. The game features multiple levels, attractive graphics, sound effects, and a persistent high score that is saved between play sessions.
PySnake combines classic Snake gameplay with new elements like moving enemies (aliens) and collectible coins. You control a snake that grows longer as you eat fruit. Each level introduces new obstacles and challenges.
- Move the snake using the arrow keys (↑, ↓, ←, →).
- Collect as many fruits (apples) as you can to grow and score points.
- Collect coins for bonus points.
- Avoid running into walls, obstacles, enemies, or your own tail — any collision leads to Game Over.
- From level 2, obstacles appear; from level 3, moving enemies are added.
- Reach the target number of fruits (30) to win the game.
You win the game by collecting the required number of fruits (30) without hitting the walls, obstacles, enemies, or your own body.
- Arrow keys: Move the snake.
- Mouse: Navigate menus and info screens.
- Q: Quit the game instantly.
- The entire source code is clean, well-structured, and commented.
- Main classes:
Snake,Fruit,Coin,Enemy, and UI components. - Key functions and classes are documented with docstrings.
- The project is available on GitHub.
- (If required: Can be mirrored to GitLab.)
- Interactivity: Keyboard controls for gameplay, mouse for menus.
- Movement & Collision: The snake moves and collisions are detected.
- At least 3 moving graphical elements: Snake, coin, and enemy/alien.
- Persistent High Score: The high score is saved and loaded automatically.
- At least 2 Levels: Three levels with increasing difficulty and new obstacles.
- Attractive Graphical UI: Custom menu, info, game over and win screens, colorful game board, custom sprites.
- Sound & Sound Effects: Background music and effects when collecting fruits or coins.
- Complexity & Graphics: Additional challenges at higher levels, animated elements, and music.
- Hosting: Optionally, the game can be hosted online with (https://rabbitglauser.itch.io/pysnkae) (e.g., on itch.io).
- Make sure you have Python and Pygame installed.
- Start the game with:
python game/main.py
- Use the mouse to navigate the menu and the arrow keys to play.
The current high score is saved to the file snake_game_data.csv after each game and loaded automatically at startup.
- Background music: Plays automatically when the game starts.
- Sound effects: Play when collecting fruits (
eat.wav) and coins (coin.wav).
The project can be presented both locally and (optionally) online.
- Project presentation: Explain the main code components, level logic, and sound system.
- Live demo: Start and play the game live.
- ** Use this command to start pygame ;python -m pygbag game/ or C:\Users\samue\AppData\Local\Programs\Python\Python313\python.exe -m pygbag game/
Have fun playing PySnake!


