Skip to content

Commit 458f7fe

Browse files
difficulties update
cool B.1.1
1 parent c0ed68b commit 458f7fe

File tree

3 files changed

+67
-13
lines changed

3 files changed

+67
-13
lines changed

index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,31 @@ <h2>Enemy HP: <span id="enemy-hp">140</span></h2>
1919
<button id="button-3" onclick="belittle.useMove('player')" disabled="true">Belittle haha vocab word</button>
2020
<button id="button-4" onclick="tickle.useMove('player')" disabled="true">Tickle</button>
2121
</div>
22+
<br>
23+
<div id="difficulties">
24+
<a href="index.html?hp=120&boost=1">
25+
<button class="difficulty" id="d-easy">
26+
Easy
27+
</button>
28+
</a>
29+
<br>
30+
<a href="index.html?hp=140&boost=1.1">
31+
<button class="difficulty" id="d-normal">
32+
Normal
33+
</button>
34+
</a>
35+
<br>
36+
<a href="index.html?hp=160&boost=1.2">
37+
<button class="difficulty" id="d-hard">
38+
Hard
39+
</button>
40+
</a>
41+
<br>
42+
<a href="index.html?hp=200&boost=2">
43+
<img id="wawa" src="https://i1.sndcdn.com/avatars-1utUXjzJDp44NImm-Qy1TUg-t500x500.jpg"></img>
44+
</a>
45+
<span id="warning">warning: glitchy</span>
46+
</div>
47+
<p>You can make your own custom difficulty by changing the URL</p>
48+
<p>Change boost value for enemy attack multiplier and hp value for enemy HP</p>
2249
</body>

index.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ let playerExtraDmg = 1;
44
let enemyExtraDmg = 1.1;
55
let moveNames = []
66

7+
let params = window.location.search;
8+
params = new URLSearchParams(params);
9+
let newHp = params.get("hp");
10+
let newDmg = params.get("boost");
11+
newHp = Number(newHp)
12+
newDmg = Number(newDmg)
13+
if (newHp) {
14+
enemyHp = newHp;
15+
$("#enemy-hp").html(newHp);
16+
} if (newDmg) {
17+
enemyExtraDmg = newDmg;
18+
};
19+
20+
$('#button-1').prop("disabled", true);
21+
$('#button-2').prop("disabled", true);
22+
$('#button-3').prop("disabled", true);
23+
$('#button-4').prop("disabled", true);
24+
725
function sleep(ms) {
826
return new Promise(resolve => setTimeout(resolve, ms));
927
}
@@ -13,7 +31,6 @@ function toggleButtons() {
1331
$('#button-2').prop('disabled', (i, v) => !v);
1432
$('#button-3').prop('disabled', (i, v) => !v);
1533
$('#button-4').prop('disabled', (i, v) => !v);
16-
1734
}
1835

1936
function roundAndUpdate() {
@@ -67,7 +84,7 @@ function handleWin() {
6784
if (playerHp >= enemyHp) {
6885
display("You win!", "Good job!")
6986
} else {
70-
display("You lose.", "You had to have done that deliberately.")
87+
display("You lost.", "sad")
7188
}
7289
}
7390

styles.css

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,44 @@ body {
2222
border-top-right-radius: 0px;
2323
}
2424

25-
button {
25+
button:not(.difficulty) {
2626
border: 0;
2727
width: 47.5vw;
2828
height: 50px;
2929
}
3030

31-
#button-1 {
32-
background-color: rgb(255, 120, 100);
33-
}
31+
#button-1 {background-color: rgb(255, 120, 100); }
3432

3533
#button-2 {
3634
background-color: rgb(100, 120, 255);
3735
float: right;
3836
}
3937

40-
#button-3 {
41-
background-color: rgb(255, 255, 120);
42-
}
38+
#button-3 {background-color: rgb(255, 255, 120); }
4339

4440
#button-4 {
4541
background-color: rgb(100, 255, 120);
4642
float: right;
4743
}
4844

45+
#wawa {
46+
width: 10vw;
47+
height: 10vw;
48+
}
49+
4950
button:disabled {
50-
background-color: rgb(120, 120, 120)
51+
background-color: rgb(120, 120, 120) !important;
52+
color: white;
53+
}
54+
55+
.difficulty {
56+
border: 0;
57+
width: 10vw;
58+
height: 10vw;
5159
}
5260

53-
.dead {
54-
color: rgb(255, 120, 100);
55-
}
61+
.dead {color: rgb(255, 120, 100);}
62+
#warning {color: darkred;}
63+
#d-easy {background-color: rgb(100, 255, 120)}
64+
#d-normal {background-color:rgb(255, 255, 120)}
65+
#d-hard {background-color:rgb(255, 120, 100)}

0 commit comments

Comments
 (0)