-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
101 lines (92 loc) · 2.63 KB
/
main.js
File metadata and controls
101 lines (92 loc) · 2.63 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Main = {};
//Instantiate main game function
$(function(){
$("#Quests").click(function(event) {
event.preventDefault();
document.getElementById('StatusBar').innerHTML = ("<p>Current Quest: " + Quest.CurrentQuest+"</p>");
Achievement.Time = 0;
});
}
);
$(function(){
//Pickaxe waits for click here. Calls event.
$("#Pick").click(function(event) {
event.preventDefault();
if(true){
Game.Pick();
}
});
}
);
$(function(){
//Wood Axe waits for click here. Calls Event
$("#Axe").click(function(event) {
event.preventDefault();
if(true){
Game.Axe();
}
});
}
);
$(function(){
//Shovel waits for click here. Calls Event
$("#Shovel").click(function(event) {
event.preventDefault();
if(true){
Game.Dig();
}
});
}
);
$(function(){
//This is a part upgrade, waits for the click, calls event.
$("#PUpgrade").click(function(event){
event.preventDefault();
if(Game.Stone >= Math.round(50 * (1 + .15 * Game.ToolLevels.PickLevel))&& Game.Wood >= Math.round(10 *(1 + .15 * Game.ToolLevels.PickLevel))){
Game.PickUpgrade();
}else{
alert(Math.round(50 * (1 + .15 * Game.ToolLevels.PickLevel)) + " Stone and "+ Math.round(10 *(1 + .15 * Game.ToolLevels.PickLevel)) + " Wood Required To Upgrade Pickaxe!");
}
});
}
);
$(function(){
//This is a part upgrade, waits for the click, calls event.
$("#AUpgrade").click(function(event){
event.preventDefault();
if(Game.Stone >= Math.round(50 * (1 + .15 * Game.ToolLevels.AxeLevel))&& Game.Wood >= Math.round(10 *(1 + .15 * Game.ToolLevels.AxeLevel))){
Game.AxeUpgrade();
}else{
alert(Math.round(50 * (1 + .15 * Game.ToolLevels.AxeLevel)) + " Stone and "+ Math.round(10 *(1 + .15 * Game.ToolLevels.AxeLevel)) + " Wood Required To Upgrade Axe!");
}
});
}
);
$(function(){
//This is a part upgrade, waits for the click, calls event.
$("#SUpgrade").click(function(event) {
event.preventDefault();
if(Game.Stone >= Math.round(50 * (1 + .15 * Game.ToolLevels.ShovelLevel))&& Game.Wood >= Math.round(10 *(1 + .15 * Game.ToolLevels.ShovelLevel))){
Game.ShovelUpgrade();
}else{
alert(Math.round(50 * (1 + .15 * Game.ToolLevels.ShovelLevel)) + " Stone and "+ Math.round(10 *(1 + .15 * Game.ToolLevels.ShovelLevel)) + " Wood Required To Upgrade Shovel!");
}
});
}
);
$(function(){
//This Is For Saving The Game
$("#SaveGame").click(function(event){
event.preventDefault();
SaveGame.SaveAll();
});
}
);
$(function(){
//This Is For Laoding The Game
$("#LoadGame").click(function(event) {
event.preventDefault();
LoadGame.LoadAll();
});
}
);