import random
from pgzero.clock import each_tick, unschedule
+from pgzero.loaders import sounds
from functools import partial
from ..roaches import t32_roaches, WorldRoach, default_rats, default_robots
roach.health = 5
roach.damage = 1
roach.angle = 0
+ roach.hit_sound = sounds.load('enemy_hit')
roach.level = level
roach.level_layer = 'floor' # always the case for now
roach.move = partial(move, roach)
roach.health = 10
roach.damage = 2
roach.angle = 0
+ roach.hit_sound = sounds.load('enemy_hit')
roach.level = level
roach.level_layer = 'floor' # always the case for now
roach.move = partial(move, roach)
roach.damage = 5
roach.angle = 0
roach.level = level
+ roach.hit_sound = sounds.load('enemy_hit')
roach.level_layer = 'floor' # always the case for now
roach.move = partial(move, roach)
roach.last_moved = 0
def _hit_enemy(self, enemy, weapon):
enemy.health -= weapon.damage
+ enemy.hit_sound.play()
if enemy.health <= 0:
self._level.remove_enemy(enemy)
self._enemies.remove(enemy)