def queue_shot(self, queue): pos_gun = 0 """Cantidad de balas que se disparan al mismo tiempo""" for i in range(queue): if queue > 1: if i == 0: pos_gun -= 10 elif i > 0: pos_gun += 20 self.point_ball = ((self.rect.centerx - pos_gun, self.rect.centery - pos_gun)) sound['shot'].stop() sound['shot'].play() self.effect.add( Effect(self.point_ball, self.angle, self.effect_frames, (16, 15), image['wave_shot'])) self.bullets.add( Bala(self.point_ball, self.angle, self.value, self.effect)) self.load = False self.cont = 0
def queue_shot(self, queue): pos_gun = 0 for i in range(queue): if queue > 1: if i == 0: pos_gun -= 10 elif i > 0: pos_gun += 20 self.point_ball = ((self.sprite.rect.centerx - pos_gun, self.sprite.rect.centery - pos_gun)) sound["shot"].stop() sound["shot"].play() self.game.effect.add( Effect(self.point_ball, self.sprite.angle, self.effect_frames, (16, 15), image["wave_shot"])) self.game.bullets.add( Bala(self.point_ball, self.sprite.angle, self.sprite.value, self.game)) self.load = False self.cont = 0
def explosion(self): frames = { 0: (0, 0), 1: (0, 14), 2: (0, 28), 3: (0, 42), } self.point_ball = ((self.rect.centerx, self.rect.centery)) effect = Effect(self.point_ball, self.angle, frames, (14, 14), image['explosion']) self.effect.add(effect) self.kill()