A Game library written with Rust, compiled to WebAssembly and rendered with WebGL2. Intended to be used as my final year project.
Requires node.js and npm to be installed. If you do not already have these installed, a manager like nvm is HIGHLY recommended.
Download the latest package from this repo.
Install light-server using:
npm install -g light-server
In the root directory of the downloaded folder, run:
light-server --serve .
| Key | Control |
|---|---|
W |
Move Up |
A |
Move Left |
S |
Move Down |
D |
Move Right |
1 |
Toggle FIRE |
2 |
Toggle DEFAULT |
3 |
Toggle SMOKE |
-
The
WASDcontrols are used to move theSMOKEParticle System. -
The mouse
XandYare used to change the position of theDEFAULTParticle System.
Install Rust using rustup
Check that Rust installed successfully:
rustc --version
Install wasm-pack.
Make sure your version of npm is up-to-date:
npm install npm@latest -g
Either use a client/download this repo as a zip or clone using:
git clone https://github.com/polarvoid/moon-engine.git
Switch to the moon-engine/moon directory.
cd moon-engine/moon
Build the wasm file. The initial run might take a while. Subsequent builds should be faster.
Note about wasm-pack
Make sure you've clicked on the link mentioned above and have wasm-pack installed and ready to use.
To check whether wasm-pack is installed, run:
wasm-pack --version
To build:
wasm-pack build
On a non-Windows system, you will have to change the slashes used in the include_str!() macro from \ to /. Otherwise, rustc might throw an error at you.
Switch to the www directory and install the node packages.
cd www
npm install
To run a live development server, use:
npm run start
To build the application, use:
npm run build
The files will be stored in a folder called dist/ within the www directory.
Icons made by Icongeek26 from www.flaticon.com.