You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Inderjit Gill 0940e96bc8 in-game option: restart working 1 year ago
benches basic framework added from roguelike 1 year ago
research bug fix: multiple requestAnimationFrame calls 1 year ago
src in-game option: restart working 1 year ago
web in-game option: restart working 1 year ago
.gitignore basic framework added from roguelike 1 year ago
Cargo.lock colour is a source file 1 year ago
Cargo.toml colour is a source file 1 year ago
LICENSE Initial commit 1 year ago
README.md basic framework added from roguelike 1 year ago
index.html canvas occupies as much of the parent as possible 1 year ago
package-lock.json Audio using Howler library 1 year ago
package.json replaced absolute paths to resources with relative 1 year ago
serve.go replaced absolute paths to resources with relative 1 year ago
webpack.config.js basic framework added from roguelike 1 year 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