Skip to content

Commit 9238622

Browse files
committed
Tile.setCollision now adjusts the tiles interesting faces list as well, this allows you to create one-way jump tiles without using custom callbacks on a specific tile basis (thanks @RafaelOliveira phaserjs#886)
1 parent 5546e59 commit 9238622

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Version 2.1.0 - "Cairhien" - -in development-
122122
* GamePad and SinglePad onAxisCallback parameters have changed. You are now sent: this (a reference to the SinglePad that caused the callback), the axis index and the axis value in that order.
123123
* If Time.elapsed was > Time.timeCap it would reset the elapsed value to be 1 / 60. It's now set to Time.timeCap and Time.timeCap defaults to `1 / 60 * 1000` as it's a ms value (thanks @casensiom #899)
124124
* Tiled polylines are now imported into the map objects property as well as map collision (#1117)
125+
* Tile.setCollision now adjusts the tiles interesting faces list as well, this allows you to create one-way jump tiles without using custom callbacks on a specific tile basis (thanks @RafaelOliveira #886)
125126

126127
### Bug Fixes
127128

src/tilemap/Tile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Phaser.Tile.prototype = {
222222
},
223223

224224
/**
225-
* Set collision settings on this tile.
225+
* Sets the collision flags for each side of this tile and updates the interesting faces list.
226226
*
227227
* @method Phaser.Tile#setCollision
228228
* @param {boolean} left - Indicating collide with any object on the left.
@@ -237,6 +237,11 @@ Phaser.Tile.prototype = {
237237
this.collideUp = up;
238238
this.collideDown = down;
239239

240+
this.faceLeft = left;
241+
this.faceRight = right;
242+
this.faceTop = up;
243+
this.faceBottom = down;
244+
240245
},
241246

242247
/**

0 commit comments

Comments
 (0)