Ignore:
Timestamp:
09/04/13 16:40:00 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Message:

Much better facing renderers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/render.py

    r222 r229  
    135135
    136136class FacingSelectionRenderer(RendererSelectionRenderer):
    137     def __init__(self, renderers):
    138         for renderer in renderers.values():
    139             renderer.rotate = False
    140         super(FacingSelectionRenderer, self).__init__(renderers)
    141         self._face = 'left'
    142 
    143     def _update_facing(self, angle):
    144         if abs(angle) < math.pi / 2:
    145             self._face = 'right'
    146         elif abs(angle) > math.pi / 2:
    147             self._face = 'left'
    148 
    149137    def select_renderer(self):
    150         angle = self.game_object.get_render_angle()
    151         self._update_facing(angle)
    152         return self._face
     138        return self.game_object.get_facing_direction()
    153139
    154140
Note: See TracChangeset for help on using the changeset viewer.