// Boundary for bots bot.x = Math.min(Math.max(bot.x, bot.size/2), canvas.width - bot.size/2); bot.y = Math.min(Math.max(bot.y, bot.size/2), canvas.height - bot.size/2);

// Restart button document.getElementById('restartBtn').addEventListener('click', () => initGame(); gameRunning = true; );

// Game state let gameRunning = true; let score = 0;

// Draw bullets for (let b of bullets) ctx.fillStyle = "gold"; ctx.beginPath(); ctx.arc(b.x, b.y, b.radius-2, 0, Math.PI*2); ctx.fill();

Click below to Chat with our Team or Ask any Questions!