X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fenemies.py;h=67f88e72b74a7582a6d577390f722fd71e0a242c;hb=5de2a99cc8756eeb79239ab2d8472e43b7b5fe70;hp=146ef56fa973e9823e0e09bc111947bf6d723183;hpb=61244c813873a57ad6bd7ff76c6faf49ce2a23ee;p=tabakrolletjie.git diff --git a/tabakrolletjie/enemies.py b/tabakrolletjie/enemies.py index 146ef56..67f88e7 100644 --- a/tabakrolletjie/enemies.py +++ b/tabakrolletjie/enemies.py @@ -29,7 +29,7 @@ MAX_ELEMENTS = 400 MAX_HEALTH = 100 # Increase in health per day -DAY_HEALTH = 10 +DAY_HEALTH = 5 HEAL_FACTOR = 1 @@ -101,9 +101,11 @@ class Mould(pymunk.Body): if not self._eyeball: name = random.choice( ('eyeballA.png', 'eyeballB.png', 'eyeballC.png')) - self._eyeball = loader.load_image("32", name, + self._eyeball = loader.load_image( + "32", name, transform=Overlay(colour=self._transform.colour+(127,))) - eyelid = loader.load_image("32", "eyelid.png", transform=self._transform) + eyelid = loader.load_image( + "32", "eyelid.png", transform=self._transform) self._eyeball.blit(eyelid, (0, 0), None) return self._eyeball @@ -149,6 +151,10 @@ class Mould(pymunk.Body): child._health = self._health moulds.append(child) refresh = True + if random.randint(0, 100) < 1: + sound.play_sound( + "rubber_toy_short%d.ogg" % random.randint(1, 5), + volume=0.3) if self._age in MOULD_STAGES: # We grow in size @@ -158,7 +164,7 @@ class Mould(pymunk.Body): if self._age > MOULD_STAGES[1] and random.randint(0, 500) < 1: # Maybe we grow an eyeball self.has_eyeball = True - sound.play_sound("mouth_pop_2a.ogg") + sound.play_sound("mouth_pop_2a.ogg", volume=0.5) if self._age > MAX_AGE: # We die of old age @@ -172,6 +178,8 @@ class Mould(pymunk.Body): EAT_TURNIP_FILTER) if query: query[0].shape.body.turnip.eaten = True + sound.play_sound( + "eating_chips_%d.ogg" % random.randint(1, 3), volume=0.8) return refresh def damage(self, light, space, moulds):