Tell us what’s happening:
Step 173
Looking at your “kill monster” object, “button functions” currently has three goTown variables. Replace the third one with easterEgg - this is how a player will access the hidden feature of the game. Do not change the “button text”.
With this, your RPG game is complete! You can now play around - can you defeat the dragon?
Your code so far
<!-- file: index.html -->
/* file: script.js */
// User Editable Region
{
name: "kill monster",
"button text": ["Go to town square", "Go to town square", "Go to town square"],
"button functions": [goTown, goTown, goTown],
text: 'The monster screams "Arg!" as it dies. You gain experience points and find gold.'
},
// User Editable Region
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 173