def right_click(self, x, y, pressed): if self.timer == 0: self.timer = LAG_COUNTER self.timer-=1 if collide_point_square((x, y), self.rect.topleft, self.rect.bottomright): if pressed[0] and self.timer == 0 or pressed[2]: return (merge_dicts(self.exponent_data, self.linear_data)) return None
def carry(self, x, y, pressed): if collide_point_square((x, y), self.rect.topleft, self.rect.bottomright): if pressed and self.carried == 0 and Data_Type.grabbed == False: self.carried = 2 Data_Type.grabbed = True elif (pressed or Data_Type.grabbed == True) and self.carried != 2: self.carried = 1 if not pressed: Data_Type.grabbed = False self.carried = 0 if self.carried == 2: self.x = x self.y = y self.rect.center = self.x, self.y