def __init__(self, x, y): pygame.sprite.Sprite.__init__(self) ss = Spritesheet(bullet_image) self. bullets = ss.images_at([\ (19,336,10,14), (32,340,14,10),\ (48,339,14,11),(65,338,14,12)], -1) self.idx = 0 self.image = self.bullets[self.idx] self.last_idx = len(self.bullets) - 1 self.rect = self.image.get_rect() self.rect.center = (x, y) self.speed = 4 self.frames_count = 0 self.animate_each_frame = 10
def __init__(self, x, y): pygame.sprite.Sprite.__init__(self) ss = Spritesheet(bullet_image) self.bullet_images = ss.images_at([\ (275, 69, 20, 10)\ ], -1) self.bullets = [] for bullet in self.bullet_images: self.bullets.append(pygame.transform.rotate(bullet, 90)) self.idx = 0 self.image = self.bullets[self.idx] self.last_idx = len(self.bullets) - 1 self.rect = self.image.get_rect() self.rect.midbottom = (x, y) self.speed = 4 self.frames_count = 0 self.animate_each_frame = 10
def __init__(self, x, y): pygame.sprite.Sprite.__init__(self) ss = Spritesheet(shoot_image) self.bullets = ss.images_at([\ (107, 272, 14, 14), \ (126, 272, 15, 14), \ (145, 273, 15, 13), \ (165, 271, 14, 15), \ (184, 272, 14, 14), \ (201, 273, 16 ,14), \ (221, 273, 15, 13), \ (240, 271, 14, 15), \ ], -1) self.image = self.bullets[0] self.idx = 0 self.rect = self.image.get_rect() self.rect.center = (x, y) self.speed = 5 self.frames_count = 0 self.animate_each_frame = 10
def test_multi(self): ss = Spritesheet(self.TILES) [wall, floor] = ss.images_at([self.WALL, self.FLOOR])
def __init__(self): pygame.sprite.Sprite.__init__(self) ss = Spritesheet(bullet_image) self.bull = ss.images_at([\ (211,71,11,8),(229,70,16,9), \ (250,70,18,9),(275,70,20,10)], -1)