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)
我不完全理解为什么这不起作用。当我有一个Ally并向右移动时,它决定做一个没有让我困惑的盟友的选择。如果我没有Ally并再次采取正确的行动,它也会做同样的废话。 它只适用于我没有盟友并向左走,请帮忙吗?
答案 0 :(得分:0)
当你的时间和故事,只剩下游戏机制
我还删除了 dead = False
和 not 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')
你基本上有两个部分:交互式场景和结束场景。
这导致以下选项:
你有一个盟友并且向右走:没有盟友去结束场景。
你有一个盟友并且向左走:与盟友一起去结束场景。
你没有盟友并且向右走:你已经死了,没有死亡的终点。
你没有盟友并且向左走:没有盟友去结束场景。
我不确定你什么时候说它不起作用,什么不起作用,但我的猜测是它必须是游戏机制中的东西。或者你可能在错误的地方放错了文字。
无论如何,希望这会有所帮助。
差点忘了:
在第94行,您有 if pick == 'Left' or 'left'
,其应为: if pick == 'Left' or pick == 'left'
。