Changeset 519:ddd86cb25945


Ignore:
Timestamp:
Sep 7, 2013, 6:09:31 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Children:
520:3f79a77ef1e3, 534:62784e479ed2
rebase_source:
8021076f4c16bed55dc4e24c513c193f947f47c1
Message:

Updated hangar.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • data/levels/hangar

    r492 r519  
    6464- args:
    6565  - [2200, 1750]
    66   - 'TO HANGARS 5-7'
     66  - TO HANGARS 5-7
    6767  classname: Note
    6868- args:
    6969  - [2200, 1050]
    70   - 'TO HANGARS 1-3'
     70  - TO HANGARS 1-3
    7171  classname: Note
    7272- args:
    73   - [2400, 1450]
     73  - [2880, 1401]
    7474  - cargo_bay
    7575  - [60, 1200]
     
    7878  classname: KeyedDoor
    7979- args:
    80   - [2350, 1500]
    81   - 'WARNING: Maintenance foreman's keycard required'
     80  - [2400, 1401]
     81  - 'Please note that the Maintenance Foreman''s keycard is required to access all base areas from the hangar.'
    8282  classname: Note
    8383- args:
     
    9999  classname: collectable.KeyCard
    100100  name: keycard_red
     101- args:
     102  - [2680, 1701]
     103  - crew
     104  - [100, 100]
     105  - 90
     106  - keycard_red
     107  classname: KeyedDoor
     108- args:
     109  - [2680, 1101]
     110  - sheep
     111  - [100, 450]
     112  - 90
     113  - keycard_red
     114  classname: KeyedDoor
    101115lines: []
    102116polygons:
     
    156170  - [2200, 2520]
    157171  - [2400, 2520]
     172  - [2400, 1481]
     173  - [2480, 1481]
     174  - [2480, 1701]
     175  - [2880, 1701]
     176  - [2880, 1101]
     177  - [2480, 1101]
     178  - [2480, 1321]
     179  - [2400, 1321]
    158180  - [2400, 280]
    159 size: [2601, 2601]
     181size: [3001, 2601]
  • 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,
  • nagslang/mutators.py

    r364 r519  
    5858
    5959
     60def rotator(angle):
     61    return Mutator(rotate, angle)
     62
     63
    6064# Identity mutator
    6165NULL = Mutator(lambda x: x)
    6266
    6367# Rotation
    64 R90 = Mutator(rotate, 90)
    65 R180 = Mutator(rotate, 180)
    66 R270 = Mutator(rotate, -90)
     68R90 = rotator(90)
     69R180 = rotator(180)
     70R270 = rotator(-90)
    6771
    6872FLIP_H = Mutator(flip, True, False)
Note: See TracChangeset for help on using the changeset viewer.