Pool game

2022

This is a pool game, written in Vanilla JS. It features rich graphics, including light effects and shadows. All drawing operations are done with an HTML canvas. No graphics library is used. Sound effects are also available.

The collision between the balls uses the 2-dimensional elastic collision. Of course, the balls also bounce off the borders, but also the polygon-shaped bumpers. This requires some mathematical calculations.

The mouse is used to determine the orientation and energy of the next shot.

There are popups when the game is won (all balls are pocketed, the black one last) or lost (the black ball is pocketed too early, or the black and the white ball are both pocketed).

screenshot
  • Browser game
  • HTML Canvas
  • Mathematics
  • Tutorial
  • Vanilla JS