I'm working on this text based game for a school project, please keep in mind i've only just recently started python so i might be making a lot of mistakes sorry. Basically in my game there's different events that happen at certain locations which are shown as co-ordinates like theres a NPC interaction at coords (4,5) for example. I've made the events that will happen in each coords but when i run my program they won't get shown on the screen? Here's one event:
def event_1():
global xpos, ypos
if xpos == 2 and ypos == 2 or 4:
typingPrint("""You've come across a bush of berries! They look safe enough..
Would you like to:
A- Eat one right now
B- Store it in your inventory for later
C- leave it as it is""")
event_1_choice = typingInput("<<< ")
if event_1_choice in answer_A:
typingPrint("You've eaten a berry and gained 20 HP!!")
elif event_1_choice in answer_B:
typingPrint("You've stored the berry for later use")
inventory.append("Berry")
elif event_1_choice in answer_C:
typingPrint("You decide to leave the berry as it is, better to be safe then sorry!!")
else:
print("Sorry? do you want the berries or not?")
return event_1()
event_1()
When I run this program, none of the above shows? it just prints out the coords your on and this function doesn't occur? I'm not sure what else to try to make it work, Thank you in advance. Hope it makes sense. (Also just to note, the answer_a, b, c are all created variables to store the users answer)