Skip to content

Commit

Permalink
0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hexus committed Mar 1, 2018
1 parent 87c93d6 commit 33a9d9e
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 27 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Arcade Slopes Change Log

## Unreleased - 28th Feb 2018
## v0.3.1 - 1st March 2018
- Implemented Facade.resetCollision() helper method. This can be used to reset
all Arcade Physics body collision flags to their default values.
- Fixed typescript definition for `game.slopes`.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Check out the **[demo](http://hexus.github.io/phaser-arcade-slopes)**!
| Phaser Version | Arcade Slopes Version |
| ---------------- | ------------------------------------------------------------------- |
| v2.4.1 - v2.4.8 | [v0.1.0](https://github.com/hexus/phaser-arcade-slopes/tree/v0.1.0) |
| 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) |
| 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) |

## Installation

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

Expand Down
47 changes: 40 additions & 7 deletions dist/phaser-arcade-slopes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down Expand Up @@ -54,7 +54,7 @@ Phaser.Plugin.ArcadeSlopes.prototype.constructor = Phaser.Plugin.ArcadeSlopes;
* @constant
* @type {string}
*/
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.0';
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.1';

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

/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

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

/**
* Reset all the collision properties on a physics body.
*
* Resets body.touching, body.blocked, body.overlap*, body.slopes.sat.response.
*
* Leaves wasTouching alone.
*
* @method Phaser.Plugin.ArcadeSlopes.Facade#resetBodyFlags
* @param {Phaser.Physics.Arcade.Body} body - The physics body.
*/
Phaser.Plugin.ArcadeSlopes.Facade.prototype.resetCollision = function (body) {
body.touching.none = true;
body.touching.up = false;
body.touching.down = false;
body.touching.left = false;
body.touching.right = false;

body.blocked.none = true;
body.blocked.up = false;
body.blocked.down = false;
body.blocked.left = false;
body.blocked.right = false;

body.overlapX = 0;
body.overlapY = 0;

if (!body.slopes) {
return;
}

body.slopes.sat.response = null;
};

/**
* Whether to prefer Y axis separation in an attempt to prevent physics bodies
* from sliding down slopes when they are separated.
Expand Down Expand Up @@ -333,7 +366,7 @@ Object.defineProperty(Phaser.Plugin.ArcadeSlopes.Facade.prototype, 'heuristics',

/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

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

/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

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

/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

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

/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down
12 changes: 6 additions & 6 deletions dist/phaser-arcade-slopes.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ var comment = ['/**',
' *',
' * <%= package.description %>',
' *',
' * @copyright 2016-2017 <%= package.author %>',
' * @license <%= package.license %>',
' * @see <%= package.homepage %>',
' * @copyright 2016-2018 <%= package.author %>',
' * @license <%= package.license %>',
' * @see <%= package.homepage %>',
' */',
''
].join('\n');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phaser-arcade-slopes",
"version": "0.3.0",
"version": "0.3.1",
"description": "A Phaser plugin that brings sloped tile collision handling to Phaser's Arcade Physics engine",
"main": "dist/phaser-arcade-slopes.js",
"scripts": {},
Expand Down
4 changes: 2 additions & 2 deletions src/ArcadeSlopes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down Expand Up @@ -54,7 +54,7 @@ Phaser.Plugin.ArcadeSlopes.prototype.constructor = Phaser.Plugin.ArcadeSlopes;
* @constant
* @type {string}
*/
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.0';
Phaser.Plugin.ArcadeSlopes.VERSION = '0.3.1';

/**
* The Separating Axis Theorem collision solver type.
Expand Down
2 changes: 1 addition & 1 deletion src/ArcadeSlopes/Facade.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down
2 changes: 1 addition & 1 deletion src/ArcadeSlopes/Overrides.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down
2 changes: 1 addition & 1 deletion src/ArcadeSlopes/SatSolver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down
2 changes: 1 addition & 1 deletion src/ArcadeSlopes/TileSlope.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down
2 changes: 1 addition & 1 deletion src/ArcadeSlopes/TileSlopeFactory.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @author Chris Andrew <[email protected]>
* @copyright 2016-2017 Chris Andrew
* @copyright 2016-2018 Chris Andrew
* @license MIT
*/

Expand Down

0 comments on commit 33a9d9e

Please sign in to comment.