Nov-16-2019, 02:30 AM
Ok, so I needed help with my game.
Here is the info. I'm running windows 8.1 pro and my python version is 3.7.5. I also use an IDE, I'm using Pycharm. Here is the code:




Here is the info. I'm running windows 8.1 pro and my python version is 3.7.5. I also use an IDE, I'm using Pycharm. Here is the code:
#start point name = input("hello, welcome to a game. what is your name") print ("ok, " + name + "lets go!") ophp = 20 uhp = 50 #the main game code while ophp or uhp > 0: thechoice = input("You meet ummmmm, a skeleton? 1 for Sword of Light, 2 for Empty Gun (from undertale), 3 The Really Good Steak") if thechoice: 1 ophp = -5 uhp = -2 print("you caused " + ophp + "damage and you took " + uhp + "damage.") print("\a") elif thechoice: 2 ophp = -10 uhp = -2 print("you caused " + ophp + "damage and you took " + uhp + "damage.") elif thechoice 3: print("\a") uhp = +5 print("you restored 5 hp!") else: print ("what?") if uhp >1: print("\a") print("you lost.") input("/n/nPress the enter key to exit, and well you got the bad ending, so yeah.") else: print("\a") print("You win!") input("/n/nPress the enter key to exit.")and here's the error.
Error:C:\Users\Etan\PycharmProjects\yayisgreathowmanyyaydoyouyay\venv\Scripts\python.exe C:/Users/Etan/.PyCharmCE2019.2/config/scratches/scratch.py
File "C:/Users/Etan/.PyCharmCE2019.2/config/scratches/scratch.py", line 14
elif thechoice: 2
^
SyntaxError: invalid syntax
Process finished with exit code 1
Do you have any idea to fix this error? And also fix any other bugs? Please no bullying or trolling! I just needed help!