Skip to content

A snake game built in Rust running inside the terminal window

License

Notifications You must be signed in to change notification settings

miguelpais/rust-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A snake game built in Rust running inside the terminal window

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages