2015-01-04 5 views
-1
input("If you wish to play Twin Clocks(Temporary Name)Beta, please enter start. " 
     "Developers note: This is total I would say took about 9 hours. Please play through this multiple times if you would like to see everything the game has to offer. This short python-based game is made by Zombiex100 ") 

if "start" == input(): 
    print("You have decided today would be a good day to actually do something with your old best friend, who happens to be your twin, rather than play python-based text adventure games. Where do you choose to hang out?") 
    input("Type m once to go to the movies") 
    input("Type ic once for two lines to go for some ice cream") 
    input("Type r once for six line if you want to go on long walks on the beach") 
    input("Type p once for six line if you want to visit the park") 
#Was stuck on these first lines of code for at least four hours in total. What mostly got me was having the program react to the user typing in "start" 
#I am also trying to figure out the problem why you have to write certain letter (ic,r, etc.) in order for the text to pop up 
if "m" == input(): 
    print("You remember seeing a interesting movie by the name of Antler Hooves on a ad on TV. It fits you and your twin perfectly since you're very silly.") 
    print("You call her and catch up since you haven't seen her in a couple months since you've been busy studying to become a camera-man and she has been equally busy trying to become an artist.") 
    print("She is surprised by your choice of movie, and tell you about a new indie sc-fi movie, The Alien Among Us, exclusive to a certain branch of movie theaters. You look it up and decide it would be a better choice.You buy the tickets and go to meet her at the theater.") 
    print("Once you arrive at the theater, you are confused why you ever stopped talking. You enter the theater.") 
    print("You eventually finish the two hour movie and decide to go get some food; specifically Mr.Froze, an ice cream parlor; being as childish as you are.") 
    print("You cross the street to get to the ice cream parlor, but before you could finish crossing, a car comes by. You exclaim that he was insane and that you are saddened by the face you didn't catch his license plate. You then look down adn see your twins corpse.") 
    print("Terror and hatred fills your bones as people rush out of there cars coming to you and calling 911. You feel empty inside, and then feel a surge of energy go through your body.") 
#Each time a run is finished, the game is supposed to loop and give you different options. I have decided to do that later on and finish all point now. 
if "ic" == input(): 
    print("You remember that one ice cream parlor named Mr.Froze you went with your twin when you were in elementary school. You decide it would be nice to go back there with your twin, maybe even revive your friendship, considering that she has many things common with you, I mean, she IS your twin after all.") 
    print("You call your twin and she is a bit surprised you remember Mr.Froze. She agrees to go and tell you to go ahead. ") 
    print("You walk in Mr.Froze and you have a couple options of what ice cream you would like to buy") 
    input("Type v if you would like to order a cone of vanilla") 
    input("Type c once for two lines if you would like to order a cone of chocolate") 
    input("Type vc once for three lines if you would like a twist vanilla/chocolate cone") 

if "v" == input(): 
    print("You decide to get yourself a plain vanilla cone, just like your personality. You also buy cotton candy ice cream for your twin, Ellie.") 
    print("You see her come in and you tell her you've already paid. You sit down and catch up on things, ask how studying is. She says that she wants to study abroad in Norway.") 
    print("Your conversation is cut short when a man in a mask walks in. You start whispering to Ellie until the man pulls out a gun and point it at Ellie") 
    print("Terror and fear engulfs your emotions as you hear him yelling for the money, but you can't help but laugh at him robbing a ice cream parlor. The man telling you to shut the fuck up or she gets a bullet. You quickly quiet down. As it turns out the cashier has major anxiety and is unable to get the money to give over. The man proceeds to shoot Ellie in the head.") 
    print("Terror and hatred fills your bones as you look at her dead corpse and the man points the gun at you. Before he manges to put a bullet directly through your brain, you feel a surge of energy go through your body") 

if "c" == input(): 
    print("You decide on chocolate, a beautiful flavor form the majestic coco beans. You also buy your twins favorite ice cream favor, strawberry.") 
    print("You see her come in and you tell her you've already paid. You sit down and catch up on things, ask how studying is. She says that she wants to study abroad in Norway. She then says she was actually thinking of coming over this Christmas, and decides it was worth giving you your present early. You look shocked at the beautifully drawn picture of you.") 
    print("While you look at the drawing, a strange man with a hokey mask walks in the door. You start whispering to Ellie about him until,") 
    print("He pulls out a small pistol on the cashier. The cashier panics and throws something at him, you couldn't quite see it as you were also panicking, but it seems the man pulled the trigger a second after getting hit, landing the bullet into your twins brain.") 
    print("Terror and hatred fills your bones as you look at her dead corpse. You were about to grab your chair and beat the man on the ground to death, but before you could, you feet a surge of energy go through your body.") 

if "vc" == input(): 
    print("You decide on the most glorious, intelligent choice of them all; a twist cone.You wait for your sister to come so she may buy her ice cream and sit down.") 
    print("Your sister finally comes. You tell her to go get her ice cream and that you'll wait at the small table. She looked a little disappointed but you don't know why") 
    print("While she is buying her ice cream; you notice a strange man walk in. You ignore it and continue waiting and eating your delicious ice cream.") 
    print("The strange man comes behind Ellie, but you think nothing of it.") 
    print("The man then gets Ellie in a choking position, demanding money from the cashier. You panic and run into the man, causing him to pull the trigger") 
    print("Terror and hatred fills your bones as you look at her dead corpse. The man gets back up and point the gun at you with the trigger ready to be pulled, but before he can you feel what can be best described as a surge of a energy going through your body.") 

if "r" == input(): 
    print("This isn't a dating website idiot! Plus, she's your twin! Go pick something else you pervert, you knew full well what you picked and why.") 

if "p" == input(): 
    print("You call up your sister and tell her about all these internet people telling you to go outside and get a life. You tell her about remembering being best friend and you now want to meet up at the park, because if you remembered correctly, your twin had a dog. She responds she has a corgi, and that she's glad you contacted her after a year. She will meet you at the park, and you get ready to go outside") 
    print("You arrive at the park a little overly prepared. You have drinks, snacks, your 3ND, PPD, and even a tent! Your sister arrives and starts laughing immediately when she sees you and your humongous book bag, as you start to rethink this real life thing.") 
    print("You play with her dog while catching up, even hearing that her boyfriend was suspicious of me until she told him that you were her twin. She tells you how he would like to meet you. You aren't too sure, but say you would think about it.") 
    print(" While you were talking, your twins corgi manged to escape and run across the street. You and her panicking a little, she runs across the street to get to him.") 
    print(" But she doesn't make it to the other side. She gets hit by an oncoming car as you watch her corgi running away. Hatred and terror fills your bones as you look at her dead corpse. You start running for the driver who seems pretty scared and is calling 911, but before you could, you feel energy going through your body") 

Если вы читаете, вы можете увидеть, что я сказал какое-то письмо, которое вы должны ввести их несколько раз для приглашения появляться. Есть ли способ сделать их всех так, что вы должны только поставить письмо в один раз?Несколько букв требуется для ввода

ответ

1

Каждый раз, когда у вас есть input() в вашем случае, он вызывает его снова (поэтому игрок должен ввести его шесть раз, потому что блоки, которые обрабатывают «r» и «p», находятся внизу). Вместо этого, сохранить результат input() переменной,

inR = input 

, а затем проверить, соответствует ли это:

if inR == "a": 
    #some code here 
elif inR == "ic": 
    #some other code here 
+0

Когда я запускаю его я получаю «процесс закончил с кодом выхода 0». Что об этом? – Brian

+0

Я получил его, чтобы начать ввод, но после набора номера после ввода начала я получаю код выхода. Помогите? – Brian

+0

Если это ваш * весь * скрипт, то после того, как 'input()' вызывается в первый раз, он не будет вызываться снова. Вы должны поместить свой код в какой-то цикл, чтобы он всегда возвращался к вызову 'input()' и обрабатывал результаты после того, как пользователь набрал что-то в первый раз. – SoItBegins

Смежные вопросы