Skip to content

e-kot-unamur/snake

 
 

Repository files navigation

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:

cargo build --target wasm32-unknown-unknown --release

After that, you need to generate the files about the wasm module by running:

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)

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.

About

The snake game, in a web app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 36.2%
  • JavaScript 35.1%
  • CSS 11.4%
  • HTML 9.2%
  • Dockerfile 5.0%
  • Python 3.1%