[object Object]

← back to Baguette Brawl

Fix contrarian findings: clear stale KO timer, remap P2 super off mute key (;), freeze AI during KO slow-mo, add favicon

d4057af14b82d368e7a22d37e08168290d8d989e · 2026-08-31 12:58:41 -0700 · Steve Abrams

Files touched

Diff

commit d4057af14b82d368e7a22d37e08168290d8d989e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 31 12:58:41 2026 -0700

    Fix contrarian findings: clear stale KO timer, remap P2 super off mute key (;), freeze AI during KO slow-mo, add favicon
---
 README.md      |  2 +-
 src/game.js    | 11 +++++++----
 src/index.html |  3 ++-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 205a51c..62fa968 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ npm start          # → http://localhost:8080
 | -------------- | ---------------------- | ---------------------- |
 | Move / Jump    | `A` `D` / `W`          | `←` `→` / `↑`          |
 | Jab · Heavy    | `J` · `K`              | `,` · `.`              |
-| Guard · Super  | `L` · `U`              | `/` · `M`              |
+| Guard · Super  | `L` · `U`              | `/` · `;`              |
 
 Global: **`P`** or `Esc` pause · **`M`** mute · **`R`** rematch on the result screen.
 
diff --git a/src/game.js b/src/game.js
index 50d1a47..a1ce4ee 100644
--- a/src/game.js
+++ b/src/game.js
@@ -110,7 +110,7 @@ function bindTouch(){
 // Fighter
 // ---------------------------------------------------------------------------
 const P1CTRL = {left:'a',right:'d',jump:'w',light:'j',heavy:'k',block:'l',super:'u'};
-const P2CTRL = {left:'ArrowLeft',right:'ArrowRight',jump:'ArrowUp',light:',',heavy:'.',block:'/',super:'m'};
+const P2CTRL = {left:'ArrowLeft',right:'ArrowRight',jump:'ArrowUp',light:',',heavy:'.',block:'/',super:';'};
 
 function makeFighter(x, facing, cfg){
   return {
@@ -128,7 +128,7 @@ function makeFighter(x, facing, cfg){
 
 let f1, f2, mode=1, difficulty='normal', state='menu';
 let roundNum=1, roundTime=60, timeLeft=60, roundPhase='intro';
-let freeze=0, shake=0, particles=[], clouds=[], stars=[];
+let freeze=0, shake=0, particles=[], clouds=[], stars=[], koTimer=null;
 let showAnnounce='', announceT=0, countdownT=0, lastCount=99;
 
 const AI_TUNE = {
@@ -157,6 +157,7 @@ function resetFighter(f,x,facing){
     blocking:false,swing:0,facing,hitFlash:0,onGround:true});
 }
 function startRound(){
+  clearTimeout(koTimer); koTimer=null;
   resEl.classList.add('hide'); menuEl.classList.add('hide'); pauseEl.classList.add('hide');
   resetFighter(f1,300,1);
   resetFighter(f2,660,-1);
@@ -295,6 +296,7 @@ function landHit(attacker, target, a){
 // AI
 // ---------------------------------------------------------------------------
 function aiControl(f, o, dt){
+  if(roundPhase!=='fight'){ f.vx*=.85; return; }   // no thinking during intro / ko slow-mo
   const T=AI_TUNE[difficulty]||AI_TUNE.normal;
   f._t=(f._t||0)+dt; f._think=(f._think||0)-dt;
   const dist=Math.abs(o.x-f.x);
@@ -365,7 +367,8 @@ function checkRoundEnd(){
   if(winner!==null){
     roundPhase='ko';
     if(winner!=='draw'){ showAnnounce='K.O.'; announceT=1.4; }
-    setTimeout(()=>endRound(winner), 1100);
+    clearTimeout(koTimer);
+    koTimer=setTimeout(()=>{ koTimer=null; endRound(winner); }, 1100);
   }
 }
 function endRound(winner){
@@ -396,7 +399,7 @@ function addBtn(label, fn, alt){
   const b=document.createElement('button'); b.className='play'+(alt?' alt':''); b.textContent=label;
   b.onclick=fn; resBtns.appendChild(b);
 }
-function toMenu(){ state='menu'; resEl.classList.add('hide'); pauseEl.classList.add('hide'); menuEl.classList.remove('hide'); }
+function toMenu(){ clearTimeout(koTimer); koTimer=null; state='menu'; resEl.classList.add('hide'); pauseEl.classList.add('hide'); menuEl.classList.remove('hide'); }
 function togglePause(){
   if(state==='fight'){ state='paused'; pauseEl.classList.remove('hide'); }
   else if(state==='paused'){ state='fight'; pauseEl.classList.add('hide'); }
diff --git a/src/index.html b/src/index.html
index b53b013..ab0e3bc 100644
--- a/src/index.html
+++ b/src/index.html
@@ -4,6 +4,7 @@
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
 <title>Baguette Brawl — Duel de Paris</title>
+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🥖</text></svg>">
 <link rel="stylesheet" href="styles.css">
 </head>
 <body>
@@ -38,7 +39,7 @@
         <h4>Gaston · Joueur 2</h4>
         <div class="row"><span>Move / Jump</span><span><kbd>←</kbd><kbd>→</kbd><kbd>↑</kbd></span></div>
         <div class="row"><span>Jab · Heavy</span><span><kbd>,</kbd><kbd>.</kbd></span></div>
-        <div class="row"><span>Guard · Super</span><span><kbd>/</kbd><kbd>M</kbd></span></div>
+        <div class="row"><span>Guard · Super</span><span><kbd>/</kbd><kbd>;</kbd></span></div>
       </div>
     </div>
     <div class="foot">Pause <kbd>P</kbd> · Mute <kbd>M</kbd> · Un jeu de pain · Paris</div>

← 3f651ec Baguette Brawl v1: rebuilt fighting game from Model Arena ar  ·  back to Baguette Brawl  ·  Refine: combo system + damage scaling, impact juice (flash/z f7fad89 →