rustnake-1.2.1 is not a library.
Quick Start
Latest release (fastest, Linux x86_64)
Verified target: Linux x86_64.
Update to the newest release
Check latest published tag
|
Build from source
Prerequisite: Rust stable toolchain (rustup, cargo).
Local launcher script
Gameplay
Features
- Nokia-style wrap movement (no wall death).
- Four difficulties with distinct base tick rates (
Easy,Medium,Hard,Extreme). - Power-ups that affect speed, score, and snake size.
- Dynamic pace scaling as score increases.
- Per-difficulty high-score tracking.
- Localized UI (
en,es,ja,pt,zh) with persistent language setting. - Centered playfield and HUD with live terminal resize handling.
Controls
| Action | Key |
|---|---|
| Move | WASD or Arrow Keys |
| Pause | P |
| Mute | M |
| Back to Menu | SPACE |
| Quit | Q |
- Number keys (
1-6) select visible menu options, depending on menu length. ENTERorSPACEconfirms menu selection.
Difficulty Tick Rates
| Difficulty | Horizontal Tick | Vertical Tick |
|---|---|---|
| Easy | 150ms | 300ms |
| Medium | 100ms | 200ms |
| Hard | 60ms | 120ms |
| Extreme | 35ms | 70ms |
Scoring and Power-Ups
- Basic food (
●):+10 - Milestone marker (
★): shown at score multiples of50 - Speed Boost (
>): temporary faster movement - Slow Down (
<): temporary slower movement - Bonus (
$): instant+50 - Grow (
+): adds 2 segments - Shrink (
-): removes up to 2 segments (minimum length preserved)
Engineering Highlights
- Deterministic tick scheduling with direction-aware tick-rate selection.
- Bounded 2-step input queue for responsive turns without illegal reversals.
- Incremental redraw via dirty-position tracking to reduce unnecessary terminal writes.
- Persistence via
serde+tomlfor per-difficulty best scores. - Config migration pipeline for backward-compatible
~/.rustnake.tomlupgrades. - Unit tests covering movement, collisions, speed effects, and score behavior.
| Path | Responsibility |
|---|---|
src/core/ |
State, movement, collisions, scoring, power-ups |
src/i18n/ |
Localization strings and UI text width helpers |
src/input/ |
Keyboard and resize events |
src/render/ |
Terminal drawing and HUD |
src/layout/ |
Centering and terminal-size validation |
src/storage/ |
High-score persistence |
src/utils/ |
Shared enums, constants, and types |
Proof of Quality
Config and high scores are persisted in:
~/.rustnake.toml- Fallback:
./.rustnake.tomlifHOMEis unavailable
Troubleshooting
- Terminal too small: resize until the warning clears (minimum is at least
40x25, and width can be higher for some languages). - Visual artifacts after resize: resize once more to force full redraw.
- No bell sound: your terminal may have bell notifications disabled.
Changelog
License
MIT. See LICENSE.