This project is an implementation of the classic Snake game, probably most prominently found on 90's-era Nokia cell phones. The twist is that it is written in the Rust programming language, and also that it still manages to run in your browser! This is achieved through the magic of WebAssembly.
This projects serves multiple purposes:
- I wanted to familiarize myself with compile-to-WASM technology.
- I wanted a small game project that I could actually complete in a reasonable amount of time.
- When it is complete, it can also serve as a playground to try out a few things on it, both gameplay- and presentation-wise.
If you want to play around with this on your machine, you will need the following things:
- Rust 1.85.0 or newer, including Cargo
wasm-packavailable in your PATHmake- Python 3 (for a simple local server)
The exact minimum version requirements for tools other than Rust are currently not pinned.
If you have rustup installed,
which is the recommended way to install Rust,
the checked-in toolchain configuration will use stable automatically.
With all this out of the way, you should be able to run
make start
which runs wasm-pack
and starts a local development server,
on http://localhost:8000.
To run lint checks, use
make lint
If you change Rust source files,
stop and rerun make start.
Licensed under either of
- Apache License, Version 2.0, (see LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (see LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
SPDX-License-Identifier: Apache-2.0 OR MIT
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.