def check_event(pos): item = "none" # ititiates item to none if pos[0] in range(160,211) and pos[1] in range(240, 256): print "Sink" item = "sink" elif pos[0] in range(395,500) and pos[1] in range(170, 381): print "Fridge" item = "fridge" elif pos[0] in range(444,497) and pos[1] in range(100, 166): print "Room Change" from __main__ import room_change new_room = 2 room_change(new_room) print "room changed" else: # if a non-identifyible object is clicked on this will erase the menu bar item = "none" pygame.draw.rect(screen,(0,0,0), (20,323,200,32)) pygame.display.update(20,323,200,32) if item != "none": text_to_screen(item)
def check_event(pos): item = "none" if pos[0] in range(349,391) and pos[1] in range(161, 205): print "Gatar" item = "gatar" elif pos[0] in range(0,56) and pos[1] in range(100, 166): # Move to LEft print "Room Change" new_room = 1 from __main__ import room_change room_change(1) elif pos[0] in range(444,497) and pos[1] in range(100, 166): # Room change to right print "Room Change" new_room = 3 from __main__ import room_change room_change(3) else: item = "none" pygame.draw.rect(screen,(0,0,0), (20,323,200,32)) pygame.display.update(20,323,200,32) if item != "none": text_to_screen(item)