Skip to content

Commit 9ad1230

Browse files
committed
On Ceiling Method Added
1 parent b66a0aa commit 9ad1230

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/physics/arcade/Body.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,16 @@ Phaser.Physics.Arcade.Body.prototype = {
661661
onFloor: function () {
662662
return this.blocked.down;
663663
},
664+
665+
/**
666+
* Returns true if the top of this Body is in contact with either the world bounds or a tile.
667+
*
668+
* @method Phaser.Physics.Arcade.Body#onTop
669+
* @return {boolean} True if in contact with either the world bounds or a tile.
670+
*/
671+
onCeiling: function(){
672+
return this.blocked.up;
673+
},
664674

665675
/**
666676
* Returns true if either side of this Body is in contact with either the world bounds or a tile.

0 commit comments

Comments
 (0)