forked from rDrama/rDrama
1
0
Fork 0

reduced the number of bugs and fireflies on mobile

master
Aevann 2023-06-26 14:40:36 +03:00
parent 5a9966b74e
commit 24d93f7ab9
4 changed files with 18 additions and 11 deletions

View File

@ -1,7 +1,7 @@
new BugController({
imageSprite: "/i/fly-sprite.webp",
canDie: false,
minBugs: 10,
maxBugs: 20,
minBugs: MINFLIES,
maxBugs: MAXFLIES,
mouseOver: "multiply"
});
});

View File

@ -417,15 +417,25 @@ function logout(t) {
});
}
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
const screen_width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
function focusSearchBar(element)
{
if (width >= 768) {
if (screen_width >= 768) {
element.focus();
}
}
let MINFLIES;
let MAXFLIES;
if (screen_width < 768) {
MINFLIES = 5;
MAXFLIES = 10;
}
else {
MINFLIES = 10;
MAXFLIES = 20;
}
function insertText(input, text) {
const newPos = input.selectionStart + text.length;

View File

@ -1,7 +1,7 @@
new BugController({
imageSprite: "/i/fireflies.webp",
canDie: false,
minBugs: 10,
maxBugs: 20,
minBugs: MINFLIES,
maxBugs: MAXFLIES,
mouseOver: "multiply"
});
});

View File

@ -7,9 +7,6 @@ const YOFFSET = 37;
// chance of generating a new bug each second if not bugmaxxed
const BUGCHANCEPERSEC = 0.5;
// bug quantities
const MINFLIES = 5;
const MAXFLIES = 25;
const MINSPIDERS = 1;
const MAXSPIDERS = 1;