Reptil en Peligro is a terminal-based Snake game built in Rust using ratatui for the TUI (Terminal User Interface) and crossterm for terminal input/output handling.
---
- Responsive TUI rendering with
ratatui - Smooth snake movement
- Fruits displayed as square blocks for consistent visuals
- Stylish top banner displaying:
- Game title
- Current score
- Elapsed time
- Dynamic board resizing based on terminal size
- Collision detection (walls, snake body)
- Arrow key controls +
q/Escto quit
- Rust and Cargo installed (Install Rust)
- ANSI-compatible terminal
git clone https://github.com/aguacero7/rep
cd reptil-en-peligro
cargo runcargo install reptil-en-peligroThen run:
rep| Key | Action |
|---|---|
| ↑ | Move up |
| ↓ | Move down |
| ← | Move left |
| → | Move right |
q |
Quit |
Esc |
Quit |
src/
├── main.rs # Entry point
├── ui.rs # Board and interface rendering
├── game.rs # Game logic
├── event.rs # Keyboard input and tick handling
License: MIT