Learn Basic JavaScript by Building a Role Playing Game - Step 134

Tell us what’s happening:

It keeps telling me to add three goTown variables to “button functions” in the fifth element, when they’re clearly there. I tried adding parenthesis, as if logging the function(goTown()), but then it claims the entire element is missing. I’m at loss for what to do <:/

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 functions": [buyHealth, buyWeapon, goTown],
    text: "You enter the store."
  },
  {
    name: "cave",
    "button text": ["Fight slime", "Fight fanged beast", "Go to town square"],
    "button functions": [fightSlime, fightBeast, goTown],
    text: "You enter the cave. You see some monsters."
  },
  {
    name: "fight",
    "button text": ["Attack", "Dodge", "Run"],
    "button functions": [attack, dodge, goTown],
    text: "You are fighting a monster."
  },
  {
    name: "kill monster",
    "button text": ["Go to town square", "Go to town square", "Go to town square"],
    "button funtions": [goTown, goTown, goTown],
    text: "The monster screams Arg! as it dies. You gain experience points and find gold."
  }
];

// 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/127.0.0.0 Safari/537.36

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 134

Here is the hint message:

Your fifth locations value should have a "button functions" array with three goTown variables.

check if it exists or you have a typo.

I’ve checked several times and also reset the lesson several times, and I don’t seem to be able to find any typos or misspellings.

Here is the typo in your functions word.

1 Like

I don’t know how I kept missing that, thank you so much!

1 Like