Mercurial > undermine
changeset 40:551728b62314
sounds
| author | Radomir Dopieralski <sheep-devel@sheep.art.pl> |
|---|---|
| date | Mon, 28 Apr 2014 09:36:00 +0200 |
| parents | 84e0cc11821a |
| children | f800d6554607 |
| files | undermine/bump.bfxrsound undermine/bump.wav undermine/fail.bfxrsound undermine/fail.wav undermine/game.py undermine/intro.py undermine/pickup.bfxrsound undermine/pickup.wav |
| diffstat | 8 files changed, 14 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/undermine/bump.bfxrsound Mon Apr 28 09:36:00 2014 +0200 @@ -0,0 +1,1 @@ +3,0.5,,0.055,0.7949,0.285,0.3,0.1152,,0.2313,,,,,,,,,,,,,0.6849,,,1,,,,,,,masterVolume \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/undermine/fail.bfxrsound Mon Apr 28 09:36:00 2014 +0200 @@ -0,0 +1,1 @@ +7.0233,0.5,0.2383,0.285,0.0771,0.3873,0.2797,0.2192,0.0799,0.2544,,0.2481,0.0701,0.1738,,0.021,-0.0018,,0.0346,0.0182,0.2763,0.0239,0.5824,-0.0304,-0.4499,0.9835,,0.0386,0.0362,0.0455,,0.1703,masterVolume \ No newline at end of file
--- a/undermine/game.py Mon Apr 28 09:18:04 2014 +0200 +++ b/undermine/game.py Mon Apr 28 09:36:00 2014 +0200 @@ -22,8 +22,9 @@ self.display = display self.clock = pygame.time.Clock() self.images = undermine.resources.load_atlas('undermine.png', 64) - # self.music = undermine.resources.load_sound('undermine.ogg') - # self.death_music = undermine.resources.load_sound('death.ogg') + self.bump = undermine.resources.load_sound('bump.wav') + self.pickup = undermine.resources.load_sound('pickup.wav') + self.fail = undermine.resources.load_sound('fail.wav') def next_level(self, data): self.display.sprites.empty() @@ -71,11 +72,10 @@ self.hero.animations.append(self.hero.win_anim()) def die(self): - # self.theme.stop() - # self.eulogy.play() self.level[self.hero.pos] = None self.hero.animations.append(self.hero.death_anim()) self.hero.dead = True + self.fail.play() def draw_map(self): self.level.draw(self.display.background, self.images) @@ -92,12 +92,14 @@ if self.level.get((x, y + 2)) == self.hero: self.die() self.level.shove(thing.pos, (dx, 1)) + self.bump.play() def pick(self, thing): thing.animations.append(thing.pick_anim()) self.level.gems -= 1 if self.level.gems <= 0: self.win() + self.pickup.play() def update_boulders(self): for thing in sorted(self.level, key=lambda b: -b.pos[1]):
--- a/undermine/intro.py Mon Apr 28 09:18:04 2014 +0200 +++ b/undermine/intro.py Mon Apr 28 09:36:00 2014 +0200 @@ -11,7 +11,7 @@ def __init__(self, display): self.display = display self.title = undermine.resources.load_image('title.png') - self.music = undermine.resources.load_sound('undermine.ogg') + self.music = undermine.resources.load_file('undermine.ogg') self.death_music = undermine.resources.load_sound('death.ogg') def pause(self): @@ -23,16 +23,16 @@ return def run(self): - self.music.play() + pygame.mixer.music.load(self.music) + pygame.mixer.music.play(-1) while True: self.display.sprites.empty() self.display.background.blit(self.title, (0, 0)) self.display.refresh() self.pause() - self.music.stop() - self.music.play() + pygame.mixer.music.play(-1) try: undermine.game.Game(self.display).run() except undermine.game.GameOver: - self.music.stop() + pygame.mixer.music.stop() self.death_music.play()
