Physics Simulation

Not the most accurate physics system, but it works pretty well.

Cool. Green flag should start from wherever the red square is, rather than jumping back to always the same starting place.

Really cool!

Amazing! And your code looks elegant, too.


Why? What if somehow the player gets stuck?



Then the player grabs the square and puts it somewhere else!

Oh, you can use the arrow keys to move around.

And you can drag the square as well.

I know

Fixed a jumping bug that made it take a tiny jump after a real jump.

The gravitational force is unrealistically high, so high it makes simulating physics in a useful way practically impossible. Can you share what blocks you use to make the gravity?


I think the issue was you were moving one pixel per frame, that's ok in Scratch where there's 30 frames per second, but with Snap!, it's 60 frames a second, and that makes it two times higher than you probably intended

That makes sense, because I decreased the velocity by half to fix it.

I like the simulator. It looks good!

It's better than DevSquare's physics engine...

I like it very much.

Would your code work if the environment was moving - I wonder because I have just watched this video where the environment is rotating which lifts the object up and gravitation makes it fall (roll) down.

I watched the video on my phone when it reminded me of your project, but I can't inspect the code on a phone (that's why I ask you about it instead of inspecting the code myself).

Very nice, better than DevSquare to say the least!

I keep saying this and I should stop...