def rotate(screen, picture, rect, angle, x, y): "rotate picture with angle" rotated = pygame.transform.rotate(picture, angle) size = rotated.get_size() pos = (rect.x + rect.w / 2 - size[0] / 2, rect.y + rect.h / 2 - size[1] / 2) screen.blit(rotated, add(pos, (x, y)))
def move_right(self): self.press_add = add(self.press_add, (Player.AIRFRAME_MOVEUNIT, 0))
def move_down(self): self.press_add = add(self.press_add, (0, Player.AIRFRAME_MOVEUNIT))
def move_left(self): self.press_add = add(self.press_add, (-Player.AIRFRAME_MOVEUNIT, 0))
def move_up(self): self.press_add = add(self.press_add, (0, -Player.AIRFRAME_MOVEUNIT))