Objective:
Create a text-based adventure game where the player finds themselves waking up in a dark, mysterious cave with two paths: left and right. The game will guide the player through a series of decisions, leading to different outcomes based on their choices. Use nested IF statements to create the branching logic of the story.
Instructions:
1. Starting Point:
Use prompt to display an introductory message explaining the scenario to the player: they have woken up in a dark cave with no memory of how they got there. They see two paths: one to the left and one to the right. Ask the player to choose a path by typing "left" or "right".
2. First Decision:
If the player chooses "left", use an IF statement to branch the story. Inside this IF block, use another IF statement to present a new scenario based on a secondary decision: they encounter a lake. Ask if they want to swim across or walk around it.
If they choose to swim, use alert to show the outcome (e.g., they find a hidden treasure in the middle of the lake).
If they choose to walk around, use alert to show a different outcome (e.g., they find an abandoned campsite with useful supplies).
If the player chooses "right", follow a similar structure for branching logic. Perhaps they find a tunnel. Ask if they want to explore the tunnel or continue on the path.
If they explore the tunnel, show one outcome (e.g., they discover a map of the cave).
If they continue on the path, show another outcome (e.g., they encounter a friendly hermit who offers guidance).
3. Conclusion:
Regardless of the paths and decisions, converge the story to a concluding scenario using IF statements. For example, after the series of decisions, they finally find the exit of the cave. Based on the decisions made earlier, determine if they exit the cave with treasure, useful supplies, a map, guidance from the hermit, or perhaps they find another traveler who joins them on their journey.
4. Final Message:
Use alert to summarize the player's adventure and outcomes based on their choices.
Objective: Create a text-based adventure game where the player finds themselves waking up in a dark, mysterious cave with two paths: left and right. The game will guide the player through a series of decisions, leading to different outcomes based on their choices. Use nested IF statements to create the branching logic of the story.
Instructions:
1. Starting Point: Use
prompt
to display an introductory message explaining the scenario to the player: they have woken up in a dark cave with no memory of how they got there. They see two paths: one to the left and one to the right. Ask the player to choose a path by typing "left" or "right".2. First Decision:
alert
to show the outcome (e.g., they find a hidden treasure in the middle of the lake).alert
to show a different outcome (e.g., they find an abandoned campsite with useful supplies).3. Conclusion: Regardless of the paths and decisions, converge the story to a concluding scenario using IF statements. For example, after the series of decisions, they finally find the exit of the cave. Based on the decisions made earlier, determine if they exit the cave with treasure, useful supplies, a map, guidance from the hermit, or perhaps they find another traveler who joins them on their journey.
4. Final Message: Use
alert
to summarize the player's adventure and outcomes based on their choices.Requirements:
prompt
for player inputs.alert
for story narration and outcomes.