fix square fireworks

This commit is contained in:
lelgenio 2025-03-21 23:20:36 -03:00
parent 29dde9d196
commit efe5ac4a16
No known key found for this signature in database
GPG key ID: 2F8F21CE8721456B
2 changed files with 8 additions and 17 deletions

View file

@ -3,13 +3,17 @@ export class Particle {
constructor(x, y, color) {
this.x = x;
this.y = y;
this.velocityX = (Math.random() - 0.5) * 5;
this.velocityY = (Math.random() - 0.5) * 5;
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.05;
this.resistance = 0.96;
this.gravity = 0.01;
this.resistance = 0.99;
}
update() {

View file

@ -1,13 +0,0 @@
// Código das partículas
class Particle {
// ... código da classe Particle
}
// Código dos fogos
let fireworks = [];
let particles = [];
// ... resto do código
// Código principal
let targetDate = new Date(2025, 3, 10, 0, 0, 0).getTime();
// ... resto do código