https://github.com/antosser/springs
Simple 2d physics engine that simulates objects made out of springs
https://github.com/antosser/springs
Last synced: 9 months ago
JSON representation
Simple 2d physics engine that simulates objects made out of springs
- Host: GitHub
- URL: https://github.com/antosser/springs
- Owner: Antosser
- Created: 2021-08-06T09:52:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-19T22:50:51.000Z (about 4 years ago)
- Last Synced: 2025-02-07T18:51:24.560Z (11 months ago)
- Language: JavaScript
- Homepage: https://antosser.github.io/springs/?100&1
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Springs Physics](https://antosser.github.io/springs/?100&1)
Springs is an html web application to simulate physics objects.
Every dot is connected to every other dot with a spring. Every spring wants to get to it's initial length.
## Controls
### Mouse
- **Left Mouse Click** - create dot at mouse position
- **Right Mouse Click** - create static dot at mouse position
### Quick Objects
- **Q** - create **sqare**
- **W** - create a **10-sided regular polygon**
- **E** - create a **25-sided regular polygon**
- **R** - create a **50-sided regular polygon**
- **T** - create a **100-sided regular polygon**
- **Y** - create a **250-sided regular polygon**
**Warning!** Do **NOT** spawn in two objects at the same place. This will cause a division by zero = **crash**
### Options
- **D** - Toggle showing the **dots**. **On** by default
- **F** - Toggle **filling** the object. **Off** by default
- **G** - Toggle **following** the object. **Off** by default
- **L** - Toggle drawing the **springs**. **On** by default. Note: Recomended toggeling off for huge objects as it slows down everything heavily
### Arrows
- **Arrow Up** - Create a **force up** for each object
- **Arrow Down** - Create a **force down** for each object
- **Arrow Left** - Create a **force left** for each object
- **Arrow Right** - Create a **force right** for each object
### GUI
You can change the spring strength or timescale using the scalers on the page or using the url and reloading

### Start the simulation
You can press **Space** to start the simulation