#--------------input-------------#
def getmove():
global room,posx,posy,moves,dead,inventory,foods,drinks,food,water
move=input()
if move == 'e':
posx=posx+1
if move == 'w':
posx=posx-1
if move == 's':
posy=posy+1
if move == 'n':
posy=posy-1
if 'grab' in move:
additem(move,inventory)
if move == 'inventory':
print(inventory)
if move == 'save':
moves-=1
food+=1
water+=1
save(posx,posy,moves,dead,food,water)
if move == 'load_save':
moves-=1
food+=1
water+=1
load_save()
if move == 'search':
search(inventory)
if move == 'eat':
food+=4
eat()
if move == 'drink':
water+=4
drink()
if food <= 2:
print('You start to feel hungry')
if water <=2:
print('You start to feel thirsty')
if food == 0 or water == 0:
dead = True
seeifdead(room,posx,posy,moves,dead,inventory,foods,drinks)
moves+=1
food-=1
water-=1
else:
print('I dont understand')
moves-=1
food+=1
water+=1
#print(posx,posy,moves,dead)
getroom(posx,posy,moves,dead,room)
#print(posx,posy,moves,dead)
getmove()
I wrote a python program back in college for a basic game and it was working but now a few years later it stopped working and I don't see any issues in it
when I run the program it complains about invalid syntax on the else statement but I don't see anything wrong with it but then again I've had an almost two-year break from programming, in general. Can someone please help me understand what I did wrong?
Also if needed I can add the whole program this is just the part for input
thank you so much in advance :)
Aucun commentaire:
Enregistrer un commentaire