Skip to content

jbariana/rust-snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game in Rust

This is a simple Snake game written in Rust using the piston_window crate for rendering. The game ends when the snake collides with the border or itself. You can control the snake using the arrow keys.

Dependencies

  • Rust 1.0 or newer
  • piston_window for rendering
  • rand for random number generation

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/snake_game.git
    cd snake_game
  2. Ensure you have Rust installed. If you don't, follow the installation instructions from the official Rust website.
  3. Add the required dependencies to Cargo.toml:
    [dependencies]
    piston_window = "0.120.0"
    rand = "0.8"
  4. Build and run the game using Cargo
    cargo run
    

Controls

  • Arrow Keys: Control the direction of the snake.
  • Escape: Exit the game.

About

Simple snake game coded in rust.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages