Skip to content

Commit

Permalink
criação da função location
Browse files Browse the repository at this point in the history
  • Loading branch information
jmtannus committed Feb 22, 2024
1 parent 79436a6 commit 4dbbf53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Aprenda JavaScript-básico-criando-um-jogo-de-RPG/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ const goldText = document.querySelector("#goldText");
const monsterStats = document.querySelector("#monsterStats");
const monsterName = document.querySelector("#monsterName");
const monsterHealthText = document.querySelector("#monsterHealth");
const locations = [{ }];

// initialize buttons
button1.onclick = goStore;
button2.onclick = goCave;
button3.onclick = fightDragon;

function update(location) {}

function goTown() {
button1.innerText = "Go to store";
button2.innerText = "Go to cave";
Expand All @@ -30,7 +33,7 @@ function goTown() {
button2.onclick = goCave;
button3.onclick = fightDragon;
text.innerText =
"You are in the town square. You see a sign that says Store.";
'You are in the town square. You see a sign that says "Store".';
}

function goStore() {
Expand Down

0 comments on commit 4dbbf53

Please sign in to comment.