Starter code for a text-based adventure game in the browser. Follow the project instructions to create your fork and build your own!
When we first learned JavaScript, we made a text-based game to practice the basic building blocks of programming languages like loops, conditionals, and functions. But it could only be played on the command line. Let's update it with our new skills! We'll create a web-based interface and practice working with the DOM and Browser Events.
- Click the Fork button in the top right to make your own copy of the repository.
- On your own repo, click the green Code button and copy the repo's git URL. It should have your GitHub username in it.
- Open your terminal and navigate to your folder for projects:
cd ~/code
- Use git to download your repo using the copied URL:
git clone <URL>
To submit the project:
- As you are working, use the Edit-Add-Commit workflow to track your changes with git.
- When you are done, you can push all the commits to GitHub at once with the
git push
command.
Make sure you follow the original requirements for how the game functions. The JavaScript logic will be a bit different though.
- The entire game should take place in one web page. Instead of using links to navigate to different pages that could contain a scene, you'll use DOM methods to rebuild the one page as the user plays.
- You should use at least three different browser events. Here are some options:
- Clicking a button element to decide a direction
- Pressing a key to preform an action
- Submitting a form input to provide an answer
- Setting a timeout to create a countdown
- Only show one scene at a time. As the user gets to a new scene in the game, you should use DOM methods to remove the old scene description and show the next.
- 15 pts for following the requirements.
- 5 pts for a game that runs without errors.
- 5 pts for well commented code.
- 5 pts for following code style guidelines.