OKay so basically I am making a choose your own adventure story, Everytime I run the code no matter which choice you choose the program automatically pulls up the next part of the story, how do I make it so that it ends after you die or something in the story.
story = print ("It is summertime again. you go to your Aunt's house, He takes you on a tour around the city.\ He takes you to the most famous building in the city. He tells you that the building is haunted but\ you don't believe him.")
choice_1 = input("do you go inside or do you stay?") if choice_1 == "go inside": print (" You decide to go inside, your aunt says \"be careful\" You start to walk up the stone steps of the old haunted house.\ You open the door and step inside and suddenly a sharp arrow streaks accross the front of your face! But it misses you.")
choice_2 = input("Do you go up the staircase, into the kitchen, or do you run away?")
if choice_2 == "up the staircase":
print (" You compose yourself, and go up the staircase. as you begin to reach the top, the floor beneath you breaks open\
and you fall to your death") elif choice_2 == "into the kitchen": print (" You compose yourself, and decide to go through the kitchen. it is full of cobb webs and nothing else interesting.") elif choice_2 == "run away": print ("You decide not to go into the haunted house and get ice cream with your Aunt.") else: print ("Invalid Input")
choice_3 = input("you see two doors in front of you one is labeled \"1\" the other is labeled \"2\",\
which door do you choose? enter 1 or 2 ") if choice_3 == "1" : print ("You open the door on the left and walk inside. A strong gust of wind pushes you out of the window, \ and you fall into a bush.Scared out of your mind, you meet your aunt and drive away and get ice cream") elif choice_3== "2": print ("you continue into the door on the right, and there is a strange coffin in the back of the room.\ the coffin opens up and a vampire pops out. Your mind goes blank and you wake up in your bed safely at home.\ You're aunt takes you to the ice cream and say's you can have as many scoops as you would like")
choice_4 = int(input("How many scoops do you get?"))
if choice_4 < 4 and choice_4 > 0:
print ("you enjoy your ice cream, forget about what happened, and never go into another abandoned house again")
elif choice_4 == 0:
print ("you decide that you do not like ice cream anymore, and you try to forget about what happened,\
but you slowely go insane from the events you experienced") else: print (" you eat too much ice cream and throw up ")
elif choice_1 == ("stay"): print ("You decide not to go into the haunted house and get ice cream with your Aunt.") else: print ("Invalid Input")
Aucun commentaire:
Enregistrer un commentaire