fix square fireworks
This commit is contained in:
parent
29dde9d196
commit
efe5ac4a16
12
particles.js
12
particles.js
|
@ -3,13 +3,17 @@ export class Particle {
|
||||||
constructor(x, y, color) {
|
constructor(x, y, color) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
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.size = Math.random() * 4 + 1; // Tamanho maior para melhor visibilidade
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.alpha = 1;
|
this.alpha = 1;
|
||||||
this.gravity = 0.05;
|
this.gravity = 0.01;
|
||||||
this.resistance = 0.96;
|
this.resistance = 0.99;
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
|
13
script.js
13
script.js
|
@ -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
|
|
Loading…
Reference in a new issue