Crates.io | moon-engine |
lib.rs | moon-engine |
version | 0.1.1 |
source | src |
created_at | 2022-03-28 12:56:50.115953 |
updated_at | 2022-07-26 02:24:28.651588 |
description | A WebGL2/WASM Game Library written in the Rust programming language. |
homepage | |
repository | https://github.com/polarvoid/moon-engine |
max_upload_size | |
id | 557820 |
size | 1,544,499 |
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 .
Click anywhere on the Canvas to control the demo, and Esc to leave it
Key | Control |
---|---|
W | Move Forward |
A | Move Left |
S | Move Backward |
D | Move Right |
Mouse movements to look around
Install Rust using rustup
Check that Rust installed successfully using rustc --version
Install wasm-pack.
Make sure your version of npm is up-to-date with 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.
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 the command 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.
"Matilda" by nicolekeane is licensed under CC Attribution-NonCommercial-ShareAlike.
Icons made by Icongeek26 from www.flaticon.com.