phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Not possible to change Arcade Physics Body radius #609

Closed enriqueto closed 5 years ago

enriqueto commented 5 years ago

using v2.11.1

this works alright: body.isCircle = true;

however this doesn't have any effect:

body.radius = 15; body.offset.set(0, 25);

samme commented 5 years ago

See Phaser.Physics.Arcade.Body#radius

enriqueto commented 5 years ago

thanks, I tried that.

body.setCircle(15, 0, 25);

It effectively changes the radius of the circle, however the offset is unchanged (check it with debug graphics because the offset member has the correct values but the body remains with offset 0 )

samme commented 5 years ago

Setting the offset works as expected here: https://codepen.io/samme/pen/EGmXwz?editors=0010

enriqueto commented 5 years ago

I see, I guess it's my own bug. I'll keep on searching...

Thanks for everything :) and merry Christmas!