Esempio n. 1
0
    def __init__(self, batch, group, character, sprite_base):
        group = pyglet.graphics.OrderedGroup(10, group)

        self.character = character
        self.last_sprite_index = 0

        self.sprites = list()
        # 0-3 : left,right,top,bottom
        # 4-7 : walk; left,right,top,bottom
        # 8   : idle

        # stationary
        self.sprites.append(
            pyglet.sprite.Sprite(imagecache.get_sprite(sprite_base + '_left'),
                                 batch=batch,
                                 group=group))
        self.sprites.append(
            pyglet.sprite.Sprite(imagecache.get_sprite(sprite_base + '_right'),
                                 batch=batch,
                                 group=group))
        self.sprites.append(
            pyglet.sprite.Sprite(imagecache.get_sprite(sprite_base + '_top'),
                                 batch=batch,
                                 group=group))
        self.sprites.append(
            pyglet.sprite.Sprite(imagecache.get_sprite(sprite_base +
                                                       '_bottom'),
                                 batch=batch,
                                 group=group))

        # walk
        self.sprites.append(
            sprite.AnimatedSprite(imagecache.get_animation(sprite_base +
                                                           '_walk_left'),
                                  batch=batch,
                                  group=group))
        self.sprites.append(
            sprite.AnimatedSprite(imagecache.get_animation(sprite_base +
                                                           '_walk_right'),
                                  batch=batch,
                                  group=group))
        self.sprites.append(
            sprite.AnimatedSprite(imagecache.get_animation(sprite_base +
                                                           '_walk_top'),
                                  batch=batch,
                                  group=group))
        self.sprites.append(
            sprite.AnimatedSprite(imagecache.get_animation(sprite_base +
                                                           '_walk_bottom'),
                                  batch=batch,
                                  group=group))

        #idle
        self.sprites.append(
            sprite.AnimatedSprite(imagecache.get_animation(sprite_base +
                                                           '_idle'),
                                  batch=batch,
                                  group=group))
Esempio n. 2
0
    def __init__(self, batch, group, bomb):
        group = pyglet.graphics.OrderedGroup(20, group)
        self.bomb = bomb

        self.sprite = sprite.AnimatedSprite(imagecache.get_animation('bomb'),
                                            batch=batch,
                                            group=group)
        self.explosion = sprite.AnimatedSprite(
            imagecache.get_animation('bomb_explosion'),
            batch=batch,
            group=group)
Esempio n. 3
0
    def __init__(self, batch, group, spear):
        group = pyglet.graphics.OrderedGroup(20, group)
        self.spear = spear

        self.sprite = sprite.AnimatedSprite(imagecache.get_animation('spear'),
                                            batch=batch,
                                            group=group)
Esempio n. 4
0
 def __init__(self, batch, group, character):
     super(WarlordRenderable, self).__init__(batch, group, character)
     #charging (9)
     self.sprites.append(
         sprite.AnimatedSprite(imagecache.get_animation(self.sprite_name +
                                                        '_spin'),
                               batch=batch,
                               group=group))
Esempio n. 5
0
    def __init__(self, batch, group):
        self.sprite = pyglet.sprite.Sprite(imagecache.get_sprite('title'),
                                           batch=batch,
                                           group=pyglet.graphics.OrderedGroup(
                                               0, group))
        self.text = pyglet.text.Label("ENTER",
                                      batch=batch,
                                      group=pyglet.graphics.OrderedGroup(
                                          10, group),
                                      font_name="Courier New",
                                      color=(230, 169, 149, 255),
                                      font_size=36)

        self.fire = sprite.AnimatedSprite(
            imagecache.get_animation('girl_walk_right'),
            batch=batch,
            group=pyglet.graphics.OrderedGroup(10, group))