https://github.com/krankur/snake-rs
Classic snake game implementation in Rust.
https://github.com/krankur/snake-rs
game-development piston rust snake-game
Last synced: 11 months ago
JSON representation
Classic snake game implementation in Rust.
- Host: GitHub
- URL: https://github.com/krankur/snake-rs
- Owner: krankur
- Created: 2018-08-27T07:18:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T13:24:55.000Z (over 7 years ago)
- Last Synced: 2025-01-06T09:12:03.597Z (about 1 year ago)
- Topics: game-development, piston, rust, snake-game
- Language: Rust
- Homepage:
- Size: 71.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# snake-rs
This is an implementation of the classic snake game in [Rust](https://github.com/rust-lang/rust) using [Piston](https://github.com/PistonDevelopers/piston) as the game engine. I started with the code in a [tutorial by Tensor Programming](https://www.youtube.com/watch?v=DnT_7M7L7vo), but since then it has evolved. I am planning to introduce a lot more changes to add following missing features:
- [x] Random apple position on launch
- [x] Score
- [ ] Gameover screen
- [ ] Pause option
- [ ] Gameover indicator (blinking snake to indicate it is dead)
## Prerequisites
You need to have Rust installed on your machine to run this program. Follow the [installation intructions on Rust's official website](https://www.rust-lang.org/en-US/install.html).
## Building and Running
Once you have cloned this repository to your machine, open terminal, navigate to your local repository folder and enter the following command to build the project:
```
cargo build
```
To run, enter:
```
cargo run
```
## Game controls
Use the arrow keys to direct the snake and press Esc to exit.