Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdevolde/snake
The snake game, in a web app.
https://github.com/mdevolde/snake
Last synced: about 2 months ago
JSON representation
The snake game, in a web app.
- Host: GitHub
- URL: https://github.com/mdevolde/snake
- Owner: mdevolde
- License: mit
- Created: 2023-01-15T20:02:01.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-25T08:35:10.000Z (4 months ago)
- Last Synced: 2024-08-25T23:52:50.367Z (4 months ago)
- Language: Rust
- Size: 564 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snake
This is a simple snake game written in rust using wasm.
## How to play
Use the arrow keys to move the snake around the screen. The snake will grow when it eats the food. The game ends when the snake collides with the walls or itself.
## How to run
Before you can run the project, you need to install `wasm-pack`.
Then you can build the project by running:
```bash
cargo build --target wasm32-unknown-unknown --release
```After that, you need to generate the files about the wasm module by running:
```bash
wasm-bindgen --out-dir /static/out --target web ./target/wasm32-unknown-unknown/release/snake.wasm
```Finally, you can run the project by running:
(Ensuring you have set a python environment with `requirements.txt` installed)
```bash
python app.py
```Enjoy the game!
## Deployment
There is a `Dockerfile` that you can use to deploy the project.
There is also a `captain-definition` file that you can use to deploy the project on CapRover.