Play on turbowarp for way better performance: https://turbowarp.org/864356486/ (don't forget to leave your like and fave before going though :D) Use the left slider to set the size, then click to place a ball at the mouse position. The balls are colored by speed, and they all have the same mass (bigger balls will not fall through smaller ones). Air resistance simulates friction by slowing down the speed, and substeps makes the collisions more accurate (and laggy) by repeating them multiple times per frame. Also, if you place too much balls inside the container, collisions will start to glitch and it will look like the inside of a nuclear reactor lol
I always wanted to make one of these, but i thought physics engines were some kind of overcomplicated formula i would never be able to understand. Well it turns out they are incredibly simple to make! The formulas are super intuitive ("verlet" is just a funny word for "just add the velocity and the acceleration you dummy") and collisions, while being the hardest part, are just lerps lol. If i feel like a nerd right now it's all thanks to this video: https://www.youtube.com/watch?v=lS_qeBy3aQI be sure to watch it, it's super useful, i basically copied it lol (and credit to dinosus for sending it to me i guess). Seriously, if you're bored, go make one of these, they are super fun to play with! Song: Engelwood - Crystal dolphin (probably doesn't fit the project but idc, it's a cool song and was laying in my backpack for some reason lol) #verlet #math #games #simulation #all #simulations #physics #waitdotagsstillwork #imbored #fun #ball #balls #sus #nerd #lerp #turbowarp #whatever (oh and last thing pls don't make this project sus just because there's balls in the title)