Project: Choose Your Own Adventure
Remember the Choose Your Own Adventure books? You would read a page and then have to make a decision, and based on that decision you would flip to that page and see what happened. Every time you read the book, it could be a totally different story.
It might surprise you, but you have all the basic tools to build your own adventure game in code. I've got it started for you, so this project is to take my code and run as far as you can with it!
Setup
- Go to the repl.it page for our class and scroll down until you see the Projects section.
- Click the project title Choose Your Own Adventure and this will create a fork, your very own copy of my starter project.
- Click the Run button and play through the game a few times while reading the code. Try to follow along from function to function and see how the program works.
Instructions
Now it's your turn. Use this file to create your own game. You can use all of the starter code and add more scenes and decisions to it. Or you can change the starter code, or even delete it all, to do your own thing. Here's the requirements:
- All of the decision-making code is contained within functions.
- One function call at the very bottom of the program should start the game.
- You should have one function per "scene."
- You should jump from scene to scene by calling functions.
- The only code in global scope is variables for your functions, or other data you are tracking.
- You should have at least 8 scenes. The starter code has 5 already.
- You should create possibilities. The player shouldn't see every scene one after the other.
- You should show off what you've learned. Here's some ideas:
- Add in a loop for a guessing game
- Use some of those string or math methods
- Keep track of the player's name or health
- Or find a better way to check the user's input
Grading
- 10 pts for well commented code.
- 10 pts for following the requirements.
- 5 pts for a game that runs without errors.
- 5 pts for following code style guidelines.