Skip to main content

A terminal-based snake game with levels, power-ups, and high score tracking.

Project description

๐Ÿ SnakeByte - Terminal Snake Game

A feature-rich, interactive Snake game playable entirely in your terminal! Built with Python and the curses module, this game supports color display, multiple levels, power-ups, score tracking, key remapping, and pause functionality.


๐ŸŽฎ Features

  • ๐ŸŸฉ Colorful terminal graphics

  • ๐Ÿง  Multiple difficulty levels: Easy, Medium, Hard

  • โšก Power-ups with dynamic effects:

    • โ–ฒ Speed Up
    • โ–ผ Slow Down
    • ร— Shrink Snake
    • + Bonus Score
    • - Score Penalty
  • โŒจ๏ธ Customizable controls via key_config.json

  • โธ๏ธ Pause menu with instructions

  • ๐Ÿ’พ High score tracking per difficulty level

  • ๐Ÿ“œ Gameplay logs stored in JSON format

  • ๐Ÿ” Seamless restart from game over


๐Ÿš€ Getting Started

๐Ÿ”ง Prerequisites

  • Python 3.7 or higher
  • Compatible with Linux, macOS, and Windows (Windows installs windows-curses)

๐Ÿ“ฆ Installation

Install via pip:

pip install snakebyte

Or clone manually from GitHub and install dependencies:

GitHub Repository: https://github.com/HattoriMan/SnakeByte

Note: Follow the instructions in the repository README.


Usage

  • Start the game(default)
snake

or

snake play
  • Debug mode
snake play --debug
  • View statistics
snake stats
  • Reset all data
snake reset

๐ŸŽฎ Controls

Action Default Keys
Move Up W / โ†‘
Move Down S / โ†“
Move Left A / โ†
Move Right D / โ†’
Pause / Resume P
Instructions I
Quit Q / Esc

๐Ÿ—‚๏ธ Project Structure

snakebyte/
โ”œโ”€โ”€ snakebyte/              # Main game package
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ game.py             # Main game logic and entry point
โ”‚   โ”œโ”€โ”€ utils.py            # Game utilities
โ”‚   โ”œโ”€โ”€ config.py           # Game configuration
โ”‚   โ””โ”€โ”€ key_config.py       # Key handling logic
โ”œโ”€โ”€ key_config.json         # User-customizable key bindings
โ”œโ”€โ”€ logs/                   # Game logs and high scores (auto-created on run)
โ”œโ”€โ”€ pyproject.toml          # Modern Python packaging configuration
โ”œโ”€โ”€ MANIFEST.in             # Package data inclusion rules
โ”œโ”€โ”€ README.md               # Project documentation
โ””โ”€โ”€ LICENSE                 # MIT License file


๐Ÿงช Levels & Gameplay

  • Levels: Easy, Medium, Hard
  • Snake wraps around screen edges
  • Avoid biting your own body
  • Collect food (โ—‰) to grow and score
  • Power-ups spawn periodically

๐Ÿ“ Logging and Data Storage

Data is stored in your system's user data directory (via appdirs), depending on your OS:

  • Linux: ~/.local/share/snakebyte/
  • Windows: %LOCALAPPDATA%\snakebyte\
  • macOS: ~/Library/Application Support/snakebyte/

These are the specific logging files stored:

  • Game history: logs/app.jsonl
  • High scores: logs/score.json
  • Error traces / Debug logs: logs/error_traceback.log
  • Key bindings: key_config.json

Example:

{
  "left": ["a", "left"],
  "right": ["d", "right"]
}

๐Ÿ”œ Upcoming Features

โœจ Planned enhancements:

  • ๐Ÿ”Š Sound effects
  • ๐Ÿ’พ Save/Load game state
  • ๐Ÿงฉ Challenges & achievements
  • ๐ŸŒ Online high score leaderboard

๐Ÿ“„ License

MIT License โ€“ free to use, modify, and distribute.


๐Ÿ™Œ Acknowledgements

Thanks to the Python community and open-source contributors for making this possible. Inspired by the classic Snake game we all loved.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakebyte-1.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snakebyte-1.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file snakebyte-1.1.0.tar.gz.

File metadata

  • Download URL: snakebyte-1.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for snakebyte-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3fe97a38e18f1ab93e0a5a0c67936ba32e5ba4d2035b4cdb7121fe8f84a40ba5
MD5 b8f98d28e67cfa861ddc922510d65196
BLAKE2b-256 3362e01a6226099d836602f842ff32846e7a50c6c36c853bf182205db615858a

See more details on using hashes here.

File details

Details for the file snakebyte-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: snakebyte-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for snakebyte-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b844edcca3b33588101aad49640133231fc8eb1dbd5d99b7c756ab3abc8920b
MD5 e30adf8815e7b5daefb109f4639cbac7
BLAKE2b-256 8efb77ce6fe916d35abd686032d6d63f5f4e9053285f9279099f7b9a9f6db1eb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page