ILBA VENTURES
BRONZE ROOKIE
👑
REACTION
KING
⚡ How Fast Are You?
❓ Unranked
Your Rank
Best (ms)
1
Level
0
Games
0🔥
Day Streak
0
COINS
function handleTap() { initAudio(); // ══ DOUBLE TAP MODE ══ if(S.mode==='doubletap'){ if(S.state==='waiting'){ clearTimeout(S.timer);clearTimeout(doubleTapWindowTimer); doubleTapState='none';document.getElementById('dt-prog')?.remove(); S.state='early';S.combo=0; setTapState('early','😱','TOO EARLY!','Wait for green first!'); SFX.early();haptic(100);flashScreen('red');showFloat('TOO EARLY! ❌','#FF006E'); S.lives--;updateLives(); if(S.lives<=0){endGame();return;} setTimeout(()=>nextRound(),1500);return; } if(S.state==='ready'){clearTimeout(S.timer);handleDoubleTapFirst();return;} if(doubleTapState==='first'){ const ms=handleDoubleTapSecond(); S.times.push(ms);S.state='tapped';S.combo++; if(S.combo>S.maxCombo)S.maxCombo=S.combo; const rating=getRating(ms); setTapState('success','✅',ms+'ms',rating.icon+' DOUBLE TAP!'); SFX.tap(ms);haptic(20);if(S.combo>=3){SFX.combo();showCombo(S.combo);} showFloat(ms+'ms',rating.color); if(!bestTime||ms{if(S.round>=S.maxRounds)endGame();else nextRound();},1000);return; } return; } // ══ WARMUP MODE ══ if(S.mode==='warmup'){ if(S.state==='waiting'){SFX.early();haptic(20);return;} if(S.state==='ready'){ clearTimeout(S.timer); const ms=Math.round(performance.now()-S.readyTime); warmupTaps++;warmupTotal+=ms; if(!warmupBest||msnextRound(),800);return; } return; } // ══ TOURNAMENT: early tap = instant fail ══ if(S.mode==='tournament'&&S.state==='waiting'){ clearTimeout(S.timer);tournamentFailed=true;S.state='early';S.combo=0; setTapState('early','❌','TOURNAMENT FAILED!','Zero mistakes allowed!'); SFX.early();haptic(200);flashScreen('red');showFloat('FAILED!','#FF006E'); const failEl=document.createElement('div'); failEl.style.cssText='position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);font-family:Bebas Neue,sans-serif;font-size:60px;color:#FF006E;pointer-events:none;z-index:1000;animation:prFlash 1.5s ease-out forwards'; failEl.textContent='❌ FAILED!';document.body.appendChild(failEl); setTimeout(()=>{if(failEl.parentElement)failEl.remove();endGame();},1500);return; } // ══ STANDARD FLOW (Classic, Blitz, Challenge, Fake Out, Shrink, Fast, etc.) ══ if(S.state==='waiting'){ clearTimeout(S.timer);S.state='early';S.combo=0; setTapState('early','😱','TOO EARLY!','Wait for green!'); SFX.early();haptic(100);flashScreen('red');showFloat('TOO EARLY! ❌','#FF006E'); if(S.mode==='challenge'){S.lives--;updateLives();if(S.lives<=0){endGame();return;}} setTimeout(()=>{if(S.roundS.maxCombo)S.maxCombo=S.combo; const rating=getRating(ms); setTapState('success','✅',ms+'ms',rating.icon+' '+rating.label); SFX.tap(ms);haptic(20); if(S.combo>=3){SFX.combo();showCombo(S.combo);} showFloat(ms+'ms',rating.color);updateMeter(ms); showLightningBurst(); setTimeout(()=>updateMultChain(S.combo),100); const earned=addXP(getXpForTime(ms),S.combo); S.xpEarned=(S.xpEarned||0)+Math.round(earned); const xpFl=document.createElement('div'); xpFl.style.cssText='position:fixed;color:#BF00FF;font-size:16px;font-weight:700;pointer-events:none;z-index:9999;right:16px;top:40%;font-family:Orbitron,sans-serif;animation:floatUp .9s ease-out forwards'; xpFl.textContent='+'+Math.round(earned)+' XP';document.body.appendChild(xpFl);setTimeout(()=>xpFl.remove(),900); if(!bestTime||msnextRound(),1000);} else if(S.mode==='boss'){ const won=ms<=(S.bossTarget||250); SFX.win();haptic(won?100:50); if(won){ const bk='boss_'+new Date().toDateString(); localStorage.setItem(bk+'_count',String(parseInt(localStorage.getItem(bk+'_count')||'0')+1)); save('boss_beaten',true);addCoins(15+isNightOwl()*3); showAch({em:'👑',name:'BOSS DEFEATED! '+ms+'ms ≤ '+S.bossTarget+'ms!'}); }else{showAch({em:'💀',name:ms+'ms — needed '+S.bossTarget+'ms!'});} setTimeout(()=>{showScr('home');setNav('nav-home');updateHome();},2000); } else if(S.mode==='beatclock'){ beatClockTaps++; const bctEl2=document.getElementById('beat-clock-taps'); if(bctEl2)bctEl2.textContent=beatClockTaps+' TAPS'; checkBeatClockMilestone(beatClockTaps); setTimeout(()=>nextRound(),400); } else{setTimeout(()=>{if(S.round>=S.maxRounds)endGame();else nextRound();},1000);} } }