Update new year, Fix font

This commit is contained in:
MrLetsplay 2024-12-29 23:11:34 +01:00
parent 2d7c83cea1
commit afca93e6cf
Signed by: mr
SSH Key Fingerprint: SHA256:92jBH80vpXyaZHjaIl47pjRq+Yt7XGTArqQg1V7hSqg
2 changed files with 15 additions and 13 deletions

View File

@ -5,6 +5,6 @@
@font-face { @font-face {
font-family: "Comic Mono"; font-family: "Comic Mono";
font-weight: boldM font-weight: bold;
src: url('ComicMono-Bold.ttf') format('truetype'); src: url('ComicMono-Bold.ttf') format('truetype');
} }

View File

@ -80,7 +80,7 @@ setInterval(() => {
} }
if (state == STATE_FIREWORKS) { 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; return;
} else { } else {
rockets = []; rockets = [];
@ -150,15 +150,17 @@ setInterval(() => {
const size = explosionTime * EXPLOSION_SIZE; const size = explosionTime * EXPLOSION_SIZE;
for (let i = 0; i < NUM_PARTICLES; i++) { for (let i = 0; i < NUM_PARTICLES; i++) {
const angle = i / NUM_PARTICLES * Math.PI * 2; for (let j = 0; j < rocket.rounds; j++) {
const px = Math.cos(angle) * size; const angle = i / NUM_PARTICLES * Math.PI * 2 + j * 5;
const py = Math.sin(angle) * size; const px = (j + 1) * Math.cos(angle) * size;
const py = (j + 1) * Math.sin(angle) * size;
ctx.fillStyle = rocket.color; ctx.fillStyle = rocket.color;
ctx.beginPath(); ctx.beginPath();
ctx.arc(rocket.x + px, rocket.y + py, 5, 0, Math.PI * 2, true); ctx.arc(rocket.x + px, rocket.y + py, 5, 0, Math.PI * 2, true);
ctx.fill(); ctx.fill();
} }
}
} else { } else {
rocket.y -= SPEED; rocket.y -= SPEED;
ctx.fillStyle = "black"; ctx.fillStyle = "black";