No Description
Inderjit Gill 2d1bde4623 wasm-bindgen 0.2.17 3 months ago
benches basic framework added from roguelike 5 months ago
research bug fix: multiple requestAnimationFrame calls 4 months ago
src wasm-bindgen 0.2.17 3 months ago
web in-game option: restart working 4 months ago
.gitignore basic framework added from roguelike 5 months ago
Cargo.lock wasm-bindgen 0.2.17 3 months ago
Cargo.toml wasm-bindgen 0.2.17 3 months ago
LICENSE Initial commit 5 months ago
README.md basic framework added from roguelike 5 months ago
index.html canvas occupies as much of the parent as possible 4 months ago
package-lock.json Audio using Howler library 4 months ago
package.json replaced absolute paths to resources with relative 4 months ago
serve.go replaced absolute paths to resources with relative 4 months ago
webpack.config.js basic framework added from roguelike 5 months ago

README.md

Tetris

Overview

A Game

ensure that the correct toolchain is installed

$ rustup update
$ rustup install nightly
$ rustup target add wasm32-unknown-unknown --toolchain nightly
$ cargo +nightly install wasm-bindgen-cli

$ npm install
$ npm run build:server

during dev

$ npm run build:dev:wasm
$ npm run build:dev
$ npm run serve:dev

can now visit http://localhost:8080

for ‘release’

$ npm run build:release
$ npm run serve:release

can now visit http://localhost:3000

misc. notes

graphics

  • origin is in the bottom left
  • rendering order for a square is: bl, br, tl, tr

file structure

/dist -> destination directory for webpack output (npm run build) index.html /src -> rust source for top-level program + wasm declarations /target -> destination directory for rust /web -> destination for wasm-bindgen generated files (*.js, *.ts, *.wasm) /web/js -> js files