fixed worldtotilex on odd tiles

This commit is contained in:
Svipal 2020-03-14 10:57:19 +01:00
parent 66e99bccc6
commit 406e6eb093
5 changed files with 8 additions and 8 deletions

View file

@ -11971,8 +11971,8 @@ var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer)
? Math.floor((worldY / (tileHeight / 2)))
: (worldY / (tileHeight / 2));
point.x = snapToFloor
? Math.floor((worldX / tileWidth) - (point.y % 2))
: (worldX / tileWidth) - (point.y % 2);
? Math.floor((worldX - (point.y % 2) * 0.5 * tileWidth) / tileWidth)
: (worldX - (worldY % 2) * 0.5 * tileWidth) / tileWidth;
}
}

File diff suppressed because one or more lines are too long

4
dist/phaser.js vendored
View file

@ -13895,8 +13895,8 @@ var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer)
? Math.floor((worldY / (tileHeight / 2)))
: (worldY / (tileHeight / 2));
point.x = snapToFloor
? Math.floor((worldX / tileWidth) - (point.y % 2))
: (worldX / tileWidth) - (point.y % 2);
? Math.floor((worldX - (point.y % 2) * 0.5 * tileWidth) / tileWidth)
: (worldX - (worldY % 2) * 0.5 * tileWidth) / tileWidth;
}
}

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -88,8 +88,8 @@ var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer)
? Math.floor((worldY / (tileHeight / 2)))
: (worldY / (tileHeight / 2));
point.x = snapToFloor
? Math.floor((worldX / tileWidth) + (point.y % 2))
: (worldX / tileWidth) + (point.y % 2);
? Math.floor((worldX + (point.y % 2) * 0.5 * tileWidth) / tileWidth)
: (worldX + (worldY % 2) * 0.5 * tileWidth) / tileWidth;
}
}