mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 03:23:42 +00:00
fixed problems with removeTileAt
This commit is contained in:
parent
aaf512b9cd
commit
5747f7102d
5 changed files with 5 additions and 15 deletions
7
dist/phaser-arcade-physics.js
vendored
7
dist/phaser-arcade-physics.js
vendored
|
@ -26609,16 +26609,13 @@ var GetTileAt = function (tileX, tileY, nonNull, layer)
|
|||
|
||||
if (IsInLayerBounds(tileX, tileY, layer))
|
||||
{
|
||||
console.log("tile in bounds", tileX, tileY)
|
||||
var tile = layer.data[tileY][tileX] || null;
|
||||
if (tile === null)
|
||||
{
|
||||
console.log("null tile", tileX, tileY)
|
||||
return null;
|
||||
}
|
||||
else if (tile.index === -1)
|
||||
{
|
||||
console.log("null tile", tileX, tileY)
|
||||
return nonNull ? tile : null;
|
||||
}
|
||||
else
|
||||
|
@ -47879,8 +47876,6 @@ var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height,
|
|||
width: width,
|
||||
height: height
|
||||
});
|
||||
} else {
|
||||
console.log(mapData.orientation)
|
||||
}
|
||||
|
||||
return new Tilemap(scene, mapData);
|
||||
|
@ -102769,7 +102764,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la
|
|||
}
|
||||
else
|
||||
{
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height);
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight);
|
||||
}
|
||||
|
||||
// Recalculate faces only if the removed tile was a colliding tile
|
||||
|
|
2
dist/phaser-arcade-physics.min.js
vendored
2
dist/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
7
dist/phaser.js
vendored
7
dist/phaser.js
vendored
|
@ -29718,16 +29718,13 @@ var GetTileAt = function (tileX, tileY, nonNull, layer)
|
|||
|
||||
if (IsInLayerBounds(tileX, tileY, layer))
|
||||
{
|
||||
console.log("tile in bounds", tileX, tileY)
|
||||
var tile = layer.data[tileY][tileX] || null;
|
||||
if (tile === null)
|
||||
{
|
||||
console.log("null tile", tileX, tileY)
|
||||
return null;
|
||||
}
|
||||
else if (tile.index === -1)
|
||||
{
|
||||
console.log("null tile", tileX, tileY)
|
||||
return nonNull ? tile : null;
|
||||
}
|
||||
else
|
||||
|
@ -52169,8 +52166,6 @@ var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height,
|
|||
width: width,
|
||||
height: height
|
||||
});
|
||||
} else {
|
||||
console.log(mapData.orientation)
|
||||
}
|
||||
|
||||
return new Tilemap(scene, mapData);
|
||||
|
@ -107580,7 +107575,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la
|
|||
}
|
||||
else
|
||||
{
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height);
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight);
|
||||
}
|
||||
|
||||
// Recalculate faces only if the removed tile was a colliding tile
|
||||
|
|
2
dist/phaser.min.js
vendored
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -42,7 +42,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la
|
|||
}
|
||||
else
|
||||
{
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height);
|
||||
layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight);
|
||||
}
|
||||
|
||||
// Recalculate faces only if the removed tile was a colliding tile
|
||||
|
|
Loading…
Reference in a new issue