-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.js
48 lines (41 loc) · 1.13 KB
/
game.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
console.log(`idle production script ready`);
//purposely no space
// rakib doo doo
if (pntNumbero) {
let pointGen = setInterval(function () {
count = count + idleGen;
pntNumbero.innerHTML = count;
}, 1000)
}
if (upgIdle) {
upgIdle.addEventListener(`click`, function (e) {
if(idleGen == 0 && count >= idleUpgCost){
count = count - idleUpgCost;
idleGen += 1;
idleUpgCost = 5;
pntNumbero.innerHTML = count;
upgIdle.innerHTML = `Upgrade idle point gain! Cost: ${idleUpgCost}`;
}
else if (count >= idleUpgCost){
count = count - idleUpgCost;
idleGen *= 2;
idleUpgCost < 20 ? idleUpgCost *= 2 : idleUpgCost *= 2.5
// if(idleUpgCost < 20){
// idleUpgCost = idleUpgCost * 2;
// }
// else{
// idleUpgCost = idleUpgCost * 2.5;
// }
pntNumbero.innerHTML = count;
upgIdle.innerHTML = `Upgrade idle point gain! Cost: ${idleUpgCost}`;
}
else{
console.log({
failure:`No A+`,
count,
})
toggleFail(upgIdle);
setTimeout(3000, toggleFail(upgIdle));
}
})
}