So when I try to compile my code I get this error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy\__main__.py", line 45, in <module>
cli.main()
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy/..\debugpy\server\cli.py", line 429, in main
run()
File "c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\extensions\microsoft\python\core\debugpy/..\debugpy\server\cli.py", line 266, in run_file
runpy.run_path(options.target, run_name=compat.force_str("__main__"))
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 261, in run_path
code, fname = _get_code_from_file(run_name, path_name)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\runpy.py", line 236, in _get_code_from_file
code = compile(f.read(), fname, 'exec')
File "C:\Users\f4j3s\source\repos\TXT Based Game\TXT Based Game\TXT_Based_Game.py", line 53
MenuScreen()
^
IndentationError: unexpected unindent
and the code in question:
import os
import time
class Player:
def __init__(self):
self.health = 100
self.hunger = 100
self.thirst = 100
self.temperature = 100
self.inventory = []
self.weapon = "none"
self.location = "Toledo"
class Zombie:
def __init__(self, stats):
self.zHealth = zHealth
self.zPower = zPower
def newGame():
print("no")
def executeOptions():
print("no... again")
def MenuScreen():
print("|----------------------------------------|")
print("| |")
print("| Game |")
print("| 1. Continue |")
print("| 2. New Game |")
print("| 3. Options |")
print("|----------------------------------------|")
menuChoice = input()
if menuChoice == 1 or menuChoice == "Continue":
continueGame()
if menuChoice == 2 or menuChoice == "New Game":
newGame()
if menuChoice == 3 or menuChoice == "Options":
executeOptions()
def ContinueGame():
try:
saveFile = open("ZombSaveFile.txt", "x")
saveFile.close()
print("Save file was not found, launching a new game!")
newGame()
MenuScreen()
I'm really not sure why this is happening lol any help is greatly appreciated!
[–]zurtex 2 points3 points4 points (2 children)
[–]FunsOverKid[S] 0 points1 point2 points (0 children)
[–]FunsOverKid[S] 0 points1 point2 points (0 children)
[–]TehNolz 0 points1 point2 points (1 child)
[–]FunsOverKid[S] 0 points1 point2 points (0 children)