Removed redundant code
This commit is contained in:
parent
f8d3cd1f48
commit
4711dd3258
@ -45,12 +45,12 @@ export const calculateIsometricDepth = (x: number, y: number, width: number = 0,
|
|||||||
const baseDepth = x + y
|
const baseDepth = x + y
|
||||||
if (isCharacter) {
|
if (isCharacter) {
|
||||||
// Increase the offset for characters to ensure they're always on top
|
// Increase the offset for characters to ensure they're always on top
|
||||||
return baseDepth + 0.9 // @TODO: Fix collision, this is a hack
|
return baseDepth // @TODO: Fix collision, this is a hack
|
||||||
} else {
|
}
|
||||||
|
|
||||||
// For objects, use their back bottom corner
|
// For objects, use their back bottom corner
|
||||||
return baseDepth + (width + height) / (2 * config.tile_size.x)
|
return baseDepth + (width + height) / (2 * config.tile_size.x)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export const sortByIsometricDepth = <T extends { positionX: number; positionY: number }>(items: T[]) => {
|
export const sortByIsometricDepth = <T extends { positionX: number; positionY: number }>(items: T[]) => {
|
||||||
return [...items].sort((a, b) => {
|
return [...items].sort((a, b) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user