forked from rDrama/rDrama
minor initial position fix
parent
4730c5cad1
commit
964416c0ea
|
@ -1,10 +1,10 @@
|
||||||
const marsekoEl = document.getElementById("marseko");
|
const marsekoEl = document.getElementById("marseko");
|
||||||
|
|
||||||
function getInitialPosition(max) {
|
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 marsekoPosX = getInitialPosition(screen.availWidth - 20);
|
||||||
let marsekoPosY = getInitialPosition(screen.availHeight);
|
let marsekoPosY = getInitialPosition(screen.availHeight - 50);
|
||||||
marsekoEl.style.left = `${marsekoPosX}px`;
|
marsekoEl.style.left = `${marsekoPosX}px`;
|
||||||
marsekoEl.style.top = `${marsekoPosY}px`;
|
marsekoEl.style.top = `${marsekoPosY}px`;
|
||||||
let mousePosX = marsekoPosX;
|
let mousePosX = marsekoPosX;
|
||||||
|
|
Loading…
Reference in New Issue