reptil-en-peligro

Crates.ioreptil-en-peligro
lib.rsreptil-en-peligro
version1.0.1
created_at2025-08-14 14:48:20.639216+00
updated_at2025-08-14 16:12:09.840458+00
descriptionA terminal-based Snake game in Rust using ratatui/crossterm with a stylish banner, square fruits, and smooth gameplay.
homepagehttps://github.com/aguacero7/reptil-en-peligro
repositoryhttps://github.com/aguacero7/reptil-en-peligro
max_upload_size
id1794947
size38,748
Aguacero 🌧️ (aguacero7)

documentation

https://docs.rs/reptil-en-peligro

README

Reptil en Peligro

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.

The size of the board depends on the size of your terminal's window.

Features

  • 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 / Esc to quit

Requirements

  • Rust and Cargo installed (Install Rust)
  • ANSI-compatible terminal

Installation

From source

git clone https://github.com/aguacero7/rep
cd reptil-en-peligro
cargo run

Global installation via cargo install

cargo install reptil-en-peligro

Then run:

rep

Controls

Key Action
Move up
Move down
Move left
Move right
q Quit
Esc Quit

Project Structure

src/
├── main.rs      # Entry point
├── ui.rs        # Board and interface rendering
├── game.rs      # Game logic
├── event.rs     # Keyboard input and tick handling

Example Screenshot

image ---

License: MIT

Commit count: 0

cargo fmt