Kann jemand erklären, warum das nicht läuft?Warum kann ich am Ende meines Programms keine Eingabe registrieren?
import time
Start up-Menü
print ("Before you start the game ensure that you are playing in fullscreen to enhance your gaming experience")
print("")
print ("")
time.sleep(1)
Dieses einfach das Menü starten
istprint ("Menu")
print ('Instructions: In this game you will be given a series of paths. Using your best judgment you will choose the best path by using the "1" or "2" number keys, followed by pressing the "enter" button')
print ('If the wrong path is selected, there will be consequences of either death, or a lower final score.')
print ('Death will end the game, and you will be forced to start from the beginning of the level.')
time.sleep(1)
print ('If you will like to restart, press "r"')
print ('If you will like to quit, press "q"')
print ('If you want to play level 1, press "1"')
print ('If you want to play level 2, press "2"')
print ('you cannot restart or quit at this time')
print ('')
print ('')
def levelselection():
level=""
while level != "1" and level != "2":
level = input("Please select a level to play: ")
return level
#This section below is what I have trouble with. It was working before I added "time sleep and after."
level = levelselection()
if level == "1":
print("Level 1 selected")
print ("You and your crew are pinned in the remains of a church on the top floor, along with wounded soldiers. Being fired at by German machine guns, matters will soon only get worse as you see German reinforcements on their way. Find a way to escape with your 9 man crew with minimal casualties.")
time.sleep(1)
print ("Do you;")
print ("1:Order your 6 healthy soldiers to provide cover fire while you try and find a way to escape")
time.sleep(1)
print ("2:Order 4 soldiers to provide cover fire, while the other two soldiers take care of the wounded and you try and find a way to escape")
def path1():
path ==""
while path !="1" and path!="2":
path = input("Select a path: ")
Das ist, was ich habe Probleme läuft. Es wird einfach nicht ausgeführt. Es gibt mir auch keine Fehlermeldung.
if path == 1:
print ("The crew provided the cover that was needed to protect you, and you were able to safely make it back with two possible options of escape. The wounded soldiers are starting to bleed out.")
Sie benötigen um dein Problem besser zu erklären. Und Ihr Titel scheint ein anderes Problem zu beschreiben als den Kern der Frage. – Carcigenicate