-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (95 loc) · 3.05 KB
/
index.html
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
<!doctype html>
<html>
<head>
<link rel="icon" href="http://www.iconarchive.com/download/i66332/thegirltyler/brand-camp/Camp-Fire-Stories.ico">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>Scouting Adventures</title>
</head>
<body>
<div id="header">
<script>
var rank = "Scout"
var points = 0
var troop = prompt("Hello! Welcome to Scouting Adventures! This is a game where you can vurtually expeirience the thrills of scouting! First of all, what troop are you going to join?","Type in your troop number here!");
//These logs are for de-bugging
console.log(rank);
console.log(points);
console.log(troop);
for (var i = 0; i < 1;) {
do {
if (isNaN(troop) == true) {
troop = prompt("Please use a number!")
}
else {
window.alert("Ok, so you have joined troop " + troop + "! Click 'ok' to begin your scouting adventure!");
i++
}
}
while (isNaN(troop) == true)
}
switch (points) {
case 100:
rank = "Tenderfoot";
break;
case 250:
rank = "Second Class";
break;
case 400:
rank = "First Class";
break;
case 700:
rank = "Star";
break;
case 1200:
rank = "Life";
break;
case 1800:
rank = "Eagle"
break;
};
function func2() {
document.getElementById("point").innerHTML = "You have " + points + " points!";
};
function func() {
document.getElementById("rankdis").innerHTML = "Your rank is " + rank + "!";
};
</script>
<h3>Welcome to your Scout Dashboard!</h3>
<h5>This is the place where you can review your entire life of Scouts! This is where you can go on camp-outs and take classes! Doing those will earn you Scout points, and the more points you earn the higher your rank!</h5>
<p id="rankdis" onclick="func()">Click here to see your rank!</p>
<p id="point" onclick="func2()">Click here to see your points!</p>
<input type="button" value="Hike" onclick="hike()"/>
<script>
function hike() {
var hiking = confirm("Are you ready to hike?");
if (hiking = true){
var lochike = prompt("Where do you want to hike? Your options are Grand Canyon, Forest, Mountain, or Death Valley").toLowerCase()
switch (lochike){
case ("grand canyon"):
points = points + 15;
window.alert("What a view! You have earned 15 points for hiking here! You now have " + points + " points!");
break;
case ("death valley"):
points = points + 20;
window.alert("Hot choice! You have earned 20 points for hiking here! You now have " + points + " points!");
break;
case ("forest"):
points = points + 5;
window.alert("Oh look, a rabbit! For hiking here you have earned 5 points! You now have " + points + " points!");
break;
case ("mountain"):
points = points + 10;
window.alert("You're on top of the world! You have earned 10 points for hiking here! You now have " + points + " points!");
break;
default:
window.alert("Sorry! Troop " + troop + " can't go there! Please try again and check your spelling!");
}
}
else{
window.alert("Oh. Ok!");
}
};
</script>
</div>
</body>
</html>