Ball physics simulation

Snap! physics (berkeley.edu)

embed

It becomes slow after only 4 balls. Which isn't the most desirable result. I also tried using lists instead of clones for the bodies, but it didn't yield a performance improvement.

I was planning to add more complex shapes such as a square, which is why I have the "contact points" block, the block that applies torque, and the "shape" variable that has the shape type as the first list item.

I've seen an extreme slowdown with local methods
test project

For me, performance is much better with experimental flag "Live coding support" (Shift :gear:)

I switched to using global blocks but I don't see a significant performance increase.

Weird how that speeds things up. What does that option do anyway? Does it make it so that block definitions will change on the fly instead of the user having to press "Apply"?

No, script tree is just used without making deep copy of it before running new process/thread.
Lack of "undo", for me seems as side-effect. But changes to the script are "lively" executed.

I love it! Amazing.