Skip to content

Commit

Permalink
Tilemap.swap now accurately swaps from A to B and from B to A (thanks @…
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jul 17, 2014
1 parent 91eb2ff commit 49bb45c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ Version 2.0.7 - "Amadicia" - -in development-
* World.wrap when using the bounds of the object wouldn't adjust the bounds correctly, meaning wrapping outside the camera failed (thanks @jackrugile #1020)
* Pixi updated worldTransform from an Array to an Object and Phaser Image, BitmapText, Text and Graphics were still using array access to populate the world property, giving it incorrect results (thanks @alvinsight)
* If you add a Tween to the TweenManager and then immediately stop it, it will still exist in the TweenManager (thanks @gilangcp #1032)
* AnimationManager does not update currentFrame on play until second frame (thanks @Dumtard #1041)
* Animation now guards against _frameData being null (thanks @lucbloom #1033)
* Tilemap.swap now accurately swaps from A to B and from B to A (thanks @noidexe #1034)



Expand Down Expand Up @@ -116,7 +119,7 @@ You can [clone the Phaser repo in Koding](https://koding.com/Teamwork?import=htt

## Bower

If you use bowser you can install phaser with:
If you use bower you can install phaser with:

`bower install phaser`

Expand Down
8 changes: 5 additions & 3 deletions src/tilemap/Tilemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1509,11 +1509,13 @@ Phaser.Tilemap.prototype = {

if (value.index === this._tempA)
{
this._results[index].index = this._tempB;
// Swap A with B
value.index = this._tempB;
}
if (value.index === this._tempB)
else if (value.index === this._tempB)
{
this._results[index].index = this._tempA;
// Swap B with A
value.index = this._tempA;
}

},
Expand Down

0 comments on commit 49bb45c

Please sign in to comment.