Skip to content

kign/js-billiard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variation of a classical billiard game in JavaScript

Written in TypeScript, with elastic collision implemented (for performance reasons) in Zig programming language and compiled into Web Assembly.

Live demo

https://kign.github.io/js-billiard

Game Screenshot

Installation

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

TypeScript in Webpack

HtmlWebpackPlugin templates

About

Pool table in JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published