Prevent multiple pokeball throws: add throwing guard flag and block at 0 pokeballs

This commit is contained in:
Sterling Archer committed 2026-05-28 13:27:37 -07:00
1 parent 2c88aa2a5b
commit ddf96d87ac
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -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);
+1 -1
View File
@@ -7,7 +7,7 @@
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="theme-color" content="#0a0520">
<title>PokéSQL — Learn SQL</title>
<title>PokéSQL — Lean SQL</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="style.css">
</head>