Hi, and thanks in advance
I’m trying to make a game with choices and if you make the wrong choice you should be sent back to try again, the text is all ok but function is not repeatable or i cant make it so you can choose again
This is how it looks
def start():
print(‘There are 4 possible ways out\n You can walk through the front door wich is in front of you “w”\n jump out the left window “a”\n jump out the right window “d”\n lay “back” on the bed “s”’)
i=input(‘You should move or choose with “w,a,s,d” type here–>’)
if " " in i:
print(‘no spacebar is required’)
elif “right” in i:
print(‘typing is not necesary’)
elif “left” in i:
print(‘typing is not necesary’)
elif “forward” in i:
print(‘typing is not necesary’)
elif “back” in i:
print(‘typing is not necesary’)
elif “w” in i:
print(‘You open the door just to be hit by an illusion of a dark dungeon, there is no sunshine anymore only torches…\n you should make haste and find out what is happening’)
elif “s” in i:
print(‘You take a good nap, you are well rested now…’)
repeat_function=start()
elif “a” in i:
print(‘you try to jump out the window, but somehow it doesn’t work, it’s like hitting a wall’)
returned_fuction = start()
elif “d” in i:
print(‘you try to jump out the window, but somehow it doesn’t work, it’s like hitting a wall’)
returned_fuction = start()
else:
print(‘Please move your character only using the “w”, “a”, “s”, “d”’)
returned_function = start()
Thanks a lot!