Skip to content

Commit

Permalink
reset boss battle
Browse files Browse the repository at this point in the history
  • Loading branch information
Benzson92 committed Oct 17, 2020
1 parent f9ad958 commit 0030f05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions boss-battle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ <h2 id="player-name">Josuke</h2>
</ul>
<span id="status"></span>
<textarea readonly id="combat-log"></textarea>
<div style="margin: 40px;">
<button id="btn-reset" onclick="onReset()">Reset</button>
</div>
</div>
<script>
// Game variable
Expand All @@ -112,6 +115,9 @@ <h2 id="player-name">Josuke</h2>
var playerDefStatus = document.getElementById("def")
var playerStatus = document.getElementById("status")
var combatLog = document.getElementById("combat-log")
function onReset() {
playerHealthBar.innerText = 2000
}
function random(min, max) {
// Credit: https://www.geeksforgeeks.org/how-to-select-a-random-element-from-array-in-javascript/
return Math.floor(Math.random() * (max - min) + min)
Expand Down
2 changes: 1 addition & 1 deletion fruit-vegetable/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const timeLimit = 60;

let itemList = [
{ "name": "acorn squashdddd", "fruit": false },
{ "name": "acorn squash", "fruit": false },
{ "name": "alfalfa sprout", "fruit": false },
{ "name": "amaranth", "fruit": false },
{ "name": "anise", "fruit": false },
Expand Down

0 comments on commit 0030f05

Please sign in to comment.