We should remove all onclicks and just use addEventListener and removeEventListener.
Campers will have learned how to work with these methods in lecture videos, a smaller workshop and a lab before this role playing game workshop.
Lastly, we need to update the placement for these variable declarations.
Right now all of the variables are declared at the top.
But there are some variables that aren't used until several lines of code later like the fighting variable.
So move the variable declarations, when appropriate, closer to where they will be used
Acceptance criteria
[ ] create a new folder called role-playing-game in the frontend-cert/js-projects directory
[ ] add your completed project in the index.html, styles.css and script.js files in that new folder
[ ] remove the easter egg stuff
[ ] remove all onclicks and replace with addEventListener and removeEventListener
[ ] move variable declarations, when appropriate, closer to where they will be used
This project will be in the events and DOM module. So campers will have already learned the core fundamentals in smaller projects before this.
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-173
But the role playing game has to much going on. There are currently 173 steps which is to many. This needs to be cut down.
We should remove all of the easter eggs stuff here because there will already be a smaller guessing game project.
We are also using inline handlers, but we should remove those. Here are some examples
We should remove all onclicks and just use addEventListener and removeEventListener. Campers will have learned how to work with these methods in lecture videos, a smaller workshop and a lab before this role playing game workshop.
Lastly, we need to update the placement for these variable declarations. Right now all of the variables are declared at the top. But there are some variables that aren't used until several lines of code later like the
fighting
variable. So move the variable declarations, when appropriate, closer to where they will be usedAcceptance criteria
role-playing-game
in thefrontend-cert/js-projects
directoryindex.html
,styles.css
andscript.js
files in that new folder