Issue #1885: P2.enableBody now checks if an anchor exists on target object before attempting to set its value

This commit is contained in:
Standard Gaussian 2015-07-05 22:39:15 +01:00
parent 8919e4e128
commit a556dfdc69

View file

@ -337,7 +337,9 @@ Phaser.Physics.P2.prototype = {
{
object.body = new Phaser.Physics.P2.Body(this.game, object, object.x, object.y, 1);
object.body.debug = debug;
object.anchor.set(0.5);
if (typeof object.anchor !== 'undefined') {
object.anchor.set(0.5);
}
}
},