From a345cf93b8c23ae6646790f736ff6ea51a13dcc1 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 8 Dec 2021 16:25:18 -0800 Subject: [PATCH] Fix elephant placement across rooms Okay, so, this is the elephant sprite, right? https://i.imgur.com/dtS70zk.png This is how it looks in the actual game, when you stitch all the rooms together: https://i.imgur.com/aztVnFT.png Looks kind of messed-up, doesn't it? Okay, so, in the bottom two rooms (11,9) and (12,9), the elephant is placed at y-position -152. But in (11,8) and (12,8), it's placed at y-position 96. This is despite the fact that -152 plus 240 is 88, not 96. Similarly, in the left two rooms (11,8) and (11,9), the elephant is placed at x-position 64, but in the right two rooms (12,8) and (12,9), the elephant is placed at -264. This is despite the fact that 64 minus 320 is -256, not -264. All of this stems from the calculations in Otherlevel.cpp using offsets of -248 and -328 instead of -240 and -320. So there's an 8-pixel offset that causes the elephant to be chopped off when viewed with all the rooms stitched together. Simple enough to fix. For the y-position fixes, I decremented the initial 8-pixel multiplier as well, else the elephant would sink into the floor. And this is what the elephant looks like now after stitching: https://i.imgur.com/27ePLm1.png Thanks to Tzann for pointing this out. --- desktop_version/src/Otherlevel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Otherlevel.cpp b/desktop_version/src/Otherlevel.cpp index 7ec4c687..91ec472c 100644 --- a/desktop_version/src/Otherlevel.cpp +++ b/desktop_version/src/Otherlevel.cpp @@ -6105,7 +6105,7 @@ const short* otherlevelclass::loadlevel(int rx, int ry) }; - obj.createentity((8 * 8), (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.createentity((8 * 8), (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy obj.nearelephant = true; roomtileset = 0; // (Use space station tileset) @@ -6150,7 +6150,7 @@ const short* otherlevelclass::loadlevel(int rx, int ry) }; - obj.createentity(8 * 8, -248 + (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.createentity(8 * 8, -240 + (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy obj.nearelephant = true; roomtileset = 0; // (Use space station tileset) @@ -6509,7 +6509,7 @@ const short* otherlevelclass::loadlevel(int rx, int ry) }; - obj.createentity(-328 + (8 * 8), (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.createentity(-320 + (8 * 8), (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy obj.nearelephant = true; obj.createentity(240, 72, 10, 1, 8120); // (savepoint) @@ -6555,7 +6555,7 @@ const short* otherlevelclass::loadlevel(int rx, int ry) }; - obj.createentity(-328 + (8 * 8), -248 + (12 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy + obj.createentity(-320 + (8 * 8), -240 + (11 * 8), 1, 0, 0, -10000, -10000, 10000, 100000); // Enemy obj.nearelephant = true; roomtileset = 0; // (Use space station tileset)