// Particle class (for explosion) export class Particle { constructor(x, y, color) { this.x = x; this.y = y; const directionRadians = Math.random() * Math.PI * 2; const speed = Math.random() * 3; this.velocityX = Math.cos(directionRadians) * speed; this.velocityY = Math.sin(directionRadians) * speed; this.size = Math.random() * 4 + 1; // Tamanho maior para melhor visibilidade this.color = color; this.alpha = 1; this.gravity = 0.01; this.resistance = 0.99; } update() { this.velocityX *= this.resistance; this.velocityY *= this.resistance; this.velocityY += this.gravity; this.x += this.velocityX; this.y += this.velocityY; this.alpha -= 0.01; return this.alpha > 0; } draw(context) { context.globalAlpha = this.alpha; context.fillStyle = this.color; context.beginPath(); context.arc(this.x, this.y, this.size, 0, Math.PI * 2); context.fill(); context.globalAlpha = 1; } }