forked from noxious/client
Map object depth calculation adjustment
This commit is contained in:
@ -68,11 +68,11 @@ export function createTileArray(width: number, height: number, tile: string = 'b
|
||||
}
|
||||
|
||||
export const calculateIsometricDepth = (positionX: number, positionY: number, width: number = 0, height: number = 0, isCharacter: boolean = false) => {
|
||||
const baseDepth = positionX + positionY
|
||||
const baseDepth = Math.max(positionX, positionY)
|
||||
if (isCharacter) {
|
||||
return baseDepth // @TODO: Fix collision, this is a hack
|
||||
}
|
||||
return baseDepth + (width + height) / (2 * config.tile_size.width)
|
||||
return (baseDepth + height) / (config.tile_size.width * 2)
|
||||
}
|
||||
|
||||
async function getTiles(tiles: TileT[], scene: Phaser.Scene) {
|
||||
|
Reference in New Issue
Block a user