Skip to content

ts-cset/dom-adventure-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DOM Adventure Game

Starter code for a text-based adventure game in the browser. Follow the project instructions to create your fork and build your own!

Setup

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.

  1. Click the Fork button in the top right to make your own copy of the repository.
  2. On your own repo, click the green Code button and copy the repo's git URL. It should have your GitHub username in it.
  3. Open your terminal and navigate to your folder for projects: cd ~/code
  4. Use git to download your repo using the copied URL: git clone <URL>

To submit the project:

  1. As you are working, use the Edit-Add-Commit workflow to track your changes with git.
  2. When you are done, you can push all the commits to GitHub at once with the git push command.

Requirements

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.

Grading

  • 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.

About

Starter code for a text-based adventure game project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published