Ignore:
Timestamp:
09/07/13 18:09:31 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Children:
520:3f79a77ef1e3, 534:62784e479ed2
Phase:
public
Rebase:
38303231303736663463313662656435356463346532346335313363313933663934376634376331
Message:

Updated hangar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r510 r519  
    77from nagslang import puzzle
    88from nagslang import render
    9 from nagslang.mutators import FLIP_H, ImageOverlay
     9from nagslang.mutators import FLIP_H, ImageOverlay, rotator
    1010from nagslang.constants import (
    1111    COLLISION_TYPE_DOOR, COLLISION_TYPE_FURNITURE, COLLISION_TYPE_PROJECTILE,
     
    397397
    398398
     399def make_overlay_image(image_name, angle):
     400    transforms = ()
     401    if angle != 0:
     402        transforms = (rotator(-angle),)
     403    return resources.get_image('objects', image_name, transforms=transforms)
     404
     405
    399406class PuzzleDoor(BaseDoor):
    400407    def __init__(self, space, position, destination, dest_pos, angle,
    401408                 key_state):
    402409        self._key_state = key_state
    403         overlay = ImageOverlay(resources.get_image('objects', 'lock.png'))
     410        overlay = ImageOverlay(make_overlay_image('lock.png', angle))
    404411        super(PuzzleDoor, self).__init__(
    405412            space, position, destination, dest_pos, angle,
     
    440447        self._key_item = key_item
    441448        overlay = ImageOverlay(
    442             resources.get_image('objects', '%s.png' % (key_item,)))
     449            make_overlay_image('%s.png' % (key_item,), angle))
    443450        super(KeyedDoor, self).__init__(
    444451            space, position, destination, dest_pos, angle,
Note: See TracChangeset for help on using the changeset viewer.