Skip to content

Commit 83b1336

Browse files
committed
Fixing objects again
1 parent bdce5ca commit 83b1336

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/game-engine/world/map/region.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,18 @@ export const getRotatedObjectX = (orientation: number, localX: number, localY: n
3737
return localX;
3838
}
3939
if(orientation === 1) {
40-
return 7 + -localY;
40+
if(localX === 7) {
41+
return localY;
42+
} else {
43+
return 7 - localY;
44+
}
4145
}
4246
if(orientation === 2) {
43-
return -localX + 7;
47+
if(localY === 0) {
48+
return localX;
49+
} else {
50+
return 7 - localX;
51+
}
4452
}
4553
return localY;
4654
};
@@ -53,7 +61,7 @@ export const getRotatedObjectY = (orientation: number, localX: number, localY: n
5361
return localX;
5462
}
5563
if(orientation === 2) {
56-
return -localY + 7;
64+
return 7 - localY;
5765
}
58-
return 7 + -localX;
66+
return 7 - localX;
5967
};

0 commit comments

Comments
 (0)