Giter VIP home page Giter VIP logo

billiards's Introduction

billiards

codecov CodeFactor Code Smells Tests Open in Gitpod

Demo

Features

Unsophisticated billiards with spinning ball physics written in typescript.

  • Backspin and sidespin well modeled.
  • Presentation using WebGL in any modern browser or mobile.
  • Record and playback breaks.
  • Two player online mode with node websocket server.
  • Nine ball and three cushion billiards rules

Online Demo

Demos run in all major browsers and use WebGL

Reference material

Key equations

Based on Han 2005 paper

surface velocity

equation

sliding motion

equation

equation

equation

rolling motion

equation

equation

where

equation ,equation

cushion bounce

Useful commands

Install

nvm use v18.17.1
yarn install
yarn dev

This generates artefacts in /dist for prod deployment (e.g. on github static pages)

Run

yarn serve

Then open http://localhost:8080/ in your browser to play

Test

yarn test
yarn coverage

Maintain

yarn deps
yarn upgrade -L
yarn prettify

Two player

yarn websocket

the client uses query parameter ?websocketserver=wss://some-host to locate a websocket server, open http://localhost:8888/dist/multi.html to see options

Controls

Use mouse or keyboard:

Aim

Control Fine aim

Topspin and backspin

Shift Side spin

Space Hit - hold for more power

Progress snapshots

July 2018

2018

July 2019

2019

March 2021

2021

August 2023 (mobile)

top aim
2023 2023

Star History

Star History Chart

billiards's People

Contributors

tailuge avatar bownie avatar shmup avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.