X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=tabakrolletjie%2Fenemies.py;h=eef2596e5300455ea7437d29642b27b9bdaabe02;hb=a2c09130986d18095773c96b9dc797f3b3eb542d;hp=65bae00ea4af6b79e5eeba8f76984f8435b8eb58;hpb=e273ee03bc5d751bb9d22974a699ec4ed63cdb25;p=tabakrolletjie.git diff --git a/tabakrolletjie/enemies.py b/tabakrolletjie/enemies.py index 65bae00..eef2596 100644 --- a/tabakrolletjie/enemies.py +++ b/tabakrolletjie/enemies.py @@ -8,8 +8,6 @@ import pygame.draw import pygame.surface import pygame.display -import pygame.locals as pgl - from .constants import (SCREEN_SIZE, MOULD_CATEGORY, OBSTACLE_CATEGORY, TURNIP_CATEGORY) from .loader import loader @@ -126,9 +124,9 @@ class Mould(pymunk.Body): query[0].shape.body.turnip.eaten = True return refresh - def damage(self, light_color, intensity, space, moulds): + def damage(self, light, space, moulds): """Take damage for light, adjusted for resistances.""" - self._health -= 3 + self._health -= light.base_damage() if self._health <= 0 and self._age <= 120: # We die of damage space.remove(self, self._shape) @@ -140,7 +138,7 @@ class Mould(pymunk.Body): class Boyd(object): def __init__(self, gamestate, space): - seed = Mould(gamestate, space, (350, 370)) + seed = Mould(gamestate, space, (275, 300)) self._moulds = [seed] self._image = pygame.surface.Surface(SCREEN_SIZE) self._image = self._image.convert_alpha(pygame.display.get_surface()) @@ -168,7 +166,7 @@ class Boyd(object): lit_by = lights.light_query(mould._shape) for light in lit_by: # Todo: extract colour and intensity from light - if mould.damage(None, None, space, self._moulds): + if mould.damage(light, space, self._moulds): redraw = True break # we only die once if redraw: