changed y position calculation

This commit is contained in:
MLH
2025-01-28 01:29:09 +01:00
parent 8438874294
commit 58ca47147b

View File

@ -224,8 +224,9 @@ function animateSanta() {
const fromLeft = Math.random() < 0.5;
const startX = fromLeft ? -220 : screenWidth + 220;
const endX = fromLeft ? screenWidth + 220 : -220;
const startY = Math.random() * (screenHeight / 6) + 20; // Restrict to upper screen
const endY = Math.random() * (screenHeight / 6) + 20; // Restrict to upper screen
const santaHeight = santa.offsetHeight;
const startY = Math.random() * (screenHeight / 5 - santaHeight - 50) + 50; // Restrict to upper screen
const endY = Math.random() * (screenHeight / 5 - santaHeight - 50) + 50; // Restrict to upper screen
const angle = Math.random() * 20 - 10; // -10 to 10 degrees
santa.style.left = `${startX}px`;