From 904210579419bccf387baa2ad9068a6a19189f04 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 6 Mar 2016 00:53:18 +0200 Subject: [PATCH] Scream when attacked --- koperkapel/scenes/level.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/koperkapel/scenes/level.py b/koperkapel/scenes/level.py index ca85884..3b3b315 100644 --- a/koperkapel/scenes/level.py +++ b/koperkapel/scenes/level.py @@ -2,6 +2,7 @@ import random from pgzero.constants import keys +from pgzero.loaders import sounds from pygame import Surface import pygame.locals as pgl from ..loaders.levelloader import levels @@ -130,6 +131,7 @@ class GameLevelScene(BaseLevelScene): self._key_rate = 0.2 self._last_key_down = 0 self._last_dmg = 0 + self._screech = sounds.load("screech") return self._init_roaches(world) def _init_items(self): @@ -205,6 +207,7 @@ class GameLevelScene(BaseLevelScene): return roach = random.choice(world.roaches) roach.health -= self._last_dmg + self._screech.play() self._last_dmg = 0 if roach.health < 0: index = [x.name for x in world.roaches].index(roach.name) -- 2.34.1