Wahoo Click the mouse to attract the circles (1 unit of force is applied to each circle in the direction of the mouse). In Progress Day 4 (Jul 18, 2024) Circular collision physics are now 100% finished! Wall collision physics are now 90% finished! At the moment, collisions work but are somewhat unstable when they involve multiple objects. For now, I'm just going to leave it and make a simple pool game (with realistic physics!) now I need to fix collisions between objects of different masses. Collisions should also push the current object outside of the other rather than just relying on the force to push them out. This is why it would sometimes break, is that slight errors would mean there was not enough force to push each circle all the way outside of the other, causing them to get stuck inside each other. Hoping to add support for lines, rectangles, and maybe polygons. Hoping to add support for torque/rotation Hoping to add support for static objects Hoping to add support for elastic and inelastic collisions/bounciness.
This article for some collision detection help. That I haven't implemented yet. Line Circle and Line Line should be especially helpful. In addition to being helpful, the site happens to be rather well put together so is worth a read (in my opinion, anyways): https://www.jeffreythompson.org/collision-detection/line-circle.php PHET simulations (they have a collision lab that helped point me in the right direction): https://phet.colorado.edu/sims/html/collision-lab/latest/collision-lab_all.html @Zro716 for atan2: https://scratch.mit.edu/discuss/topic/346374/?page=1#post-7624427 The Organic Chemistry Tutor (on Youtube) for some help with elastic collision solutions, especially the simplified way to solve for conservation of energy (although I don't know how that simplification was achieved yet): https://www.youtube.com/watch?v=CFbo_nBdBco