Skip to content

stephig85/js_adventure

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Choose Your Own Adventure!

Rules

  • Goal: Using what you know about data types, variables, operators, conditional blocks, and accepting user input, create a text-based game that allows the user to arrive at different "destinations" based on the inputs they type
  • Any path the user goes down must ask them at least 3 questions (there can be more!) before they arrive at the destination
  • There must be a minimum of 7 total destinations the user could arrive at based on their responses (there can be more!)
  • For at least 3 (there can be more!) of the questions asked, there must be more than 2 possible user responses
  • At least 1 (there can be more!) of the questions must accept a range of number values, for example any number between 1-100, etc.

Hint: To help visualize your adventure game, draw out a flow chart of all the possible scenarios, like so: Flow Chart Example

Tools

  • Write in Javascript.
  • Use the prompt() function to accept user input:
name = prompt("What is your name?");
  • You may want to use repl.it to write your code! However, you'll want to copy/paste/submit your code in the adventure.js file.

Game Ideas

  • A Lord of the Rings style adventure where the player is Frodo, and he must choose how to get to Mordor. Possible obstacles involve Orcs, goblins, and getting drunk on mead.
  • A "Top Chef" style cooking adventure where the player is the chef, trying to make dinner for an elite group of judges. Possible obstacles include overcooking the meal, running out of time, or the judges being jerks.
  • A Harry Potter themed adventure, where the user is Harry trying to find all the horcruxes. Possible obstacles include Voldemort killing people, Professor Snape being a jerk, or Ron not knowing how to do anything.

Example (pseudocode)

  • What is your name?
    • Marty
  • Nice to meet you, Marty. What year would you like to go to? (YYYY)
    • >= 2015
      • I see you're a fan of Back to the Future 2. Would you rather deal with Biff, or Griff? (B/G)
        • Biff
          • Hmm, interesting. Biff is angry and has a cane. Do you stand and fight, or run away like a coward? (S/R)
            • Stand and fight
              • Good choice. Biff is old and feeble at this point. You push him over and he falls in a pile of manure.
            • Run like a coward
              • You get away, but your future son Marty Jr. is heckled for the rest of his days for his dad's cowardice.
        • Griff
          • Griff is asking you if you are in, or out. What do you say? (I/O)
            • In
              • Bad call. Griff and his cronies rob the Hill Valley bank and frame you for it. No more time travel for you.
            • Out
              • Good call. You deck Griff in the jaw and run away. He gives chase on his hoverboard and ends up in a pile of manure.
    • 1985-2014
      • Doc has already destroyed the Time Machine at this point. I guess you'll have to wait around until 2015. What name would you like to go by until then?
        • Calvin Klein
          • Welcome to the future, Calvin Klein.
    • 1955-1984
      • I see you're a fan of Back to the Future 1. Your future Mom has just asked you to the Enchantment Under the Sea dance. What do you do? (Y/N/S)
        • Yes
          • Creepy. I hope you have some backup plan in place to get out of this. Until then, you're stuck in 1955.
        • No
          • Honorable. But this also means that your future Dad will never meet your Mom, and therefore you cannot exist.
        • Set her up with George
          • Interesting. You set up an elaborate plan for your future Dad to surprise your Mom by beating you up. Despite going horribly awry, the plan ultimately works. You may go back to your own time.
    • < 1955
      • I see you're a fan of Back to the Future 3. You've run out of nitroglycerin to get back to your own time. How do you power the Time Machine? (H/M/T)
        • Horses
          • Good idea, but no. The time machine needs to get to 88mph. 12 horsepower ain't gonna cut it.
        • Moonshine
          • You'd be better off drinking the moonshine. Do not pass Go, do not collect $200. Stuck in 1855.
        • Train
          • Good call! This plan seems to be working. But wait! Clara wants to go Back to the Future with you at the last moment. What do you do? (T/L)
            • Take her
              • Interesting choice. Unfortunately the Doc can't grab Clara and get back to the car in time. He ends up staying in 1855 with her.
            • Leave her
              • Smart choice. Unfortunately the Doc was deeply in love with Clara, and when he gets back to 1985 he becomes very depressed.

Licensing

All content is licensed under a CC­BY­NC­SA 4.0 license. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.

About

Going on a trip, on an "if" and "if else" trip! -- GA Assignment for conditionals.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published