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.
- Rust 1.0 or newer
piston_windowfor renderingrandfor random number generation
- Clone the repository:
git clone https://github.com/yourusername/snake_game.git cd snake_game - Ensure you have Rust installed. If you don't, follow the installation instructions from the official Rust website.
- Add the required dependencies to Cargo.toml:
[dependencies] piston_window = "0.120.0" rand = "0.8"
- Build and run the game using Cargo
cargo run
- Arrow Keys: Control the direction of the snake.
- Escape: Exit the game.