Hi I'm tyring to check for event in a function in a class I made the only problem is that I don't want to keep writing down each if and elif conditional over and over again for different conditions that I test against a list of rect coords. Is there anyway I could make it so I could just pass a bunch a parameters through list and test against that? How would I ? Heres the function .
Code:def check_mouse(self): for rect in self.text_pos_list: if rect.collidepoint(pygame.mouse.get_pos()): if rect == self.text_pos_list: return self.item elif rect == self.text_pos_list: return self.item elif rect == self.text_pos_list: return self.item else: return False