From daa3581be09f18f282438b7849c0f01ebc30d823 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Tue, 15 Dec 2020 21:14:38 -0700 Subject: [PATCH] Fix pressing CC2 actions while moving --- js/game.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/game.js b/js/game.js index d74b6b7..1977e38 100644 --- a/js/game.js +++ b/js/game.js @@ -318,7 +318,7 @@ export class Level { this.cells = []; this.player = null; - this.previous_input = 0; + this.p1_previous_still_input = 0; this.actors = []; this.chips_remaining = this.stored_level.chips_required; this.bonus_points = 0; @@ -684,7 +684,7 @@ export class Level { // have four bowling balls and hold Q, you'll throw the first, wait a second or so, then // release the rest rapid-fire. absurd if (actor === this.player) { - let new_input = p1_input & ~this.previous_input; + let new_input = p1_input & ~this.p1_previous_still_input; if (new_input & INPUT_BITS.cycle) { this.cycle_inventory(this.player); } @@ -696,6 +696,7 @@ export class Level { // checking this.player swap_player1 = true; } + this.p1_previous_still_input = p1_input; } if (! actor.decision) @@ -754,8 +755,6 @@ export class Level { this.player = this.players[this.player_index]; } - this.previous_input = p1_input; - // Advance the clock // TODO i suspect cc2 does this at the beginning of the tic, but even if you've won? if you // step on a penalty + exit you win, but you see the clock flicker 1 for a single frame