Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slots = [self.slot1,self.slot2,self.slot3,self.slot4,self.slot5,self.slot6,self.slot7,self.slot8,self.slot9]
- index = 0
- l.mpos = pygame.mouse.get_pos()
- for item in self.myitems:
- item.coor[0] = slots[index][0]
- item.coor[1] = slots[index][1]
- item.visible = True
- item.show()
- if item.rect.collidepoint(l.mpos) and l.mice[0]==1: # if item is clicked, use it and then destroy it
- item.use(self)
- item.destroy()
- l.draw_rect(item.rect)
- self.myitems.remove(item)
- if index < 8: # only show the 9 items that can be held
- index+=1
Add Comment
Please, Sign In to add comment