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.35k stars 491 forks source link

Circular bodies of scaled sprites are probably incorrect #235

Closed samme closed 7 years ago

samme commented 7 years ago

I agree with @ColaColin (photonstorm/phaser#2752) that the radius is handled inconsistently. In particular, body.center is placed by scaling body.radius (which looks correct) but collision checks and debug.body use an unscaled body.radius.

I think that body.radius and body.offset are supposed to refer to the (unscaled) texture size and the collision methods should use only the scaled radius (body.halfWidth).

samme commented 7 years ago

Screenshot

http://codepen.io/samme/pen/zZaYVR