From f7c4847934b81941d005cd7cce84ffdf5a363f49 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 2 Jan 2020 22:05:49 -0800 Subject: [PATCH] Fix Actor Collision Checks Again * Recent collision update caused a regression where the player would get "stuck" while standing on top of a solid doodad, unable to walk left or right. * When deciding if the actor is on top of a doodad, use the doodad's Hitbox (if available) instead of the bounding box. This fixes the upside-down trapdoor acting solid when landed on from the top, since its Hitbox Y coordinate is not the same as the top of its sprite. * Cheats: when using the noclip cheat in Play Mode, you can hold down the Shift key while moving to only move one pixel at a time. --- dev-assets/doodads/crumbly-floor/crumbly-floor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev-assets/doodads/crumbly-floor/crumbly-floor.js b/dev-assets/doodads/crumbly-floor/crumbly-floor.js index 155be86..509101b 100644 --- a/dev-assets/doodads/crumbly-floor/crumbly-floor.js +++ b/dev-assets/doodads/crumbly-floor/crumbly-floor.js @@ -19,10 +19,6 @@ function main() { var startedAnimation = false; Events.OnCollide(function(e) { - // Only trigger for mobile characters. - if (!e.Actor.IsMobile()) { - return; - } // If the floor is falling, the player passes right thru. if (state === stateFalling || state === stateFallen) { @@ -36,6 +32,11 @@ function main() { return false; } + // If movement is not settled, be solid. + if (!e.Settled) { + return false; + } + // Begin the animation sequence if we're in the solid state. if (state === stateSolid) { state = stateShaking;