diff nagslang/screens/area.py @ 634:45eff33c3dad

Increased health.
author Jeremy Thurgood <firxen@gmail.com>
date Sun, 08 Sep 2013 01:35:45 +0200
parents 48483396303c
children aeb366d97774
line wrap: on
line diff
--- a/nagslang/screens/area.py	Sun Sep 08 01:34:17 2013 +0200
+++ b/nagslang/screens/area.py	Sun Sep 08 01:35:45 2013 +0200
@@ -10,7 +10,7 @@
 from nagslang.constants import (
     COLLISION_TYPE_WALL, COLLISION_TYPE_PLAYER, CALLBACK_COLLIDERS,
     COLLISION_TYPE_FURNITURE, COLLISION_TYPE_WEREWOLF_ATTACK,
-    CMD_TOGGLE_FORM, CMD_ACTION)
+    CMD_TOGGLE_FORM, CMD_ACTION, PROTAGONIST_HEALTH_MAX_LEVEL)
 from nagslang.events import (
     AddDrawableEvent, DeathEvent, DoorEvent, QuitEvent, ScreenChange)
 from nagslang.level import Level
@@ -295,7 +295,9 @@
             health_colour = pygame.color.THECOLORS['red']
         else:
             health_colour = pygame.color.THECOLORS['violetred3']
-        rect = pygame.Rect(5, 5, self.protagonist.get_health_level(), 30)
+        health = self.protagonist.get_health_level()
+        rect = pygame.Rect(
+            5, 5, (100 * health) / PROTAGONIST_HEALTH_MAX_LEVEL, 30)
         pygame.draw.rect(bar_surface, health_colour, rect, 0)
         bar_surface.set_alpha(192)
         y_pos = surface.get_height() - 20 - bar_surface.get_height()