rustnake-1.3.0 is not a library.
Production-grade terminal Snake in Rust with deterministic ticks, decoupled core/render architecture, non-blocking input, localization, and persistent settings.
Compatibility
- Rust:
1.85+(Edition 2024). - Primary tested target: Linux
x86_64-unknown-linux-gnu. - Crate distribution: crates.io/crates/rustnake
- Terminal requirements:
- Unicode-capable font (for box-drawing and symbols).
- ANSI escape sequence support.
Install
Option 1: Install from crates.io (recommended)
Update to the latest published crate version:
By default, Cargo installs binaries to ~/.cargo/bin (or your configured Cargo bin directory).
Option 2: Download a prebuilt release binary (GitHub Releases)
Release assets include platform-specific binaries (Linux, macOS, Windows) generated by CI.
Option 3: Build from source
--locked ensures dependency resolution matches Cargo.lock exactly.
Run
From a crates.io install:
From a downloaded release binary:
From source tree:
Helper script:
Gameplay
Controls
| Action | Key |
|---|---|
| Move | WASD or Arrow Keys |
| Pause | P |
| Mute | M |
| Confirm menu option | ENTER or SPACE |
| Select menu option directly | 1-6 |
| Quit | Q |
Features
- Wrap-around movement (Nokia style).
- Four difficulty levels:
Easy,Medium,Hard,Extreme. - Power-ups for speed, score, and size effects.
- Dynamic pace scaling by score and difficulty.
- Per-difficulty high scores.
- Localized UI:
en,es,ja,pt,zh. - Responsive layout with terminal resize support.
Base Tick Rates
| Difficulty | Horizontal Tick | Vertical Tick |
|---|---|---|
| Easy | 150ms | 300ms |
| Medium | 100ms | 200ms |
| Hard | 60ms | 120ms |
| Extreme | 35ms | 70ms |
Configuration and Data
Config file location:
- Primary:
~/.rustnake.toml - Fallback:
./.rustnake.toml(ifHOMEis unavailable)
Persisted data includes:
high_scoresby difficulty- user
settings(language, pause on focus loss, sound, default difficulty) config_versionfor migration handling
Development
Quality Commands
Repository Layout
| Path | Responsibility |
|---|---|
src/core/ |
Game state, movement, collisions, scoring, power-ups |
src/i18n/ |
Localization and text width helpers |
src/input/ |
Keyboard, focus, and resize event translation |
src/layout/ |
Terminal-size validation and centered layout |
src/render/ |
Terminal rendering and HUD drawing |
src/storage/ |
Config persistence and migration |
src/utils/ |
Shared constants and enums |
Release Operations
- Ensure all quality commands pass locally.
- Update
CHANGELOG.md. - Commit and push to
main. - Create and push a semver tag (
vX.Y.Z). - GitHub Actions release workflow validates the tag/changelog, publishes GitHub release notes from
CHANGELOG.md, uploads platform binaries, and publishes to crates.io via Trusted Publisher.
Troubleshooting
- Terminal too small: resize until the warning clears (minimum baseline
40x25; some languages require wider terminals). - Display artifacts after resize: resize once more to force a full redraw.
- Missing bell/sound cue: terminal bell may be disabled by local settings.
Changelog
License
MIT. See LICENSE.