Mercurial > zrpn
changeset 91:c52441feb981
Fixed mergo problemo.
| author | Rene Dudfield <renesd@gmail.com> |
|---|---|
| date | Sun, 08 Jul 2012 15:07:07 +0200 |
| parents | 97996cdd1a53 |
| children | 3a4ca250ca2e |
| files | zrpn/display.py |
| diffstat | 1 files changed, 19 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/zrpn/display.py Sun Jul 08 15:04:20 2012 +0200 +++ b/zrpn/display.py Sun Jul 08 15:07:07 2012 +0200 @@ -6,13 +6,13 @@ import sgc.surface import sprites - - +from skelutil import data_dir class Display(object): def __init__(self): - pygame.display.init() + pygame.init() pygame.font.init() + self.screen = sgc.surface.Screen((800, 600)) self.screen.fill((0x33, 0x33, 0x33)) self.background = self.screen.copy() @@ -21,6 +21,20 @@ self.clock = pygame.time.Clock() self.sgc_rect=((720,0),(800,200)) + + + + self.zombie = pygame.mixer.Sound(data_dir("zombie.ogg")) + self.robot = pygame.mixer.Sound(data_dir("robot.ogg")) + self.pirate = pygame.mixer.Sound(data_dir("pirate.ogg")) + self.ninja = pygame.mixer.Sound(data_dir("ninja.ogg")) + self.skeleton = pygame.mixer.Sound(data_dir("ninja.ogg")) + + + self.sound_types = dict(enumerate([None, self.ninja, self.pirate, self.robot, self.skeleton, self.zombie])) + + + def load_board(self, board, board_ids): for y, line in enumerate(board): for x, cell in enumerate(line): @@ -42,6 +56,8 @@ else: if kind == 'die': sprite.die(turn) + if sprite.kind in self.sound_types: + self.sound_types[sprite.kind].play() elif kind == 'fall': sprite.fall(turn)
