@@ -16,25 +16,24 @@ var Vector2 = require('../../math/Vector2');
1616 *
1717 * @param {number } worldX - The x coordinate to be converted, in pixels, not tiles.
1818 * @param {number } worldY - The y coordinate to be converted, in pixels, not tiles.
19- * @param {boolean } [ snapToFloor=true] - Whether or not to round the tile coordinates down to the nearest integer.
20- * @param {Phaser.Math.Vector2 } [ point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created.
21- * @param {Phaser.Cameras.Scene2D.Camera } [ camera=main camera] - The Camera to use when calculating the tile index from the world values.
19+ * @param {boolean } snapToFloor - Whether or not to round the tile coordinates down to the nearest integer.
20+ * @param {Phaser.Math.Vector2 } point - A Vector2 to store the coordinates in. If not given a new Vector2 is created.
21+ * @param {Phaser.Cameras.Scene2D.Camera } camera - The Camera to use when calculating the tile index from the world values.
2222 * @param {Phaser.Tilemaps.LayerData } layer - The Tilemap Layer to act upon.
2323 *
2424 * @return {Phaser.Math.Vector2 } The XY location in tile units.
2525 */
2626var HexagonalWorldToTileXY = function ( worldX , worldY , snapToFloor , point , camera , layer )
2727{
28- if ( snapToFloor === undefined ) { snapToFloor = true ; }
29- if ( point === undefined ) { point = new Vector2 ( ) ; }
28+ if ( ! point ) { point = new Vector2 ( ) ; }
3029
3130 var tileWidth = layer . baseTileWidth ;
3231 var tileHeight = layer . baseTileHeight ;
3332 var tilemapLayer = layer . tilemapLayer ;
3433
3534 if ( tilemapLayer )
3635 {
37- if ( camera === undefined ) { camera = tilemapLayer . scene . cameras . main ; }
36+ if ( ! camera ) { camera = tilemapLayer . scene . cameras . main ; }
3837
3938 // Find the world position relative to the static or dynamic layer's top left origin,
4039 // factoring in the camera's vertical scroll
0 commit comments