我目前正在编写一个基于文本的游戏,您可以通过该游戏来决定故事的路径。我在分配字母A时遇到问题,以便在按下时会出现下一段/文字。目前这是我所拥有的,但如果有更好的方法,我很想知道。
A =input("Click A to move on")
if A == "a":
print(" When you wake up, the sun is up and the birds are singing. Your musles scream out in pain as you slowly stand up and survey your surroundings.")
import time
time.sleep(3)
B =input("Click B to move on")
if B == "B":
print (" The clearing is small, surrounding by towering trees and bathed in warm light. The ground is littled with orange-golden leafs. Something catches your eye and you bend to pick it up.")
import time
time.sleep(2)
print ("\n Its a small shiny silver locket which feels cold and damp in your hands.")