N/A
This commit is contained in:
@ -62,12 +62,14 @@ export function createTileArray(width: number, height: number, tile: string = 'b
|
||||
return Array.from({ length: height }, () => Array.from({ length: width }, () => tile))
|
||||
}
|
||||
|
||||
export const calculateIsometricDepth = (positionX: number, positionY: number, width: number = 0, height: number = 0, isCharacter: boolean = false) => {
|
||||
const baseDepth = positionX + positionY
|
||||
if (isCharacter) {
|
||||
return baseDepth
|
||||
}
|
||||
return baseDepth + (width + height) / (2 * config.tile_size.width)
|
||||
export const calculateIsometricDepth = (positionX: number, positionY: number, width: number = 0, height: number = 0) => {
|
||||
const backCornerX = positionX + width
|
||||
const backCornerY = positionY + height
|
||||
|
||||
const sortingX = (positionX + backCornerX) / 2
|
||||
const sortingY = (positionY + backCornerY) / 2
|
||||
|
||||
return sortingX + sortingY
|
||||
}
|
||||
|
||||
async function loadTileTextures(tiles: TileT[], scene: Phaser.Scene) {
|
||||
|
Reference in New Issue
Block a user