forked from CloodDev/Boykisser-Clicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
51 lines (42 loc) · 1.41 KB
/
main.js
File metadata and controls
51 lines (42 loc) · 1.41 KB
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
Game.registerMod("imsuchasillyboykisser",{
init:function(){
Game.Notify(`Boykisser mod loaded!`,`Now you can kiss boysssss :3`,[30,8]);
this.buttonClicks=0;
l('storeTitle').insertAdjacentHTML('beforeend','<a style="font-size:12px;position:absolute;bottom:2px;right:2px;display:block;" class="smallFancyButton" id="storeClicker"></a>');
this.updateScore();
let MOD=this;
AddEvent(l('storeClicker'),'click',function(){
PlaySound('snd/pop'+Math.floor(Math.random()*3+1)+'.mp3',0.5);
MOD.buttonClicks+=1;
MOD.updateScore();
if (MOD.buttonClicks%20==0 && MOD.buttonClicks>0) Game.Notify(choose([`Splendid!`,`Keep going!`,`Amazing!`,`Incredible!`,`Outstanding!`]),'',0,2);
});
Game.registerHook('reset',function(hard){
if (hard)
{
MOD.buttonClicks=0;
MOD.updateScore();
}
});
// define the image sources
// load config.json from file config.json
var boyKisserConfig = JSON.parse(this.dir+'./config.json');
var ImagesPath = this.dir + boyKisserConfig.Steam.ImagesPath;
var images = boyKisserConfig.Images;
// replace the images
for (var key in images) {
Game.Loader.Replace(key, ImagesPath + images[key]);
}
},
save:function(){
return String(this.buttonClicks);
},
load:function(str){
this.buttonClicks=parseInt(str||0);
this.updateScore();
},
updateScore:function()
{
l('storeClicker').innerHTML='Click me!<br>'+Beautify(this.buttonClicks);
},
});