Guest User

Untitled

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