Skip to content

Commit 33a9d9e

Browse files
committed
0.3.1
1 parent 87c93d6 commit 33a9d9e

12 files changed

+60
-27
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Arcade Slopes Change Log
22

3-
## Unreleased - 28th Feb 2018
3+
## v0.3.1 - 1st March 2018
44
- Implemented Facade.resetCollision() helper method. This can be used to reset
55
all Arcade Physics body collision flags to their default values.
66
- Fixed typescript definition for `game.slopes`.

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Check out the **[demo](http://hexus.github.io/phaser-arcade-slopes)**!
2323
| Phaser Version | Arcade Slopes Version |
2424
| ---------------- | ------------------------------------------------------------------- |
2525
| v2.4.1 - v2.4.8 | [v0.1.0](https://github.com/hexus/phaser-arcade-slopes/tree/v0.1.0) |
26-
| v2.5.0 - v2.10.1 | [v0.1.1](https://github.com/hexus/phaser-arcade-slopes/tree/v0.1.1) - [v0.3.0](https://github.com/hexus/phaser-arcade-slopes/tree/v0.3.0) |
26+
| v2.5.0 - v2.10.1 | [v0.1.1](https://github.com/hexus/phaser-arcade-slopes/tree/v0.1.1) - [v0.3.1](https://github.com/hexus/phaser-arcade-slopes/tree/v0.3.1) |
2727

2828
## Installation
2929

3030
Grab a copy of the
31-
[latest release](https://raw.githubusercontent.com/hexus/phaser-arcade-slopes/v0.3.0/dist/phaser-arcade-slopes.min.js)
31+
[latest release](https://raw.githubusercontent.com/hexus/phaser-arcade-slopes/v0.3.1/dist/phaser-arcade-slopes.min.js)
3232
from the [**dist**](dist) directory in this repository and include it after
3333
Phaser.
3434

dist/phaser-arcade-slopes.js

+40-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

@@ -54,7 +54,7 @@ Phaser.Plugin.ArcadeSlopes.prototype.constructor = Phaser.Plugin.ArcadeSlopes;
5454
* @constant
5555
* @type {string}
5656
*/
57-
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.0';
57+
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.1';
5858

5959
/**
6060
* The Separating Axis Theorem collision solver type.
@@ -130,7 +130,7 @@ Phaser.Plugin.ArcadeSlopes.prototype.destroy = function () {
130130

131131
/**
132132
* @author Chris Andrew <[email protected]>
133-
* @copyright 2016-2017 Chris Andrew
133+
* @copyright 2016-2018 Chris Andrew
134134
* @license MIT
135135
*/
136136

@@ -295,6 +295,39 @@ Phaser.Plugin.ArcadeSlopes.Facade.prototype.collide = function (i, body, tile, t
295295
return this.solvers.sat.collide(i, body, tile, tilemapLayer, overlapOnly);
296296
};
297297

298+
/**
299+
* Reset all the collision properties on a physics body.
300+
*
301+
* Resets body.touching, body.blocked, body.overlap*, body.slopes.sat.response.
302+
*
303+
* Leaves wasTouching alone.
304+
*
305+
* @method Phaser.Plugin.ArcadeSlopes.Facade#resetBodyFlags
306+
* @param {Phaser.Physics.Arcade.Body} body - The physics body.
307+
*/
308+
Phaser.Plugin.ArcadeSlopes.Facade.prototype.resetCollision = function (body) {
309+
body.touching.none = true;
310+
body.touching.up = false;
311+
body.touching.down = false;
312+
body.touching.left = false;
313+
body.touching.right = false;
314+
315+
body.blocked.none = true;
316+
body.blocked.up = false;
317+
body.blocked.down = false;
318+
body.blocked.left = false;
319+
body.blocked.right = false;
320+
321+
body.overlapX = 0;
322+
body.overlapY = 0;
323+
324+
if (!body.slopes) {
325+
return;
326+
}
327+
328+
body.slopes.sat.response = null;
329+
};
330+
298331
/**
299332
* Whether to prefer Y axis separation in an attempt to prevent physics bodies
300333
* from sliding down slopes when they are separated.
@@ -333,7 +366,7 @@ Object.defineProperty(Phaser.Plugin.ArcadeSlopes.Facade.prototype, 'heuristics',
333366

334367
/**
335368
* @author Chris Andrew <[email protected]>
336-
* @copyright 2016-2017 Chris Andrew
369+
* @copyright 2016-2018 Chris Andrew
337370
* @license MIT
338371
*/
339372

@@ -788,7 +821,7 @@ Phaser.Plugin.ArcadeSlopes.Overrides.renderDebug = function () {
788821

789822
/**
790823
* @author Chris Andrew <[email protected]>
791-
* @copyright 2016-2017 Chris Andrew
824+
* @copyright 2016-2018 Chris Andrew
792825
* @license MIT
793826
*/
794827

@@ -1589,7 +1622,7 @@ Phaser.Plugin.ArcadeSlopes.SatSolver.prototype.debug = function (position, respo
15891622

15901623
/**
15911624
* @author Chris Andrew <[email protected]>
1592-
* @copyright 2016-2017 Chris Andrew
1625+
* @copyright 2016-2018 Chris Andrew
15931626
* @license MIT
15941627
*/
15951628

@@ -2110,7 +2143,7 @@ Phaser.Plugin.ArcadeSlopes.TileSlope.QUARTER_TOP_RIGHT_HIGH = 20;
21102143

21112144
/**
21122145
* @author Chris Andrew <[email protected]>
2113-
* @copyright 2016-2017 Chris Andrew
2146+
* @copyright 2016-2018 Chris Andrew
21142147
* @license MIT
21152148
*/
21162149

dist/phaser-arcade-slopes.min.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ var comment = ['/**',
1111
' *',
1212
' * <%= package.description %>',
1313
' *',
14-
' * @copyright 2016-2017 <%= package.author %>',
15-
' * @license <%= package.license %>',
16-
' * @see <%= package.homepage %>',
14+
' * @copyright 2016-2018 <%= package.author %>',
15+
' * @license <%= package.license %>',
16+
' * @see <%= package.homepage %>',
1717
' */',
1818
''
1919
].join('\n');

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser-arcade-slopes",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "A Phaser plugin that brings sloped tile collision handling to Phaser's Arcade Physics engine",
55
"main": "dist/phaser-arcade-slopes.js",
66
"scripts": {},

src/ArcadeSlopes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

@@ -54,7 +54,7 @@ Phaser.Plugin.ArcadeSlopes.prototype.constructor = Phaser.Plugin.ArcadeSlopes;
5454
* @constant
5555
* @type {string}
5656
*/
57-
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.0';
57+
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.1';
5858

5959
/**
6060
* The Separating Axis Theorem collision solver type.

src/ArcadeSlopes/Facade.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

src/ArcadeSlopes/Overrides.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

src/ArcadeSlopes/SatSolver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

src/ArcadeSlopes/TileSlope.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

src/ArcadeSlopes/TileSlopeFactory.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @author Chris Andrew <[email protected]>
3-
* @copyright 2016-2017 Chris Andrew
3+
* @copyright 2016-2018 Chris Andrew
44
* @license MIT
55
*/
66

0 commit comments

Comments
 (0)