mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
Tidy return statements
This commit is contained in:
parent
ef2d4f6d7a
commit
7d39bf9217
2 changed files with 4 additions and 8 deletions
|
@ -37,13 +37,11 @@ var HexagonalWorldToTileY = function (worldY, snapToFloor, camera, layer)
|
|||
tileHeight *= tilemapLayer.scaleY;
|
||||
}
|
||||
|
||||
var sidel = layer.hexSideLength;
|
||||
var len = layer.hexSideLength;
|
||||
|
||||
var rowHeight = ((tileHeight - sidel) / 2 + sidel);
|
||||
var rowHeight = ((tileHeight - len) / 2 + len);
|
||||
|
||||
return snapToFloor
|
||||
? Math.floor(worldY / rowHeight)
|
||||
: worldY / rowHeight;
|
||||
return (snapToFloor) ? Math.floor(worldY / rowHeight) : worldY / rowHeight;
|
||||
};
|
||||
|
||||
module.exports = HexagonalWorldToTileY;
|
||||
|
|
|
@ -37,9 +37,7 @@ var StaggeredWorldToTileY = function (worldY, snapToFloor, camera, layer)
|
|||
tileHeight *= tilemapLayer.scaleY;
|
||||
}
|
||||
|
||||
return snapToFloor
|
||||
? Math.floor(worldY / (tileHeight / 2))
|
||||
: worldY / (tileHeight / 2);
|
||||
return (snapToFloor) ? Math.floor(worldY / (tileHeight / 2)) : worldY / (tileHeight / 2);
|
||||
};
|
||||
|
||||
module.exports = StaggeredWorldToTileY;
|
||||
|
|
Loading…
Add table
Reference in a new issue