A terminal-based snake game with dynamite hazards, built with Rust and Ratatui.
____ _ _ _ _ _____
/ ___|| \ | | / \ | |/ / _ \
\___ \| \| | / _ \ | ' / | | |
___) | |\ |/ ___ \| . \ |_| |
|____/|_| \_/_/ \_\_|\_\___/
- Classic snake gameplay with a twist
- Dynamite obstacles with countdown timers
- Progressive difficulty (speed increases as you grow)
- Persistent high score tracking
- Cross-platform (Linux, macOS, Windows)
- Multiple control schemes (Arrow keys, WASD, Vi-keys)
curl -sSL https://raw.githubusercontent.com/ankitvashisht12/snako/main/scripts/install.sh | bashiwr https://raw.githubusercontent.com/ankitvashisht12/snako/main/scripts/install.ps1 | iex# Requires Rust toolchain (https://rustup.rs)
cargo install --git https://github.com/ankitvashisht12/snakoDownload the appropriate binary from the Releases page.
| Key | Action |
|---|---|
| Arrow Keys / WASD / HJKL | Move snake |
| P / ESC | Pause game |
| Q | Quit |
| Enter / Space | Start game / Restart |
┌────────────────────── SNAKO ──────────────────────┐
│ Time: 02:35 | Score: 150 | High Score: 420 │
├───────────────────────────────────────────────────┤
│ │
│ @@#### │
│ ## │
│ ## () │
│ ## │
│ [3] │
│ │
│ [5] │
└───────────────────────────────────────────────────┘
@@- Snake head##- Snake body()- Apple (eat to grow and score)[N]- Dynamite with countdown timer (avoid!)
- Eat apples to grow your snake and earn points (+10 each)
- Avoid dynamites - touching one ends the game
- Don't hit walls or your own body
- Speed increases as your snake grows longer
- Dynamites spawn periodically during gameplay
- Each has a countdown timer (displayed as a number)
- When the timer reaches 0, the dynamite disappears safely
- Touching a dynamite at any point = Game Over!
High scores are automatically saved to:
| Platform | Location |
|---|---|
| Linux | ~/.local/share/snako/save.json |
| macOS | ~/Library/Application Support/com.snako.Snako/save.json |
| Windows | %LOCALAPPDATA%\snako\save.json |
# Clone the repository
git clone https://github.com/ankitvashisht12/snako.git
cd snako
# Build release version
cargo build --release
# Run the game
cargo run --release- Technology Stack - Why Rust? Why Ratatui?
- Architecture - System design and data flow
- Development Guide - Setup and contribution guide
- Terminal with at least 80x24 character support
- UTF-8 support (recommended for best visuals)
- Works on most modern terminals including:
- Linux: gnome-terminal, konsole, alacritty, kitty
- macOS: Terminal.app, iTerm2
- Windows: Windows Terminal, cmd.exe, PowerShell
Contributions are welcome! Please read the Development Guide first.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add: amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.