Ignore:
Timestamp:
09/01/13 17:18:12 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Put werewolf facing direction magic back.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/screens/area.py

    r61 r63  
    77
    88from nagslang.game_object import (
    9     GameObject, SingleShapePhysicser, ImageRenderer)
     9    GameObject, SingleShapePhysicser, FacingImageRenderer)
    1010from nagslang.screens.base import Screen
    1111from nagslang.level import Level
     
    4343
    4444        super(Protagonist, self).__init__(
    45             ImageRenderer(resources.get_image('creatures', 'werewolf_1.png')),
     45            FacingImageRenderer(
     46                resources.get_image('creatures', 'werewolf_1.png'),
     47                resources.get_image(
     48                    'creatures', 'werewolf_1.png', transforms=(FLIP_H,))),
    4649            SingleShapePhysicser(self.shape))
    4750
     
    5053    def velocity_func(self, body, gravity, damping, dt):
    5154        return pymunk.Body.update_velocity(body, gravity, self.damping, dt)
    52 
    53     def render_TODO(self, surface):
    54         if self.werewolf:
    55             pos = pymunk.pygame_util.to_pygame(self.body.position, surface)
    56             transforms = ()
    57             if abs(self.body.angle) < math.pi / 2:
    58                 transforms = (FLIP_H,)
    59 
    60             wolf = resources.get_image('creatures', 'werewolf_1.png',
    61                                        transforms=transforms)
    62             surface.blit(wolf, (pos[0] - wolf.get_width() / 2,
    63                                 pos[1] - wolf.get_height() / 2))
    64         else:
    65             pymunk.pygame_util.draw(surface, self.shape)
    6655
    6756    def go_werewolf(self):
Note: See TracChangeset for help on using the changeset viewer.