From e9598e08943dd68a66f0a0f2f5eb2a8757051a50 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 7 Sep 2016 21:41:14 +0200 Subject: [PATCH] Occasional sounds --- tabakrolletjie/enemies.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.34.1