Choices and Conditionals
This week, we’ll be adding several game-like features into our Twine skillset. During class, I will walk through the making of a game-like Twine starter file. After the demo, you will have time to convert this starter file into your own game. Try to change each of the following elements of the code, and expand on the choices available:
- Edit the startup tagged passage. This passage contains the starting values of all the “stats,” or attributes we’ve assigned to the player. You can generate these randomly, as in the demo, or let the player choose. Think creatively about what you want to track - this is a way to build long-term consequences for player choices.
- Edit the header tagged passage. This passage will display the stats, name, inventory, and anything else you want visible to the player throughout. It will appear at the top of every passage by default.
- Edit the begin passage. Currently, this allows the player to input a name for their character. You can use a similar structure for anything you’d like to make dependent on player input.
- Edit the decision logic. The sample includes several examples of stat-limited choices and consequences: these lead to some dead ends, and branch in lots of directions right now. Take this beginning and think about how you might represent meaningful choices.
This week, make sure to export your own .html file and upload it to the Moodle to receive full credit for the in-class exercise!