This repo is a starter flask app for teaching purposes.
This particular variant was made to demonstrate how to use flask to build a Choose Your Own Adventure game.
For a more basic introduction, see Starter Flask App.
- If you haven't already, set up git.
- Click the green "Code" button in the top right corner of this page.
- Copy the URL in the dropdown.
- Open your terminal and navigate to the directory where you want to clone this repo.
- Run the following command:
git clone <URL>
-
If you don't already, install python and pip. If you're not sure if you have python installed, try running it locally in your command line with
python --version
. -
Navigate to the directory where you cloned this repo.
-
Run the following command to install the required packages:
pip install -r requirements.txt
-
Run the following command to start the flask app defined in the
app.py
file:flask run
-
Open your browser and navigate to http://127.0.0.1:5000 to see the app running locally.
- Write your own text adventure. Build each chapter as a route in the flask app.
- Include at lease one win condition.
- Include at least one failure condition.
- Include at least one loop.
Add an item, such as a key, that is required to be found and carried to a particular room to unlock the ending.
Some things you might investigate:
- Flask's
g
special object - Query parameters
- Sessions
Think about the pros and cons to the different approaches.