Tell us what’s happening:
Your locations array should have two values. What am I doing wrong?
This is my code: const locations = [
{
name: “town square”,
“button text”: [“Go to store”, “Go to cave”, “Fight dragon”],
“button functions”: [goStore, goCave, fightDragon],
text: “You are in the town square. You see a sign that says "Store".”
}
{
name: “store”,
“button text”: [“Buy 10 health (10 gold)”, “Buy weapon (30 gold)”, “Go to town square”],
“button funtions” [buyHealth, buyWeapon, goTown],
text: “You enter the store.”,
}
];
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const locations = [
{
name: "town square",
"button text": ["Go to store", "Go to cave", "Fight dragon"],
"button functions": [goStore, goCave, fightDragon],
text: "You are in the town square. You see a sign that says \"Store\"."
}
{
name: "store",
"button text": ["Buy 10 health (10 gold)", "Buy weapon (30 gold)", "Go to town square"],
"button funtions" [buyHealth, buyWeapon, goTown],
text: "You enter the store.",
}
];
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 59