2017-11-16 1 views
0
import time 
dead = False 

ally = input('Ally?: ') 
if ally == 'Yes': 
    ally = True 
else: 
    ally = False 

User = input('Name?: ') 

if not dead and ally: 
    print('Sara\'s hand slipped from yours as you came to a fork in the hallways.') 
    time.sleep(2) 
    print('') 
    print('"Quickly! Which road should we take? Right or Left?"') 
    pick = input('Which way?!: ') 
    if pick == 'Right' or pick == 'right': 
     print('') 
     print('"Ok, I trust you!"') 
     print('') 
     time.sleep(1) 
     print('She ran towards the right, only to be stopped by a mysterious figure.') 
     time.sleep(1) 
     print('.') 
     time.sleep(1) 
     print('.') 
     time.sleep(1) 
     print('"ɖɨɖ ʏօʊ ȶʀʏ ȶօ ɛֆƈǟքɛ ɦօռɛʏ?~ ȶֆӄ ȶֆӄ~ ȶɦǟȶ աǟֆռ\'ȶ ɨռ ȶɦɛ ƈօռȶʀǟƈȶ"') 
     time.sleep(1) 
     print('.') 
     time.sleep(1) 
     print('.') 
     time.sleep(0.5) 
     print('') 
     print('"' + User + '! It\'s the other way! I\'ll take care of this and be right back!"') 
     time.sleep(3) 
     print('"ʏօʊ ֆօռ օʄ ʄ*** ɨ աօʀӄɛɖ ȶօօ ɦǟʀɖ ʄօʀ ȶɦɨֆ. ʏօʊ ǟʀɛ ɖɛǟɖ ȶօ ʍɛ!"') 
     time.sleep(2) 
     print('Obeying her orders, you run as fast as your legs could take you.') 
     time.sleep(1) 
     print('Leaving her behind...') 
     time.sleep(3) 
     dead = False 
     ally = False 
    if pick == 'left' or pick == 'Left': 
     print('') 
     print('"Ok, I trust you!"') 
     print('') 
     time.sleep(2) 
     print('She walked ahead of you, towards the left where the lights flickered.') 
     time.sleep(2) 
     print('A figure came from the right side as her eyes widened.') 
     time.sleep(1) 
     print('') 
     print('"RUN AND FOLLOW ME"') 
     print('') 
     time.sleep(2) 
     print('You follow her lead into the darkness as you hear a chuckle which' 
       ' sends sparks down your spine, running out a door.') 
     dead = False 
     time.sleep(2) 
if not dead and not ally: 
    print('You leave the room from before, seeing a fork in the hallway.') 
    time.sleep(2) 
    print('Which direction do you take?') 
    pick = input('Which?: ') 
    if pick == 'Right' or pick == 'right': 
     print('You decide to take the right path, going down your merry way ' 
       'as you felt...') 
     time.sleep(2) 
     print('Cold?') 
     time.sleep(3) 
     print('A mysterious figure had appeared in front of you covered your nose and ' 
       'mouth with a cloth containing a sweet smelling liquid') 
     time.sleep(2) 
     print('Before you went to darkness, you heard them whisper faintly in your ear.') 
     time.sleep(0.9) 
     print('∑ЯЯ◊Я') 
     time.sleep(1) 
     print('∑ЯЯ◊Я') 
     time.sleep(1) 
     print('∑ЯЯ◊Я') 
     time.sleep(1) 
     print('∑ЯЯ◊Я') 
     time.sleep(1) 
     print('∑ЯЯ◊Я') 
     time.sleep(1) 
     print('ㄚ◊ㄩῳ∑Я∑и\'₮ㄅㄩㄕㄕ◊ㄅ∑∂₮◊レ∑∆√∑') 
     time.sleep(2) 
     print('ㄅサササ... モ∆レレ ∆ㄅレ∑∑ㄕ ∂∑∆Я ,' + User + 'ㄚ◊ㄩ ῳ∑Я∑и\'₮ ㄅㄩㄕㄕ◊ㄅ∑∂ ₮◊ ς◊㎡∑ ₮サⅰㄅ モ∆Я...') 
     time.sleep(5) 
     dead = True 
    if pick == 'left' or 'Left': 
     print('You chose the left path, leading to a door.') 
     time.sleep(2) 
     print('It was that easy?') 
     dead = False 
if not dead and ally: 
    print('You walk out the door, leading into reality once more.') 
    time.sleep(2) 
    print('Where was the girl from before?') 
    time.sleep(2) 
    print('Looking back, you see nothing behind you.') 
    time.sleep(2) 
    print('So... Was it all a dream??') 
    time.sleep(2) 
    print('Let\'s hope so.') 
    time.sleep(4) 
    print('END.') 
if not dead and not ally: 
    print('You walk out the door, leading into reality once more.') 
    time.sleep(2) 
    print('You had left her behind...') 
    time.sleep(2) 
    print('Looking back, you see nothing behind you.') 
    time.sleep(2) 
    print('So... Was it all a dream?') 
    time.sleep(2) 
    print('Let\'s hope so.') 
    time.sleep(2) 
    print('For both of your sakes...') 
    time.sleep(4) 
    print('END.') 
    time.sleep(4) 

이것이 작동하지 않는 이유를 정확히 이해하지 못합니다. 내가 동맹국을 가지고 있고 오른쪽으로 가면, 나를 혼란스럽게하는 동맹국없이 할 수있는 선택을하기로 결정한다. 내가 동맹국을 가지지 않고 다시 권리를 얻는다면, 그것은 똑같은 말도 안합니다. 내가 동맹국이없고 왼쪽으로 가면 작동합니다. 도와주세요.잘못된 선택을 계속 사용합니다.

+1

이 문제를 좁히고 문제에 대해 더 잘 설명해야 할 것 같습니다. 적어도 당신이 묻는 것을 말할 수는 없습니다. – Carcigenicate

답변

0

시간과 이야기를하면 게임 메커니즘 만 남아 있습니다.
아무 것도하지 않으므로 dead = Falsenot dead도 삭제했습니다 (이미 사용 중입니다). 상호 작용하는 하나 끝 장면 : 당신은 기본적으로 두 부분을 가지고

dead = False 

ally = input("Ally?: ") 
if ally == 'Yes': 
    ally = True 
else: 
    ally = False 

if ally: # first scene with ally 
    pick = input("Which way?: ") 
    if pick == 'Right' or pick == 'right': 
     ally = False 
    if pick == 'Left' or pick == 'left': 
     pass 

if not ally: # first scene without ally 
    pick = input("Which way?: ") 
    if pick == 'Right' or pick == 'right': 
     pass 
    if pick == 'Left' or pick == 'left': 
     pass 

if ally: # end scene with ally 
    print("Option with ally") ## temp statement 
    print('End') 

if not ally: # end scene without ally 
    print("Option without ally") ## temp statement 
    print('End') 

:
이 같은 코드 모양의 무언가를 만든다.
그러면 다음 옵션이 표시됩니다.
동맹국이 있고 오른쪽으로 가십시오 : 동맹국없이 끝내려면 이동하십시오.
동맹국이 있고 왼쪽으로 가십시오 : 동맹과 함께 끝 장면으로 이동하십시오.
당신은 동맹국이없고 오른쪽으로 가야합니다. 당신은 죽었고, 죽음의 최종 장면은 없습니다.
동맹국이없고 왼쪽으로 가십시오 : 동맹국없이 끝내려면 이동하십시오.

내가 작동하지 않는다고 생각할 때, 작동하지 않는 것은 확실하지만 내 생각에 게임 메커니즘에서 뭔가 있어야합니다. 아니면 잘못된 장소에 잘못된 텍스트를 넣을 수도 있습니다.
어쨌든 이것이 도움이되기를 바랍니다.
거의 잊어 버렸습니다 :
on line 94 if pick == 'Left' or 'left' : if pick == 'Left' or pick == 'left'이어야합니다.

+0

오! 나는 그것을 얻는다라고 생각한다. 그것을 시도하자. 그리고 그것이 효과가 있다면 나는 당신에게 감사 할 것이다! – Kandy

+0

잠깐, 오른쪽으로 가면 죽지 않아야합니다. – Kandy

+0

이야기 및 수면 명령을 모두 제거하려고 했습니까? 물론 백업을 유지하십시오. 이렇게하면 코드에서 어떤 일이 일어나고 있는지 명확하게 알 수 있습니다. – cbecker

관련 문제