Skip to content

Commit

Permalink
Merge pull request #73 from Benzson92/boss-battle-2
Browse files Browse the repository at this point in the history
hacktoberfest: boss battle reset button
  • Loading branch information
chunrapeepat authored Oct 18, 2020
2 parents d0b2e79 + 0030f05 commit b6a451b
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 @@ -94,6 +94,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 @@ -115,6 +118,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 b6a451b

Please sign in to comment.