@@ -188,31 +188,6 @@ Phaser.Physics.Arcade.Body = function (sprite) {
188188 */
189189 this . skipQuadTree = false ;
190190
191- // Allow collision
192-
193- /**
194- * Set the allowCollision properties to control which directions collision is processed for this Body.
195- * For example allowCollision.up = false means it won't collide when the collision happened while moving up.
196- * @property {object } allowCollision - An object containing allowed collision.
197- */
198- // This would be faster as an array
199- this . allowCollision = { none : false , any : true , up : true , down : true , left : true , right : true } ;
200-
201- /**
202- * This object is populated with boolean values when the Body collides with another.
203- * touching.up = true means the collision happened to the top of this Body for example.
204- * @property {object } touching - An object containing touching results.
205- */
206- // This would be faster as an array
207- this . touching = { none : true , up : false , down : false , left : false , right : false } ;
208-
209- /**
210- * This object is populated with previous touching values from the bodies previous collision.
211- * @property {object } wasTouching - An object containing previous touching results.
212- */
213- // This would be faster as an array
214- this . wasTouching = { none : true , up : false , down : false , left : false , right : false } ;
215-
216191 /**
217192 * @property {number } facing - A const reference to the direction the Body is traveling or facing.
218193 * @default
@@ -301,7 +276,32 @@ Phaser.Physics.Arcade.Body = function (sprite) {
301276 */
302277 this . collideWorldBounds = false ;
303278
304- this . blocked = { up : false , down : false , left : false , right : false } ;
279+ /**
280+ * Set the checkCollision properties to control which directions collision is processed for this Body.
281+ * For example checkCollision.up = false means it won't collide when the collision happened while moving up.
282+ * @property {object } checkCollision - An object containing allowed collision.
283+ */
284+ this . checkCollision = { none : false , any : true , up : true , down : true , left : true , right : true } ;
285+
286+ /**
287+ * This object is populated with boolean values when the Body collides with another.
288+ * touching.up = true means the collision happened to the top of this Body for example.
289+ * @property {object } touching - An object containing touching results.
290+ */
291+ this . touching = { none : true , up : false , down : false , left : false , right : false } ;
292+
293+ /**
294+ * This object is populated with previous touching values from the bodies previous collision.
295+ * @property {object } wasTouching - An object containing previous touching results.
296+ */
297+ this . wasTouching = { none : true , up : false , down : false , left : false , right : false } ;
298+
299+ /**
300+ * This object is populated with boolean values when the Body collides with the World bounds or a Tile.
301+ * For example if blocked.up is true then the Body cannot move up.
302+ * @property {object } blocked - An object containing on which faces this Body is blocked from moving, if any.
303+ */
304+ this . blocked = { x : 0 , y : 0 , up : false , down : false , left : false , right : false } ;
305305
306306} ;
307307
@@ -363,8 +363,8 @@ Phaser.Physics.Arcade.Body.prototype = {
363363 this . y = this . preY ;
364364 this . rotation = this . preRotation ;
365365
366- // this.overlapX = 0;
367- // this.overlapY = 0;
366+ this . overlapX = 0 ;
367+ this . overlapY = 0 ;
368368
369369 this . blocked . up = false ;
370370 this . blocked . down = false ;
@@ -391,16 +391,6 @@ Phaser.Physics.Arcade.Body.prototype = {
391391 */
392392 postUpdate : function ( ) {
393393
394- // if (this.overlapX !== 0)
395- // {
396- // this.x -= this.overlapX;
397- // }
398-
399- // if (this.overlapY !== 0)
400- // {
401- // this.y -= this.overlapY;
402- // }
403-
404394 if ( this . deltaX ( ) < 0 && this . blocked . left === false )
405395 {
406396 this . facing = Phaser . LEFT ;
0 commit comments