Exemplo n.º 1
0
 def __init__(self, pos, sheet, frame_width):
     SimpleSprite.__init__(self, pos, sheet)
     self._sheet_width = self._width
     self._sheet = self.image
     self._frame = 0
     self._frame_width = frame_width
     self._width = self._frame_width
     self._update_image()
     self.rect = pygame.Rect(0, 0, self._width, self._height)
     self._num_frames = self._sheet_width // self._frame_width
Exemplo n.º 2
0
 def __init__(self, pos, sprite_sheet=None, frame_width=None):
     SimpleSprite.__init__(self, pos)
     self._frame = 0
     if sprite_sheet:
         self.set_sprite_sheet(sprite_sheet, frame_width=frame_width)