// Show message with fade out later let msgTimeout; function setMessage(text, isError = false) if (msgTimeout) clearTimeout(msgTimeout); messageDiv.style.color = isError ? '#ff8888' : '#b3ffaa'; messageDiv.innerText = text; msgTimeout = setTimeout(() => messageDiv.innerText = '⚡ Spin or Fire ⚡'; messageDiv.style.color = '#f0c674'; , 1800);
// Gun body (simple) ctx.save(); ctx.shadowBlur = 0; ctx.fillStyle = "#2f2a24"; ctx.beginPath(); ctx.rect(280, 240, 240, 80); ctx.fill(); ctx.fillStyle = "#5a4a38"; ctx.beginPath(); ctx.rect(500, 260, 100, 40); ctx.fill();
.info-panel display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px; background: #1e160e; padding: 12px 24px; border-radius: 60px; color: #f7e05e; text-shadow: 0 2px 0 #4a2a00; font-weight: bold; font-size: 1.4rem;
// Reset full game function resetGame() chambers = 6; liveChamber = Math.floor(Math.random() * chambers); currentChamber = 0; score = 0; shotsFired = 0; gameActive = true; spinAngle = 0; spinVelocity = 0; cylinderSpinning = false; updateUI(); setMessage('🔁 New cylinder! Good luck.'); drawGun();
ctx.restore();
if (isCurrent && !cylinderSpinning) ctx.beginPath(); ctx.arc(x, y, 12, 0, Math.PI*2); ctx.strokeStyle = "#ffdd88"; ctx.lineWidth = 2.5; ctx.stroke();
.game-container background: #2c1e12; border-radius: 48px; padding: 24px 32px 32px 32px; box-shadow: 0 20px 35px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1); border-bottom: 4px solid #4a2a18;
// Show message with fade out later let msgTimeout; function setMessage(text, isError = false) if (msgTimeout) clearTimeout(msgTimeout); messageDiv.style.color = isError ? '#ff8888' : '#b3ffaa'; messageDiv.innerText = text; msgTimeout = setTimeout(() => messageDiv.innerText = '⚡ Spin or Fire ⚡'; messageDiv.style.color = '#f0c674'; , 1800);
// Gun body (simple) ctx.save(); ctx.shadowBlur = 0; ctx.fillStyle = "#2f2a24"; ctx.beginPath(); ctx.rect(280, 240, 240, 80); ctx.fill(); ctx.fillStyle = "#5a4a38"; ctx.beginPath(); ctx.rect(500, 260, 100, 40); ctx.fill();
.info-panel display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px; background: #1e160e; padding: 12px 24px; border-radius: 60px; color: #f7e05e; text-shadow: 0 2px 0 #4a2a00; font-weight: bold; font-size: 1.4rem;
// Reset full game function resetGame() chambers = 6; liveChamber = Math.floor(Math.random() * chambers); currentChamber = 0; score = 0; shotsFired = 0; gameActive = true; spinAngle = 0; spinVelocity = 0; cylinderSpinning = false; updateUI(); setMessage('🔁 New cylinder! Good luck.'); drawGun();
ctx.restore();
if (isCurrent && !cylinderSpinning) ctx.beginPath(); ctx.arc(x, y, 12, 0, Math.PI*2); ctx.strokeStyle = "#ffdd88"; ctx.lineWidth = 2.5; ctx.stroke();
.game-container background: #2c1e12; border-radius: 48px; padding: 24px 32px 32px 32px; box-shadow: 0 20px 35px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1); border-bottom: 4px solid #4a2a18;