Changeset 155:b455873020be


Ignore:
Timestamp:
Sep 2, 2013, 9:49:27 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
rebase_source:
a3d57644a51aedd8ffd83927d1650efa2f8c0c35
Message:

Crates look like crates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r145 r155  
    88    SWITCH_PUSHERS, COLLISION_TYPE_SWITCH, COLLISION_TYPE_BOX, ZORDER_LOW)
    99from nagslang.options import options
     10from nagslang.resources import resources
    1011
    1112
     
    148149
    149150    def render(self, surface):
    150         pos = self.game_object.get_render_position(surface)
    151         angle = self.game_object.get_render_angle()
    152151        if options.debug:
    153             self._render_shape(surface, pos, angle)
     152            self._render_shape(surface)
    154153
    155154    def animate(self):
     
    169168    def render(self, surface):
    170169        pos = self.game_object.get_render_position(surface)
    171         surface.blit(self._image, image_pos(self._image, pos))
     170        angle = self.game_object.get_render_angle() * 180 / math.pi
     171        image = pygame.transform.rotate(self._image, angle)
     172        surface.blit(image, image_pos(image, pos))
    172173        super(ImageRenderer, self).render(surface)
    173174
     
    356357        super(Box, self).__init__(
    357358            SingleShapePhysicser(space, self.shape),
    358             ShapeRenderer(),
     359            ImageRenderer(resources.get_image('objects', 'crate.png')),
    359360        )
Note: See TracChangeset for help on using the changeset viewer.