Update new year, Fix font
This commit is contained in:
parent
2d7c83cea1
commit
afca93e6cf
@ -5,6 +5,6 @@
|
||||
|
||||
@font-face {
|
||||
font-family: "Comic Mono";
|
||||
font-weight: boldM
|
||||
font-weight: bold;
|
||||
src: url('ComicMono-Bold.ttf') format('truetype');
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ setInterval(() => {
|
||||
}
|
||||
|
||||
if (state == STATE_FIREWORKS) {
|
||||
rockets.push({ x: Math.random() * canvas.width, y: canvas.height, life: (Math.random() * 0.75 + 0.25) * canvas.height, color: HSVtoRGB(Math.random(), 1, 1) });
|
||||
rockets.push({ x: Math.random() * canvas.width, y: canvas.height, life: (Math.random() * 0.75 + 0.25) * canvas.height, color: HSVtoRGB(Math.random(), 1, 1), rounds: Math.random() * 3 });
|
||||
return;
|
||||
} else {
|
||||
rockets = [];
|
||||
@ -150,15 +150,17 @@ setInterval(() => {
|
||||
const size = explosionTime * EXPLOSION_SIZE;
|
||||
|
||||
for (let i = 0; i < NUM_PARTICLES; i++) {
|
||||
const angle = i / NUM_PARTICLES * Math.PI * 2;
|
||||
const px = Math.cos(angle) * size;
|
||||
const py = Math.sin(angle) * size;
|
||||
for (let j = 0; j < rocket.rounds; j++) {
|
||||
const angle = i / NUM_PARTICLES * Math.PI * 2 + j * 5;
|
||||
const px = (j + 1) * Math.cos(angle) * size;
|
||||
const py = (j + 1) * Math.sin(angle) * size;
|
||||
|
||||
ctx.fillStyle = rocket.color;
|
||||
ctx.beginPath();
|
||||
ctx.arc(rocket.x + px, rocket.y + py, 5, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rocket.y -= SPEED;
|
||||
ctx.fillStyle = "black";
|
||||
|
Loading…
x
Reference in New Issue
Block a user