diff --git a/images/banner.webp b/images/banner.webp new file mode 100644 index 0000000..90d9295 Binary files /dev/null and b/images/banner.webp differ diff --git a/index.html b/index.html index 67d6a28..1742624 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,7 @@ +
Monster Name: @@ -32,9 +33,8 @@ are in the town square. Where do you want to go? Use the buttons above.
- + + \ No newline at end of file diff --git a/script.js b/script.js index a84f275..79f946f 100644 --- a/script.js +++ b/script.js @@ -11,6 +11,7 @@ let inventory = ["stick"]; const button1 = document.querySelector("#button1"); const button2 = document.querySelector("#button2"); const button3 = document.querySelector("#button3"); +const button4 = document.querySelector("#button4"); const text = document.querySelector("#text"); const xpText = document.querySelector("#xpText"); const healthText = document.querySelector("#healthText"); @@ -124,6 +125,7 @@ localStorage.setItem("Inventory", JSON.stringify(inventory)); button1.onclick = goStore; button2.onclick = goCave; button3.onclick = fightDragon; +button4.onclick = help; // FUNCTIONS // @@ -159,7 +161,6 @@ function goCave() { update(locations[2]); } -/*YA ESTA FUNCIONANDO BIEN CON EL LOCAL STORAGE CHEQUEADO*/ function buyHealth() { if (parseInt(localStorage.getItem("Gold")) >= 10) { let currentGold = parseInt(localStorage.getItem("Gold")); @@ -175,7 +176,6 @@ function buyHealth() { } } -/*YA ESTA FUNCIONANDO BIEN CON EL LOCAL STORAGE CHEQUEADO*/ function buyWeapon() { let currentWeaponIndex = parseInt(localStorage.getItem("Current Weapon")); if (currentWeaponIndex < weapons.length - 1) { @@ -205,7 +205,6 @@ function buyWeapon() { } } -/*YA ESTA FUNCIONANDO BIEN CON EL LOCAL STORAGE CHEQUEADO*/ function sellWeapon() { let inventory = JSON.parse(localStorage.getItem("Inventory") || "[]"); if (inventory.length > 1) { @@ -351,6 +350,14 @@ function pickEight() { } +function help () { + Swal.fire({ + imageUrl: "/images/banner.webp", + imageWidth: 2000, + imageAlt: "Motivational quote: 'Fight with honor, Fight with discipline, Fight with vengeance" + }); +} + function pick(guess) { let numbers = []; while (numbers.length < 2) {