Write a WebAseembly game by hand
WebAssembly TypeScript JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src
web_modules/wast-loader
web_typings/wat
.gitattributes
.gitignore
README.md
package.json
tsconfig.json
webpack.config.js

README.md

wasm-game-by-hand (Demo)

Write a WebAssembly (wast) game by hand.

Architecture

WebAssembly                             JavaScript
 game.wat     ┌──────────────┐           index.ts
┌───┐         │              │          ┌───────┐
│   │ ───→ M  │              │  U ────→ │  Can  │
│ G │         │     VRAM     │  i       │  vas  │
│ a │      e  │              │  n       └───────┘
│ m │         │              │  t
│ e │      m  │              │  8
│   │         ┝──────────────┥  A 
│ L │      o  │              │  r
│ o │         │              │  r       ┌───────┐
│ g │ ←─── r  │    Key Map   │  a ←──── │ Key   │
│ i │         │              │  y       │ Event │
│ c │      y  │              │          └───────┘
│   │         │              │
│   │         └──────────────┘    
│   │
│ $update ←──────────────────────────── request
│   │                                   Animation
│   │                                   Frame
│   │
│ $random ────────────────────────────→ Math.
│   │                                  random
└───┘

Reference

wasm-by-hand