m.physics.makePoly is not a function

Hi everyone! I haven't made a game with ZimJS in a while, and now I've run into a problem.

I'm connecting everything according to this example: ZIM 017 - Outline - Code Creativity

And then I don't see the images I add in Adobe Animate. I don't understand why.
They're just missing, just empty.

I connect it like this: script type="module">
import ZIM from "./ZIM_physics.js";
/script>

But if I connect the SDK differently:
ZIM Slingshot 1 according to this example.

script src="https://zimjs.org/cdn/1.3.2/createjs.js">
script src="https://zimjs.org/cdn/cat/01/zim.js">

script src="https://zimjs.org/cdn/Box2dWeb-2.1.a.3.min.js">
script src="https://zimjs.org/cdn/physics_2.1.js">

Then my images appear, but the function for adding physics to non-standard bodies doesn't work. I get the error "Uncaught TypeError: m.physics.makePoly is not a function"

if I try to add physics to a trapezoid, for example, or an image.

How can I solve this? What am I doing wrong?
That is, I add a picture by simply transferring it to the scene in Adobe Animate, and in the first case it will not be there, and in the second case it will be there, but there will be no physics of bodies other than a triangle, square, or circle.

And one more question.

ballh = new Circle(50,blue)
.center() .addPhysics({dynamic:true, contract:-5})

So I set the contract to -5, but why can't I change it to a different number later? How do I do that? I wanted to do ballh.contract = 30; but that doesn't change anything.
And the body is in flight or just before flight at this time, so I can't recreate it.

Just racing off to teach... but did you use the latest ZIM SHIM zip and the physics version that is in there?

1 Like

Just at school now with some time. The physics makePoly issue is that you would need https://zimjs.org/cdn/physics_2.3.js rather than 2.1. But you should have a look at the physics example in the ZIM SHIM at https://zimjs.com/animate

1 Like

Thanks for the help! Nothing worked for me, I was completely confused, I tried everything.

Then I downloaded https://zimjs.com/animate/zimshim.zip
I downloaded 4 JS files from the HTML links, and then everything worked, but the entire animation was very slow.
I tried changing the FPS in Adobe Animate itself, and it worked. These settings didn't work before.

Thanks so much for the help, now I can get back to programming.
I think the Adobe Animate + ZIM combo is the best thing in the world.

1 Like