It’s no waste of time. It’s something I’m interested in and it was fun to try it.
The gravity is handled by the “add 400*mdt” action. You can change the 400 to adjust the strength of it.
I didn’t include mass, which would allow you to make things heavier. But that would only change things if you applied a force, impulse or deal with collisions or a joint between objects. As is, the joint with the layout and gravity would be the same regardless of how heavy the objects are.
Anyways, if you wanted to apply an impulse and take mass into consideration you’d do:
Add impulseX/mass to vx
Add impulseY/mass to vy
It’s best to not touch pTime. That would just advance the simulation forward in time more. It wouldn’t conserve energy.