From 045bcb5789fd150f68f975dcb4c71f2bc3deecdb Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Mon, 14 Sep 2020 21:09:05 -0600 Subject: [PATCH] Remove blocks' knowledge of their pusher's speed --- js/game.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/game.js b/js/game.js index 9b49d61..a96a192 100644 --- a/js/game.js +++ b/js/game.js @@ -590,7 +590,7 @@ export class Level { // Try to move the given actor one tile in the given direction and update // their cooldown. Return true if successful. - attempt_step(actor, direction, pusher_speed = null) { + attempt_step(actor, direction) { if (actor.stuck) return false; @@ -635,9 +635,7 @@ export class Level { if (actor.type.pushes && actor.type.pushes[tile.type.name] && tile.movement_cooldown === 0 && ! tile.stuck) { this.set_actor_direction(tile, direction); - // FIXME the speed adjustment at the end of all this should go before this - // call, but this all needs splitting up anyway - if (this.attempt_step(tile, direction, speed)) + if (this.attempt_step(tile, direction)) // It moved out of the way! continue; } @@ -672,11 +670,6 @@ export class Level { return false; } - // We cannot possibly move more slowly than something pushing us - if (pusher_speed !== null) { - speed = Math.min(speed, pusher_speed); - } - // We're clear! this.move_to(actor, goal_cell, speed);