Physics Engine

Hello, for the past week or so I have been trying to make a jello-like physics engine and cannot be able to do it. Does anyone know of a simple way to do it? My code is a jumbled mess that only works about half of the time, so (at least for me) it'll be easier to start over with a general idea of what to do.
-By jello-like physics i mean extremely bouncy and can bounce off of each over and (not necessary) a stretching effect. Also them going a bit lopsided and falling over

the stretching effect can be done with this block
stretch reporter

Not really what i was asking but it gives me an idea, so thanks anyways!

yo welcome

I'm not sure if you're asking for help about programming or about physics. Do you understand any classical mechanics? How to compute the result of an inelastic collision? Elastic collisions are sorta the same except you have to imagine a spring between the center of mass of each object and the center of mass of the whole system.