Balls Inside an Octagon in Physics

ZAPP: ball in shape | ZIM JavaScript Canvas Framework

I created the following shape, and at first, it spins and behaves perfectly.
As time passes, the shape holding the balls starts to accelerate rapidly, gaining more and more speed (probably due to collisions with the balls).
Eventually, this causes both the balls and the shape to become unstable until the balls fly out.

A. How can I maintain a constant speed for the shape throughout the entire time while keeping control over it?
B. Is there a way to prevent the balls from escaping?

Thanks!

There is a bullet setting in Box2D. Perhaps look into that and let us know how it might be applied. I can't remember if it is on the world or on a force or on an object, etc.

1 Like

ball.body.SetBullet(true);
fix that!!! :slight_smile:

thank!!

1 Like

So that worked. We should probably add that to the docs then as a help.

1 Like

the final result :slight_smile:

:dart: Introducing Drawing Machine!
A virtual lottery drum just like on TV! Drop in your names/items and watch them spin until the lucky winner emerges :game_die:

https://pash.closeapp.co.il/games/assets/imageShow/balloons/drawingMachine.html

2 Likes