'F' → Fullscreen
Create a new Python program named 1-12-dungeon-crawler. You'll build this story one branch at a time.
# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")if/elif/else for the left path, right path, and no-path-chosen case — using pass to leave each one empty for now.# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")
# Caves# Left -> Wolfpack# Right -> Dragon# Else -> No path chosenif path == "left": passelif path == "right": passelse: pass# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")
# Caves# Left -> Wolfpack# Right -> Dragon# Else -> No path chosenif path == "left": print("You cautiously take the left path.") print("A few steps in, you freeze as the piercing eyes of a pack of wolves emerge from the shadows.") print("The pack leader, larger and fiercer than the others, steps forward, growling softly...")
wolf_choice = input("Do you offer the pack leader your hand in peace? (yes or no) ->").lower()
if wolf_choice == "yes" and twinkies >= 1: print("As you reach out, the wolves smell the Twinkie...") print("In a frenzy of hunger, they turn on you, and you're surrounded with no escape!") elif wolf_choice == "yes": print("The pack leader sniffs your hand and accepts you into the fold.") print("You're given a small satchel of gold as a token of their trust.") print("You settle in with the wolves, awaiting dawn as the storm howls outside...") gold = gold + 5 wolfpack_ending = True else: print("Sensing your hesitation, the wolves close in, their teeth bared.") print("You feel their claws sink in, and everything goes black...")elif path == "right": passelse: pass# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")
# Caves# Left -> Wolfpack# Right -> Dragon# Else -> No path chosenif path == "left": print("You cautiously take the left path.") print("A few steps in, you freeze as the piercing eyes of a pack of wolves emerge from the shadows.") print("The pack leader, larger and fiercer than the others, steps forward, growling softly...")
wolf_choice = input("Do you offer the pack leader your hand in peace? (yes or no) ->").lower()
if wolf_choice == "yes" and twinkies >= 1: print("As you reach out, the wolves smell the Twinkie...") print("In a frenzy of hunger, they turn on you, and you're surrounded with no escape!") elif wolf_choice == "yes": print("The pack leader sniffs your hand and accepts you into the fold.") print("You're given a small satchel of gold as a token of their trust.") print("You settle in with the wolves, awaiting dawn as the storm howls outside...") gold = gold + 5 wolfpack_ending = True else: print("Sensing your hesitation, the wolves close in, their teeth bared.") print("You feel their claws sink in, and everything goes black...")elif path == "right": print("You take the right path, deeper into the damp, dark cave.") print("Suddenly, a rotten, smoky smell fills the air. A massive dragon with dull, greedy eyes looms in the shadows.") print("The dragon sniffs the air and sneers, 'Did you bring me something sweet?'")
dragon_choice = input("Do you offer him a treat? (yes or no) ->").lower()
if dragon_choice == "yes" and twinkies >= 1: print("The dragon's eyes widen as he devours the Twinkie. 'Delicious!' he roars.") print("In gratitude, he hands you a pile of gold coins.")
gold_choice = input("How much gold do you take? ->") gold_amount = int(gold_choice)
if gold_amount > 0 and gold_amount <= 100: print("The dragon grunts approval, allowing you to take the gold...") gold = gold + gold_amount elif gold_amount > 100: print("The dragon's eyes narrow, and he hisses, 'Greed will get you nothing.'") else: print("The dragon, impressed by your modesty, lets you take all the gold!") gold = gold + 100000
dragon_ending = True else: print("The dragon's face darkens, and he lunges towards you!") print("His jaws close around you as everything fades to black...")else: pass# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")
# Caves# Left -> Wolfpack# Right -> Dragon# Else -> No path chosenif path == "left": print("You cautiously take the left path.") print("A few steps in, you freeze as the piercing eyes of a pack of wolves emerge from the shadows.") print("The pack leader, larger and fiercer than the others, steps forward, growling softly...")
wolf_choice = input("Do you offer the pack leader your hand in peace? (yes or no) ->").lower()
if wolf_choice == "yes" and twinkies >= 1: print("As you reach out, the wolves smell the Twinkie...") print("In a frenzy of hunger, they turn on you, and you're surrounded with no escape!") elif wolf_choice == "yes": print("The pack leader sniffs your hand and accepts you into the fold.") print("You're given a small satchel of gold as a token of their trust.") print("You settle in with the wolves, awaiting dawn as the storm howls outside...") gold = gold + 5 wolfpack_ending = True else: print("Sensing your hesitation, the wolves close in, their teeth bared.") print("You feel their claws sink in, and everything goes black...")elif path == "right": print("You take the right path, deeper into the damp, dark cave.") print("Suddenly, a rotten, smoky smell fills the air. A massive dragon with dull, greedy eyes looms in the shadows.") print("The dragon sniffs the air and sneers, 'Did you bring me something sweet?'")
dragon_choice = input("Do you offer him a treat? (yes or no) ->").lower()
if dragon_choice == "yes" and twinkies >= 1: print("The dragon's eyes widen as he devours the Twinkie. 'Delicious!' he roars.") print("In gratitude, he hands you a pile of gold coins.")
gold_choice = input("How much gold do you take? ->") gold_amount = int(gold_choice)
if gold_amount > 0 and gold_amount <= 100: print("The dragon grunts approval, allowing you to take the gold...") gold = gold + gold_amount elif gold_amount > 100: print("The dragon's eyes narrow, and he hisses, 'Greed will get you nothing.'") else: print("The dragon, impressed by your modesty, lets you take all the gold!") gold = gold + 100000
dragon_ending = True else: print("The dragon's face darkens, and he lunges towards you!") print("His jaws close around you as everything fades to black...")else: print("You hesitate, feeling the storm grow stronger as lightning flashes around you.") print("Suddenly, a bolt strikes nearby, and you fall to the ground, darkness closing in.")True.# If the player beats one of the levels, set its boolean variable to Truewolfpack_ending = Falsedragon_ending = Falsegold = 0twinkies = 0
# Prologueprint("Your car crashes into a tree during a thunderstorm in the woods.")print("Darkness surrounds you as thunder crashes and rain pours.")print("You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.")print("Inside, you see two shadowy paths diverging deeper into the unknown...")
path = input("Which path do you take? (left or right) ->").lower()
if path == "left" or path == "right": print("As you move forward, you see something glimmering on the ground - a Hostess Twinkie.") print("Do you eat the Twinkie for sustenance, or will you save it for later?")
twinkie_choice = input("(take or eat) ->").lower()
if twinkie_choice == "take": print("You slip the Twinkie into your pocket, unsure what awaits in the darkness...") twinkies = twinkies + 1 elif twinkie_choice == "eat": print("Feeling uneasy, you eat the Twinkie to keep up your strength.") else: print("You leave the Twinkie untouched, feeling an ominous presence watching.")
# Caves# Left -> Wolfpack# Right -> Dragon# Else -> No path chosenif path == "left": print("You cautiously take the left path.") print("A few steps in, you freeze as the piercing eyes of a pack of wolves emerge from the shadows.") print("The pack leader, larger and fiercer than the others, steps forward, growling softly...")
wolf_choice = input("Do you offer the pack leader your hand in peace? (yes or no) ->").lower()
if wolf_choice == "yes" and twinkies >= 1: print("As you reach out, the wolves smell the Twinkie...") print("In a frenzy of hunger, they turn on you, and you're surrounded with no escape!") elif wolf_choice == "yes": print("The pack leader sniffs your hand and accepts you into the fold.") print("You're given a small satchel of gold as a token of their trust.") print("You settle in with the wolves, awaiting dawn as the storm howls outside...") gold = gold + 5 wolfpack_ending = True else: print("Sensing your hesitation, the wolves close in, their teeth bared.") print("You feel their claws sink in, and everything goes black...")elif path == "right": print("You take the right path, deeper into the damp, dark cave.") print("Suddenly, a rotten, smoky smell fills the air. A massive dragon with dull, greedy eyes looms in the shadows.") print("The dragon sniffs the air and sneers, 'Did you bring me something sweet?'")
dragon_choice = input("Do you offer him a treat? (yes or no) ->").lower()
if dragon_choice == "yes" and twinkies >= 1: print("The dragon's eyes widen as he devours the Twinkie. 'Delicious!' he roars.") print("In gratitude, he hands you a pile of gold coins.")
gold_choice = input("How much gold do you take? ->") gold_amount = int(gold_choice)
if gold_amount > 0 and gold_amount <= 100: print("The dragon grunts approval, allowing you to take the gold...") gold = gold + gold_amount elif gold_amount > 100: print("The dragon's eyes narrow, and he hisses, 'Greed will get you nothing.'") else: print("The dragon, impressed by your modesty, lets you take all the gold!") gold = gold + 100000
dragon_ending = True else: print("The dragon's face darkens, and he lunges towards you!") print("His jaws close around you as everything fades to black...")else: print("You hesitate, feeling the storm grow stronger as lightning flashes around you.") print("Suddenly, a bolt strikes nearby, and you fall to the ground, darkness closing in.")
# Epilogueprint("-- Ending --")
if wolfpack_ending: print("By cuddling with the wolfpack, you weather out the storm.") print("Upon leaving the cave, they follow you, seeing you as the new pack leader.") print("You survived!!!")elif dragon_ending: print("By tempting the dragon with a delicious Hostess snack cake, you avoid his wrath.") print("He flies you back home after the storm, but not after raiding the nearest Hostess factory.") print("You survived!!!")else: print("Game Over!")
if gold > 0: print(f"You not only survived, but you found {gold} gold!")Verify your program works correctly.
Your car crashes into a tree during a thunderstorm in the woods.Darkness surrounds you as thunder crashes and rain pours.You spot a cave nearby, dimly lit by flashes of lightning, and run towards it for shelter.Inside, you see two shadowy paths diverging deeper into the unknown...Which path do you take? (left or right) ->left [Enter]As you move forward, you see something glimmering on the ground - a Hostess Twinkie.Do you eat the Twinkie for sustenance, or will you save it for later?(take or eat) ->take [Enter]You slip the Twinkie into your pocket, unsure what awaits in the darkness...You cautiously take the left path.A few steps in, you freeze as the piercing eyes of a pack of wolves emerge from the shadows.The pack leader, larger and fiercer than the others, steps forward, growling softly...Do you offer the pack leader your hand in peace? (yes or no) ->yes [Enter]As you reach out, the wolves smell the Twinkie...In a frenzy of hunger, they turn on you, and you're surrounded with no escape!-- Ending --Game Over!Answer the following questions before submitting your work.
if statements?pass?Submit the required files to the appropriate dropbox.