-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
76 lines (69 loc) · 1.9 KB
/
script.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
console.log(`Connected: Initiate Rizzing of the females via Javascript`);
// review with rakib !!!!!!
// async function DoSomething() {
// count += idlepoints;
// }
// DoSomething();
function getdoc(selector) {
return document.querySelector(selector);
}
function toggleFail(item){
item.classList.toggle(`basicButtonFail`);
}
function perSecPoints(Modifier) {
count += idlepoints * Modifier;
}
// for FUTURE WORK
let curMod = 0;
// Get docs
let pntNumbero = getdoc(`.points`);
let OGbutt = getdoc(`#theOGButton`);
let pntDisplay = getdoc(`#pointDisplay`);
let upgCursor = getdoc(`#UpgCursor`);
let pntGainDisplay = getdoc(`#pointClickDisplay`);
let upgIdle = getdoc(`#UpgIdle`);
// others
let count = 0;
let buttString = `Current points:0`;
let upgCost = 10;
let pointGain = 1;
// idle things
let idleGen = 0;
let idlepoints = 1;
let idleUpgCost = 10;
if(OGbutt){
OGbutt.addEventListener(`click`, function (e) {
// count = parseInt(pntNumbero.innerHTML);
count = count + pointGain;
// OGbutt.classList.toggle(`circleButton`);
// if (buttswap != `programmer`) {
// buttswap = `programmer`;
// }
// else {
// buttswap = `gamer`;
// }
// buttString = `Current Points: ${count}`;
// pntDisplay.innerHTML = buttString;
pntNumbero.innerHTML = count;
})
}
if(upgCursor){
upgCursor.addEventListener(`click`, function (e) {
count = parseInt(pntNumbero.innerHTML);
if(count >= upgCost){
count -= upgCost;
pointGain *= 2;
upgCost *= 2;
pntGainDisplay.innerHTML = `Points gained per click: ${pointGain}`;
upgCursor.innerHTML = `Upgrade Cursor! Cost: ${upgCost} points`;
pntNumbero.innerHTML = count;
// buttString = `Current Points: ${count}`;
// pntDisplay.innerHTML = buttString;
}
else{
//upgCursor.classList.toggle(`basicButtonFail`);
toggleFail(upgCursor)
setTimeout(toggleFail,3000,upgCursor);
}
})
}