https://github.com/scriptraccoon/pool-game
pool game written in Vanilla JavaScript
https://github.com/scriptraccoon/pool-game
Last synced: 9 days ago
JSON representation
pool game written in Vanilla JavaScript
- Host: GitHub
- URL: https://github.com/scriptraccoon/pool-game
- Owner: ScriptRaccoon
- License: mit
- Created: 2022-04-17T12:08:20.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T00:04:51.000Z (over 2 years ago)
- Last Synced: 2024-05-30T16:49:58.380Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://pool-game.netlify.app
- Size: 316 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pool game
This is a pool game written in Vanilla JavaScript. All drawing operations are done on an HTML canvas. No images are used.
https://pool-game.netlify.app

Use the mouse to determine the orientation and energy of the next shot.
The collision between the balls uses 2-dimensional elastic collision. Of course the balls also bounce off the borders, but also the polygon-shaped bumpers.
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). There are sound effects as well.
Ideas for further improvement:
- mobile version
- two-player mode
- striped balls
- numbers on balls
- rotation of balls
## Local development
1. Install the dependencies
```bash
npm install
```
2. Build the JS and CSS files
```bash
npm run dev
```
during development or
```bash
npm run build
```
for the production build.
3. Open `dist/index.html`