コード例 #1
0
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)))
コード例 #2
0
 def move_right(self):
     self.press_add = add(self.press_add, (Player.AIRFRAME_MOVEUNIT, 0))
コード例 #3
0
 def move_down(self):
     self.press_add = add(self.press_add, (0, Player.AIRFRAME_MOVEUNIT))
コード例 #4
0
 def move_left(self):
     self.press_add = add(self.press_add, (-Player.AIRFRAME_MOVEUNIT, 0))
コード例 #5
0
 def move_up(self):
     self.press_add = add(self.press_add, (0, -Player.AIRFRAME_MOVEUNIT))