Skip to content

Commit 3d9da06

Browse files
committed
Camera.shake would not effect dynamic tilemap layers. Fix phaserjs#3669
1 parent 05f55dc commit 3d9da06

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Camera.setFollowOffset is a chainable method to set the Camera.followOffset property.
2020
* Camera.startFollow has 4 new arguments: `lerpX` and `lerpY` which allow you to set the interpolation value used when following the target. The default is 1 (no interpolation) and `offsetX` and `offsetY` which allow you to set the follow offset values.
2121
* Camera.startFollow will now immediately set the camera `scrollX` and `scrollY` values to be that of the target position to avoid a large initial lerps during the first few preUpdates.
22+
* Math.Interpolation.SmoothStep is a new method that will return the smooth step interpolated value based on the given percentage and left and right edges.
23+
* Math.Interpolation.SmootherStep is a new method that will return the smoother step interpolated value based on the given percentage and left and right edges.
2224

2325
### Updates
2426

@@ -47,13 +49,14 @@
4749
* The `dragend` event would be broadcast even if the drag distance or drag time thresholds were not met. Fix #3686 (thanks @RollinSafary)
4850
* Restarting a Tween immediately after creating it, without it having first started, would cause it to get stuck permanently in the Tween Managers add queue (thanks @Antriel @zacharysarette)
4951
* Setting an existing Game Object as a static Arcade Physics body would sometimes incorrectly pick-up the dimensions of the object, such as with TileSprites. Fix #3690 (thanks @fariazz)
50-
* Interactive Objects were not fully removed from the Input Plugin when cleared, causing the internal _list array to grow. Fix #3645 (thanks @tjb295 for the fix and @rexrainbow for the issue)
52+
* Interactive Objects were not fully removed from the Input Plugin when cleared, causing the internal list array to grow. Fix #3645 (thanks @tjb295 for the fix and @rexrainbow for the issue)
53+
* Camera.shake would not effect dynamic tilemap layers. Fix #3669 (thanks @kainage)
5154

5255
### Examples, Documentation and TypeScript
5356

5457
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
5558

56-
@mikez @wtravO @thomastanck
59+
@hexus @mikez @wtravO @thomastanck
5760

5861

5962
## Version 3.8.0 - Klein - 16th May 2018

src/tilemaps/components/CullTiles.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var CullTiles = function (layer, camera, outputArray)
3535
camera.matrix.translate(-originX, -originY);
3636
camera.matrix.invert();
3737

38+
camera.shakeEffect.preRender();
39+
3840
var tilemapLayer = layer.tilemapLayer;
3941
var tileW = layer.tileWidth;
4042
var tileH = layer.tileHeight;
@@ -57,15 +59,16 @@ var CullTiles = function (layer, camera, outputArray)
5759
var tCullW = cullW * a + cullH * c + e;
5860
var tCullH = cullW * b + cullH * d + f;
5961

60-
6162
for (var y = 0; y < mapHeight; ++y)
6263
{
6364
for (var x = 0; x < mapWidth; ++x)
6465
{
6566
var tile = mapData[y][x];
6667

6768
if (tile === null || tile.index === -1)
68-
{ continue; }
69+
{
70+
continue;
71+
}
6972

7073
var tileX = tile.pixelX * a + tile.pixelY * c + e;
7174
var tileY = tile.pixelX * b + tile.pixelY * d + f;
@@ -82,7 +85,6 @@ var CullTiles = function (layer, camera, outputArray)
8285
}
8386
}
8487

85-
8688
/* var tilemapLayer = layer.tilemapLayer;
8789
var mapData = layer.data;
8890
var mapWidth = layer.width;

0 commit comments

Comments
 (0)