minor initial position fix

master
Aevann 2023-04-30 00:07:25 +02:00
parent 4730c5cad1
commit 964416c0ea
1 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
const marsekoEl = document.getElementById("marseko");
function getInitialPosition(max) {
return Math.max(32, Math.floor(Math.random() * max) - 16);
return Math.max(32, Math.floor(Math.random() * max));
}
let marsekoPosX = getInitialPosition(screen.availWidth);
let marsekoPosY = getInitialPosition(screen.availHeight);
let marsekoPosX = getInitialPosition(screen.availWidth - 20);
let marsekoPosY = getInitialPosition(screen.availHeight - 50);
marsekoEl.style.left = `${marsekoPosX}px`;
marsekoEl.style.top = `${marsekoPosY}px`;
let mousePosX = marsekoPosX;