Click/tap to create a point. Click and drag from one point to another to link them. Tap a point again to anchor/lock it in place. Press space or click the triangle button ("▶") to run the simulation. Tap the icon with the three horizontal lines ("≡") to view settings that you can change and 5 examples you can load. While the simulation is running, you can drag across the screen to interact with the points. Press the button with the arrow to reset the simulation. Press the "x" key on your keyboard or tap the plus icon/x icon ("+" or "x") to toggle between creating points/lines and deleting them. To delete points/lines, just hover over them and click them. (You can also do this while the simulation is running) If you find any bugs or glitches, please tell me and I will try to fix them. Have fun and comment any feedback/suggestions you have!
I was inspired to make this project after watching this game development video by Sebastian Lague: https://youtu.be/PGk0rnyTa1U?t=294 About: This project uses a technique called Verlet Integration to efficiently and easily simulate the interactions of a set of points and connections. It has two main differences when compared to typical (Euler) physics. First, the constraints aren't all calculated simultaneously. Each point is individually adjusted slightly in each frame so that they move closer and closer to the correct locations the more you run the code. Second, in Verlet Integration, velocity isn't actually stored for each point. Inertia is applied by comparing a point's current location to its location in the last frame and then sliding it by that same amount. Tutorial: https://gamedevelopment.tutsplus.com/tutorials/simulate-tearable-cloth-and-ragdolls-with-simple-verlet-integration--gamedev-519 Music: "Absurd" from fesliyanstudios.com Color palette: https://www.canva.com/colors/color-palettes/northern-lights-3/ Icons: flaticon.com