https://github.com/microhod/ball-simulator
https://github.com/microhod/ball-simulator
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/microhod/ball-simulator
- Owner: microhod
- License: mit
- Created: 2020-12-12T18:01:06.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-03-16T09:24:41.000Z (over 2 years ago)
- Last Synced: 2024-03-16T11:05:03.867Z (over 2 years ago)
- Language: JavaScript
- Size: 29.9 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple 'Balls in a Box' Simulator
Simple simulation of some coloured balls in a box using a [canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API).
## Run
1. [Install NodeJS](https://nodejs.org/) following the instructions on their website.
2. Clone this repository
3. Run `npm install` in this repository
4. Run `npm start` and it should be running at `localhost:8080`
> Note: you can also debug in vscode. Use the `live server` extension to run the server and then you can debug in vscode using chrome (check they're pointing to the same localhost port).
## Usage
* Gravity: how strong the pull to the bottom of the box is
* Friction: how much friction the sides of the box have
* Bouce: how bouncy the balls are
* Balls: number of balls
The 'New' button will create a new simulation.
> Note: all apart from 'Balls' will change the current animation, to change number of balls, you also have to click 'new'
