mirror of
https://github.com/photonstorm/phaser
synced 2025-01-09 19:58:52 +00:00
fixed worldtotilex on odd tiles
This commit is contained in:
parent
66e99bccc6
commit
406e6eb093
5 changed files with 8 additions and 8 deletions
4
dist/phaser-arcade-physics.js
vendored
4
dist/phaser-arcade-physics.js
vendored
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
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
4
dist/phaser.js
vendored
4
dist/phaser.js
vendored
|
@ -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
2
dist/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue