# HG changeset patch # User Neil Muller # Date 1302301743 -7200 # Node ID bd137fdfe3c61754135b61cfab61e1f9454462fa # Parent 4f2ff3c6d52ed743444229d0f8128d5865317809 Draw tails diff -r 4f2ff3c6d52e -r bd137fdfe3c6 skaapsteker/constants.py --- a/skaapsteker/constants.py Sat Apr 09 00:20:37 2011 +0200 +++ b/skaapsteker/constants.py Sat Apr 09 00:29:03 2011 +0200 @@ -33,3 +33,16 @@ HEALTH_HEIGHT = 160 HEALTH_WIDTH = 20 INVENTORY_SIZE = 48 + + TAIL_START = 100 + TAIL_OFFSET = 30 + TAIL_POSITIONS = { + 'shapeshift' : TAIL_START, + 'fireball' : TAIL_START + TAIL_OFFSET, + 'sprint' : TAIL_START + 2 * TAIL_OFFSET, + 'invisibility' : TAIL_START + 3 * TAIL_OFFSET, + 'flight' : TAIL_START + 4 * TAIL_OFFSET, + 'shield' : TAIL_START + 5 * TAIL_OFFSET, + 'steal' : TAIL_START + 6 * TAIL_OFFSET, + 'lightning' : TAIL_START + 7 * TAIL_OFFSET, + } diff -r 4f2ff3c6d52e -r bd137fdfe3c6 skaapsteker/levelscene.py --- a/skaapsteker/levelscene.py Sat Apr 09 00:20:37 2011 +0200 +++ b/skaapsteker/levelscene.py Sat Apr 09 00:29:03 2011 +0200 @@ -11,6 +11,7 @@ from . import level from . import physics from . import constants +from . import data from .sprites import player from .widgets.text import Text from .widgets.bubble import DialogueWidget @@ -35,6 +36,12 @@ self._world = physics.World() self._paused = False + # Helper images for hud + self._tofu = data.load_image('icons/tofu.png') + self._scroll = data.load_image('icons/haiku-scroll.png') + self._tail = data.load_image('icons/tail.png') + + for sprite in self._level.sprites: self._world.add(sprite) npcs_and_items = game_state.create_sprites(self._level.name) @@ -198,6 +205,11 @@ self._player.make_inventory_image() self._level_surface.blit(self._player.inventory_image, inv_pos) + # Draw tails + # FIXME: Use correct tail icon + for tail in fox.tails: + tail_pos = self._clip_rect.left + 8, self._clip_rect.top + constants.FoxHud.TAIL_POSITIONS[tail] + self._level_surface.blit(self._tail, tail_pos) def _update_clip_rect(self):