From: Neil Date: Sat, 10 Sep 2016 12:26:31 +0000 (+0200) Subject: Increase Boyd's starting health over time X-Git-Tag: tabakrolletjie-v1.0.0~105^2~2 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=c0b5c084a33732310c3eac21ecf358ddd62c9d52;p=tabakrolletjie.git Increase Boyd's starting health over time --- diff --git a/tabakrolletjie/enemies.py b/tabakrolletjie/enemies.py index 80a0776..02491aa 100644 --- a/tabakrolletjie/enemies.py +++ b/tabakrolletjie/enemies.py @@ -26,6 +26,11 @@ MAX_AGE = 60 MAX_ELEMENTS = 400 MAX_HEALTH = 100 +# Increase in health per day +DAY_HEALTH = 10 + +HEAL_FACTOR = 1 + MOULD_STAGES = [15, 25] @@ -67,6 +72,9 @@ class Mould(pymunk.Body): self._eyeball = loader.load_image("32", name) return self._eyeball + def set_health(self, new_health): + self._health = new_health + def tick(self, gamestate, space, moulds): """Grow and / or Die""" @@ -74,7 +82,7 @@ class Mould(pymunk.Body): # we regain a health every tick, so we heal in the dark if self._health < MAX_HEALTH: - self._health += 1 + self._health += HEAL_FACTOR refresh = False @@ -150,6 +158,7 @@ class Boyd(object): self._moulds = [] for position in gamestate.get_spawn_positions(): seed = Mould(gamestate, space, position) + seed.set_health(MAX_HEALTH + gamestate.days * DAY_HEALTH) self._moulds.append(seed) self._image = pygame.surface.Surface(SCREEN_SIZE) self._image = self._image.convert_alpha(pygame.display.get_surface())