Exemplo n.º 1
0
 def __init__(self, game_over, *args, **kwargs):
     gui.Container.__init__(self, *args, **kwargs)
     self.add(game_over, 0, 0)
     if game_over.survived == WON:
         self.splash = imagecache.load_image("images/gameover_win.png",
                                             ["darken_center"])
     elif game_over.survived == LOST:
         self.splash = imagecache.load_image("images/gameover_lose.png",
                                             ["darken_center"])
     else:
         self.splash = imagecache.load_image("images/splash.png",
                                             ["darken_center"])
Exemplo n.º 2
0
 def __init__(self, tile_pos, gameboard):
     # load images
     self._image_left = imagecache.load_image(self.IMAGE_FILE)
     self._image_right = imagecache.load_image(self.IMAGE_FILE,
                                               ("right_facing", ))
     # Create the animal somewhere far off screen
     Sprite.__init__(self, self._image_left, (-1000, -1000))
     self.image_left = self._image_left.copy()
     self.image_right = self._image_right.copy()
     if hasattr(tile_pos, 'to_tile_tuple'):
         self.pos = tile_pos
     else:
         self.pos = Position(tile_pos[0], tile_pos[1], 0)
     self.equipment = []
     self.accoutrements = []
     self.abode = None
     self.facing = 'left'
     self.gameboard = gameboard
Exemplo n.º 3
0
    def __init__(self, image_name, tv, cost=None):
        self._font = pygame.font.SysFont('Vera', 20, bold=True)
        image = imagecache.load_image(image_name, ["sprite_cursor"])

        if cost is not None:
            image = self._apply_text(image, str(cost))

        # Create the sprite somewhere far off screen
        Sprite.__init__(self, image, (-1000, -1000))
        self._tv = tv
Exemplo n.º 4
0
 def _set_images(self):
     self.images = {
         'fixed': {
             'day': imagecache.load_image(self.IMAGE),
             'night': imagecache.load_image(self.IMAGE, ('night', )),
             'selected': imagecache.load_image(self.SELECTED_IMAGE),
         }
     }
     if self.BREAKABLE:
         self.images['broken'] = {
             'day': imagecache.load_image(self.IMAGE_BROKEN),
             'night': imagecache.load_image(self.IMAGE_BROKEN, ('night', )),
             'selected': imagecache.load_image(self.SELECTED_IMAGE_BROKEN),
         }
Exemplo n.º 5
0
 def images(self, eq_image_attr):
     eq_image_file = getattr(self, eq_image_attr, None)
     if not eq_image_file:
         return None
     eq_image_left = imagecache.load_image(eq_image_file)
     eq_image_right = imagecache.load_image(eq_image_file,
                                            ("right_facing", ))
     if eq_image_attr == "ANIMAL_IMAGE_FILE":
         # a bit hacky; eventually the chicken should have a stack of images and layering should take care of everything
         if self.UNDER_LIMB:
             wing_left = imagecache.load_image("sprites/wing.png")
             wing_right = imagecache.load_image("sprites/wing.png",
                                                ("right_facing", ))
             eq_image_left.blit(wing_left, (0, 0))
             eq_image_right.blit(wing_right, (0, 0))
         if self.UNDER_EYE:
             eye_left = imagecache.load_image("sprites/eye.png")
             eye_right = imagecache.load_image("sprites/eye.png",
                                               ("right_facing", ))
             eq_image_left.blit(eye_left, (0, 0))
             eq_image_right.blit(eye_right, (0, 0))
     return eq_image_left, eq_image_right, self.DRAW_LAYER
Exemplo n.º 6
0
class ChickenDeath(Animation):
    BLOOD_SPLAT = imagecache.load_image('sprites/fox_death.png')
    FEATHER_SPLAT = imagecache.load_image('sprites/chkn_death.png')
    SEQUENCE = [BLOOD_SPLAT, FEATHER_SPLAT, FEATHER_SPLAT]
Exemplo n.º 7
0
class FoxDeath(Animation):
    BLOOD_SPLAT = imagecache.load_image('sprites/fox_death.png')
    SEQUENCE = [BLOOD_SPLAT, BLOOD_SPLAT]
Exemplo n.º 8
0
class FenceExplosion(Animation):
    FLASH_1 = imagecache.load_image('sprites/boom1.png')
    FLASH_2 = imagecache.load_image('sprites/boom2.png')
    FLASH_3 = imagecache.load_image('sprites/boom3.png')
    FLASH_4 = imagecache.load_image('sprites/boom4.png')
    SEQUENCE = [FLASH_1, FLASH_2, FLASH_3, FLASH_4]
Exemplo n.º 9
0
class MuzzleFlash(WeaponAnimation):
    FLASH_LEFT = imagecache.load_image('sprites/muzzle_flash.png')
    FLASH_RIGHT = imagecache.load_image('sprites/muzzle_flash.png',
                                        ("right_facing", ))
    SEQUENCE_LEFT = [FLASH_LEFT, FLASH_LEFT]
    SEQUENCE_RIGHT = [FLASH_RIGHT, FLASH_RIGHT]
Exemplo n.º 10
0
 def paint(self, s):
     pygame.display.set_caption(constants.NAME)
     splash = imagecache.load_image("images/splash.png")
     pygame.display.get_surface().blit(splash, (0, 0))
     gui.Container.paint(self, s)
Exemplo n.º 11
0
 def __init__(self, tile_no, tile_name, image_name):
     self.tile_no = tile_no
     self.tile_name = tile_name
     self.day_image = imagecache.load_image(image_name)
     self.night_image = imagecache.load_image(image_name, ("night", ))
     vid.Tile.__init__(self, self.day_image)
Exemplo n.º 12
0
 def paint(self, s):
     pygame.display.set_caption('Instructions')
     splash = imagecache.load_image("images/splash.png", ["lighten_most"])
     pygame.display.get_surface().blit(splash, (0, 0))
     gui.Container.paint(self, s)
Exemplo n.º 13
0
"""Constant definitions for the icons we use"""

from pgu.gui import Image

import imagecache

KILLED_FOX = Image(imagecache.load_image('icons/killed_fox.png'))
CHKN_ICON = Image(imagecache.load_image('icons/chkn.png'))
EGG_ICON = Image(imagecache.load_image('icons/egg.png'))
WOOD_ICON = Image(imagecache.load_image('icons/wood.png'))
GROATS_ICON = Image(imagecache.load_image('icons/groats.png'))
EMPTY_NEST_ICON = Image(imagecache.load_image('sprites/nest.png'))
DAY_ICON = Image(imagecache.load_image('icons/sun.png'))


def animal_icon(animal):
    return Image(animal.image_left)


import eegg
if eegg.is_eggday():
    EGG_ICON = Image(imagecache.load_image('icons/easter_egg.png'))