worldToTile fixed

This commit is contained in:
Svipal 2020-06-06 00:23:16 +02:00
parent aae73c3cb8
commit e6d468cda7
8 changed files with 21959 additions and 223328 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

23609
dist/phaser.js vendored

File diff suppressed because it is too large Load diff

2
dist/phaser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -24,6 +24,9 @@
"dist": "webpack --config config/webpack.dist.config.js", "dist": "webpack --config config/webpack.dist.config.js",
"distfb": "webpack --config config/webpack.fb.dist.config.js", "distfb": "webpack --config config/webpack.fb.dist.config.js",
"distfull": "npm run dist && npm run distfb", "distfull": "npm run dist && npm run distfb",
"distT": "webpack --config config/webpack.dist.config.js && npm run toT",
"toT": "@powershell Copy-Item ./dist/phaser.min.js ../phasertest/phaser.min.js",
"toT2": "@powershell Copy-Item ./dist/phaser.js ../phasertest/phaser.min.js",
"plugin.cam3d": "webpack --config plugins/camera3d/webpack.config.js", "plugin.cam3d": "webpack --config plugins/camera3d/webpack.config.js",
"plugin.spine": "webpack --config plugins/spine/webpack.config.js", "plugin.spine": "webpack --config plugins/spine/webpack.config.js",
"plugin.spine.dist": "webpack --config plugins/spine/webpack.auto.dist.config.js", "plugin.spine.dist": "webpack --config plugins/spine/webpack.auto.dist.config.js",

View file

@ -80,6 +80,9 @@ var IsoWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, lay
tileWidth *= tilemapLayer.scaleX; tileWidth *= tilemapLayer.scaleX;
} }
worldX -= tileWidth/2;
point.x = snapToFloor point.x = snapToFloor
? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2) ? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2)