Written in TypeScript
, with elastic collision implemented (for performance reasons) in Zig programming language
and compiled into Web Assembly.
https://kign.github.io/js-billiard
To install all node.js
dependencies:
npm install
To compile directly with TypeScript compiler (JavaScript files will be generated in js
);
these files are not used for anything right now
tsc
To start dev server
npm start
Zig
source code compilation to wasm
zig build-lib src/animation.zig -target wasm32-wasi --output-dir dist
To comple bundle with webpack
(bundle will be generated in dist
)
npm run-script build
zig build-lib src/animation.zig -target wasm32-wasi --output-dir dist && rm dist/*.o && chmod a-x dist/*
cp assets/favicon.png dist