From 53c72f18d103022834bb79553c3fb224852604c0 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 8 May 2022 12:09:09 -0700 Subject: [PATCH] Bugfix: Crusher to fall indefinitely w/o a time limit --- dev-assets/doodads/crusher/crusher.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dev-assets/doodads/crusher/crusher.js b/dev-assets/doodads/crusher/crusher.js index 63bcfcd..5aba2a2 100644 --- a/dev-assets/doodads/crusher/crusher.js +++ b/dev-assets/doodads/crusher/crusher.js @@ -24,9 +24,10 @@ let direction = "left", const states = { idle: 0, peeking: 1, - falling: 2, - hit: 3, - rising: 4, + drop: 2, + falling: 3, + hit: 4, + rising: 5, }; let state = states.idle; @@ -124,7 +125,7 @@ function main() { } if (below) { - state = states.falling; + state = states.drop; } else if (nearby) { state = states.peeking; } @@ -139,10 +140,16 @@ function main() { } if (below) { - state = states.falling; + state = states.drop; } break; + case states.drop: + // Begin the fall. + Self.ShowLayerNamed("angry"); + Self.SetVelocity(Vector(0.0, dropSpeed)); + lastAltitude = -point.Y; + state = states.falling; case states.falling: Self.ShowLayerNamed("angry"); Self.SetVelocity(Vector(0.0, dropSpeed));