Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 836 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 836 Bytes

rust-snake

A snake game built in Rust running inside the terminal window.

alt text

How to run

$ cargo build
$ cargo run

Play with the arrows keys, pause with SPACEBAR key and exit with ESC.

Configuration

Change the following main.rs files in order to adapt the game to your needs.

  • SCREEN_SIZE: will create a fence of the desired size;
  • INITIAL_SNAKE_LENGTH: number of parts the initial snake is composed of;
  • FRAMES_PER_SECOND: number of renders occuring in a second, with each render corresponding to a snake position change. In pratice this slows or increases the snake speed;
  • FLOATING_WALLS: if the snake should teletransport through walls instead of colliding. Floating and Solid walls are rendered slightly differently.