Guest User

Untitled

a guest
Jun 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. def show_items(self):
  2. slots =[self.slot1,self.slot2,self.slot3,self.slot4,self.slot5,self.slot6,self.slot7,self.slot8,self.slot9]
  3. index = 0
  4. must_die = None
  5.  
  6. for item in self.myitems:
  7. item.coor[0] = slots[index][0]
  8. item.coor[1] = slots[index][1]
  9. item.visible = True
  10. item.show()
  11.  
  12. if item.rect.collidepoint(l.mpos) and l.mice[0]==1: # if item is clicked, use it and then destroy it
  13. must_die = item
  14.  
  15. if index < 8: # only show the 9 items that can be held
  16. index+=1
  17.  
  18. if must_die!=None:
  19. item.use(self)
  20. item.destroy()
  21. l.draw_rect(item.rect)
  22. self.myitems.remove(item)
Add Comment
Please, Sign In to add comment