A modern and stylish Snake game built with Python and Pygame, featuring a synthwave aesthetic.
Project description
🐍 Slither.py
The Ultimate Synthwave Snake Game
Retro vibes. Neon grids. Modern Python.
❓ Why Slither.py?
- Unique Visuals: Synthwave-inspired, with glowing effects and pixel-perfect animations.
- Modern Python: Built with best practices, Poetry, and type hints.
- Fun to Play, Fun to Hack: Easy to customize, extend, and remix.
- Great for Learning: Clean code, modular structure, and plenty of comments.
- Community-Driven: Open to contributions, ideas, and new features.
🚀 Features
- Synthwave/Neon UI: Neon grids, glowing snake, animated food, custom fonts.
- Classic & Modern Gameplay: Growth, collisions, scoring, persistent high score.
- Sound Effects: Customizable sounds for eating and collisions.
- Menu, Pause, Game Over: Professional navigation, modern UX, and visual feedback.
- Progressive Difficulty: The game speeds up as you improve.
- Skin System: 10+ modular skins (Synthwave, Classic, Matrix, Solarized, Halloween, Ocean, Ice, Fire, Forest, Pastel, Monochrome, Sunset) with live preview and selection in the menu.
- AI Demo Mode: Let the game play itself! Enter demo mode from the menu (press D) or after inactivity. Watch the AI snake in action.
- Controller Support: Play with keyboard or gamepad. D-Pad for movement/skin selection, A/X to start, B/O to exit, Start to pause.
- Easy Customization: Tweak colors, sounds, and fonts to your taste.
- 100% Open Source: Clean, tested, and easily extensible codebase.
📦 Installation
Requirements:
- Python 3.10+
- Poetry (recommended)
Quick Start:
git clone https://github.com/vmaritato/slither-py.git
cd slither-py
poetry install
poetry run slither play
🎮 Controls
| Key / Button | Action |
|---|---|
| Arrows / D-Pad | Move the snake / Change skin (menu) |
| P | Pause/Resume |
| Enter / A/X | Start/Restart |
| Esc / B/O | Quit |
| Start (Controller) | Pause/Resume |
| D (Menu) | Enter AI Demo Mode |
| Any key/button (Demo) | Exit Demo Mode, return to menu |
- Controller support: Plug-and-play with Xbox, PlayStation, and most USB/Bluetooth gamepads. Menu navigation and gameplay fully supported.
🛠️ Customization
- Board Size & Grid: The board now fills the entire window. To change the playfield size, edit
WIDTH,HEIGHT, orCELL_SIZEinslither/config.py. The grid adapts automatically. - Colors & Style: Tweak the synthwave palette or pick from 10+ skins in
slither/skins/. - Sounds: Replace files in
assets/sounds/with your own effects. - Font: Add a
.ttffile asassets/fonts/pixel_font.ttffor a unique look.
🧪 Testing
poetry run pytest
💡 FAQ
Q: How do I change the board or grid size?
A: Edit WIDTH, HEIGHT, or CELL_SIZE in slither/config.py. The board and grid will automatically adapt to the new window size.
Q: How do I change the theme or colors?
A: Edit the color constants in slither/config.py or pick a different skin from the main menu.
Q: Can I use my own sounds or fonts?
A: Absolutely! Just replace the files in assets/sounds/ or add your font as assets/fonts/pixel_font.ttf.
Q: Can I contribute new features?
A: Yes! Please open an issue or pull request. All contributions are welcome.
Q: Does it work on Windows/Linux/Mac?
A: Yes, as long as you have Python 3.10+ and Pygame installed.
🤝 Contributing
Contributions, bug reports, and suggestions are welcome!
See CONTRIBUTING.md for guidelines.
📄 License
This project is licensed under the MIT License.
See LICENSE for details.
👨💻 Author
Vincenzo Maritato
Contact: hello@vmaritato.com
⭐️ Show Your Support!
If you like this project, please consider starring it on GitHub and sharing it with your friends!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slither_py-1.0.0.tar.gz.
File metadata
- Download URL: slither_py-1.0.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a881cb457191511b7540a294ff777bfc1b989c824108a73e5f5add9cbfda6fa
|
|
| MD5 |
7f9c70085ecb18bd26516a7a680ea47b
|
|
| BLAKE2b-256 |
e233cf471a9a55899c6e052099dc35fa2429ade112aa1a261370bb1f92c830ce
|
File details
Details for the file slither_py-1.0.0-py3-none-any.whl.
File metadata
- Download URL: slither_py-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f529b9ce5dfbe1650de5a38ceda7774a09f5784af39bef9d2b5bc53e20e397ef
|
|
| MD5 |
07e60495a5156f9cd126d890a8d06809
|
|
| BLAKE2b-256 |
99fb79c976b9f80b2d0560bde5b258ec520b696f05490324ed3fbb448b245c09
|