Hi! I’m creating a sort of text adventure game where you can rob a museum with a fictional character. I’m having a little trouble with importing different files and calling functions
Here’s my code (Specifically main.py)
[python]
def main():
print(“Great! the guards left should we go in now”)
if stubborn:
print(“I don’t need to ask do I, we’re heading in anyways”)
else:
ans = input(“So, should we go inside?”)
if ans == “yes” or “Yes”:
print(“Yes! Alright, we’re heading in.”)
indecisive = False
assertive = False
elif ans == “no” or “No”:
print("Ahaha,too late my friend, i’m already walking in. ")
indecisive = False
assertive = True
else:
print(“Indecisive eh? I’ll keep that in mind”)
indecisive = True
assertive = False
main = 0
if main == 1:
main()
print(“Good evening ladies,gentlemen and all other configurations of being! I’m Alastor, the radio demon!”)
print(“I have called you here because of your impeccable skills as a thief”)
import choice
[/python]
And, here’s choice.py
[python]
main = 0
ans = input(“Will you join me?”)
if ans == “no”:
print(“Ahaha, this isn’t a choice my friend, I shall hold this over your head for later!”)
stubborn = True
else:
print(“Alright! Let’s get to work”)
stubborn = False
def breakin():
print()
print(“Ok! We’re here”)
br = input(“How will we get inside sneak in: bust in or wait!”)
if br == “sneak in”:
print (“You snuck in at night from the ceiling”)
elif br == “bust in”:
print(“I was hoping you’d say that lets go!”)
elif br == “wait”:
print(“you waited for the guards to leave”)
main = 1
def main():
print(“Great! the guards left should we go in now”)
if stubborn:
print(“I don’t need to ask do I, we’re heading in anyways”)
else:
ans = input(“So, should we go inside?”)
if ans == “yes” or “Yes”:
print(“Yes! Alright, we’re heading in.”)
indecisive = False
assertive = False
elif ans == “no” or “No”:
print("Ahaha,too late my friend, i’m already walking in. ")
indecisive = False
assertive = True
else:
print(“Indecisive eh? I’ll keep that in mind”)
incecisive = True
assertive = False
breakin()
import main
[/python]
That’s pretty much it.
Thanks!