comparison 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
comparison
equal deleted inserted replaced
633:cf276bb2a854 634:45eff33c3dad
8 from nagslang.mutators import ImageCentre, scaler 8 from nagslang.mutators import ImageCentre, scaler
9 from nagslang.options import options 9 from nagslang.options import options
10 from nagslang.constants import ( 10 from nagslang.constants import (
11 COLLISION_TYPE_WALL, COLLISION_TYPE_PLAYER, CALLBACK_COLLIDERS, 11 COLLISION_TYPE_WALL, COLLISION_TYPE_PLAYER, CALLBACK_COLLIDERS,
12 COLLISION_TYPE_FURNITURE, COLLISION_TYPE_WEREWOLF_ATTACK, 12 COLLISION_TYPE_FURNITURE, COLLISION_TYPE_WEREWOLF_ATTACK,
13 CMD_TOGGLE_FORM, CMD_ACTION) 13 CMD_TOGGLE_FORM, CMD_ACTION, PROTAGONIST_HEALTH_MAX_LEVEL)
14 from nagslang.events import ( 14 from nagslang.events import (
15 AddDrawableEvent, DeathEvent, DoorEvent, QuitEvent, ScreenChange) 15 AddDrawableEvent, DeathEvent, DoorEvent, QuitEvent, ScreenChange)
16 from nagslang.level import Level 16 from nagslang.level import Level
17 from nagslang.screens.base import Screen 17 from nagslang.screens.base import Screen
18 from nagslang.sound import sound 18 from nagslang.sound import sound
293 bar_surface.fill(health_box_colour) 293 bar_surface.fill(health_box_colour)
294 if self.protagonist.in_human_form(): 294 if self.protagonist.in_human_form():
295 health_colour = pygame.color.THECOLORS['red'] 295 health_colour = pygame.color.THECOLORS['red']
296 else: 296 else:
297 health_colour = pygame.color.THECOLORS['violetred3'] 297 health_colour = pygame.color.THECOLORS['violetred3']
298 rect = pygame.Rect(5, 5, self.protagonist.get_health_level(), 30) 298 health = self.protagonist.get_health_level()
299 rect = pygame.Rect(
300 5, 5, (100 * health) / PROTAGONIST_HEALTH_MAX_LEVEL, 30)
299 pygame.draw.rect(bar_surface, health_colour, rect, 0) 301 pygame.draw.rect(bar_surface, health_colour, rect, 0)
300 bar_surface.set_alpha(192) 302 bar_surface.set_alpha(192)
301 y_pos = surface.get_height() - 20 - bar_surface.get_height() 303 y_pos = surface.get_height() - 20 - bar_surface.get_height()
302 surface.blit(bar_surface, (20, y_pos)) 304 surface.blit(bar_surface, (20, y_pos))
303 305