From ddf96d87ac0f73014f4ef90bcca81c2d6a0cdb57 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Thu, 28 May 2026 13:27:37 -0700 Subject: [PATCH] Prevent multiple pokeball throws: add throwing guard flag and block at 0 pokeballs --- game.js | 5 +++++ index.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/game.js b/game.js index 25ebd69..1f0edd4 100644 --- a/game.js +++ b/game.js @@ -1455,6 +1455,7 @@ class Game { showCatchScreen() { const wild = this.state.currentWild; if (!wild) return; + this._throwing = false; this.show('catch'); this._showController(true); @@ -1496,6 +1497,9 @@ class Game { } throwPokeball(wild, canCatch) { + if (this._throwing) return; + if (this.state.pokeballs <= 0) return; + this._throwing = true; this.state.pokeballs--; SFX.pokeball(); @@ -1563,6 +1567,7 @@ class Game { } _showCatchResult(wild, canCatch) { + this._throwing = false; this.show('catch-result'); this._showController(true); diff --git a/index.html b/index.html index bf3c0a1..854db5f 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ -PokéSQL — Learn SQL +PokéSQL — Lean SQL