def __init__(self):
     explosion = pyglet.image.load('assets/weapons/fire-heavy-gun.png')
     explosion_seq = pyglet.image.ImageGrid(explosion, 1, 24)
     explosion_tex_seq = pyglet.image.TextureGrid(explosion_seq)
     self.animation = pyglet.image.Animation.from_image_sequence(
         explosion_tex_seq, .02, loop=False)
     # self.anim = sprite.Sprite(self.animation)
     self.anim = OnceAnimation(self.animation)
     self.anim.scale = 0.2
예제 #2
0
    def __init__(self):
        explosion = pyglet.image.load('assets/weapons/bullet-explosion.png')
        explosion_seq = pyglet.image.ImageGrid(explosion, 1, 20)
        explosion_tex_seq = pyglet.image.TextureGrid(explosion_seq)
        self.animation = pyglet.image.Animation.from_image_sequence(explosion_tex_seq, .05, loop=False)

        # self.anim = sprite.Sprite(self.animation)
        self.anim = OnceAnimation(self.animation)
        self.anim.image_anchor = (self.animation.get_max_width() / 2, self.animation.get_max_height() / 4)
        self.anim.scale = 0.5
예제 #3
0
    def __init__(self):
        self.animation = load_animation(self.src)
        self.animation.frames[-1].duration = None  # stop loop

        super(ExplosionTankAnimation, self).__init__(self.animation)

        self.anim = OnceAnimation(self.animation)
        self.anim.image_anchor = (self.animation.get_max_width() / 2,
                                  self.animation.get_max_height() / 4)
        self.anim.scale = 0.5
예제 #4
0
 def __init__(self, position=(0, 0), rotation=0):
     explosion = pyglet.image.load('assets/weapons/fire-small-gun.png')
     explosion_seq = pyglet.image.ImageGrid(explosion, 1, 3)
     explosion_tex_seq = pyglet.image.TextureGrid(explosion_seq)
     self.animation = pyglet.image.Animation.from_image_sequence(explosion_tex_seq, .02, loop=False)
     # self.anim = sprite.Sprite(self.animation)
     self.anim = OnceAnimation(self.animation)
     self.anim.scale = 0.2
     self.anim.position = position
     self.anim.rotation = rotation - 180
예제 #5
0
    def __init__(self):
        self.animation = load_animation(self.src)
        self.animation.frames[-1].duration = None  # stop loop

        super(explosionStandartBulletAnimation, self).__init__(self.animation)

        # self.anim = sprite.Sprite(self.animation)
        self.anim = OnceAnimation(self.animation)
        self.anim.image_anchor = (self.animation.get_max_width() / 2,
                                  self.animation.get_max_height() / 4)
        self.anim.scale = 0.2