From: Neil Date: Wed, 7 Sep 2016 19:41:14 +0000 (+0200) Subject: Occasional sounds X-Git-Tag: tabakrolletjie-v1.0.0~197 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=e9598e08943dd68a66f0a0f2f5eb2a8757051a50;p=tabakrolletjie.git Occasional sounds --- diff --git a/tabakrolletjie/enemies.py b/tabakrolletjie/enemies.py index 7ed6cf9..0fe1619 100644 --- a/tabakrolletjie/enemies.py +++ b/tabakrolletjie/enemies.py @@ -12,6 +12,7 @@ import pygame.locals as pgl from .constants import SCREEN_SIZE, MOULD_CATEGORY, OBSTACLE_CATEGORY from .loader import loader +from .sound import sound MOULD_FILTER = pymunk.ShapeFilter( mask=MOULD_CATEGORY | OBSTACLE_CATEGORY, @@ -88,6 +89,8 @@ class Mould(pymunk.Body): child._health = self._health moulds.append(child) refresh = True + if random.randint(0, 10) < 2: + sound.play_sound("mouth_pop_2a.ogg") if self._age in (10, 20): # Segment grows in size