Text Adventure Game Design
A type of program where the player reads story text and types choices; built using print() for output, input() for choices, and if/elif/else for branching paths
Understanding Text Adventure Game Design in SC in Schools Python
What it does: Each if/elif branch sends the player down a different path depending on what they typed. while True: creates an infinite loop that keeps asking for input each turn of the game. print() outputs text to the screen. input() waits for the player to type something. input() pauses the game and returns whatever the player types as a string. Planning your rooms and branching paths before coding prevents logic errors and saves time. == is the comparison operator. A single = is assignment and will cause a syntax error in an if condition. input() captures the player's choice so it can be tested in an if/elif/else block.
Common mistakes: The branching logic needs an if statement, not print(). It should be: if choice == "run": with an indented block below. Line 2 is wrong. Python while loops do not have a closing whileEnd keyword. The loop body is defined by indentation alone. Line 3 is wrong.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 64–73) and word search (Modules 64–73).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
text adventureFill in the Blanks
Spot the Error
Student with a class code? Join your class →