Changeset 585:eb7909b354cd


Ignore:
Timestamp:
09/07/13 21:13:35 (8 years ago)
Author:
David Sharpe <decoydavid@…>
Branch:
default
Children:
586:dc4eeb8547dd, 593:0279d573ef7e
Parents:
584:6d2f6fcd914d (diff), 583:ea9e489315f7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • data/levels/cargo_bay

    r582 r585  
    2525  classname: Door
    2626- args:
    27   - [1550, 1500]
     27  - [1500, 1500]
    2828  classname: FloorSwitch
    2929  name: light_switch_1
     
    3333  name: light_switch_2
    3434- args:
    35   - [1550, 1645]
     35  - [1500, 1645]
    3636  classname: FloorSwitch
    3737  name: light_switch_3
     
    4141  name: light_switch_4
    4242- args:
    43   - [1550, 1800]
     43  - [1500, 1790]
    4444  classname: FloorSwitch
    4545  name: light_switch_5
    4646- args:
    47   - [1675, 1800]
     47  - [1675, 1790]
    4848  classname: FloorSwitch
    4949  name: light_switch_6
     
    7070  classname: Box
    7171- args:
     72  - [1385, 1309]
     73  - all_box_switches
     74  classname: FloorLight
     75  name: light1
     76- args:
     77  - [1295, 1165]
     78  classname: FloorSwitch
     79  name: light_switch_7
     80- args:
    7281  - [1385, 1220]
    7382  - light_switch_7
    74   classname: FloorLight
    75   name: light
    76 - args:
    77   - [1385, 1309]
    78   - all_switches
    7983  classname: FloorLight
    8084  name: light2
     
    8286  classname: puzzle.StateLogicalAndPuzzler
    8387  name: all_box_switches
    84 - args:
    85   - [1295, 1165]
    86   classname: FloorSwitch
    87   name: light_switch_7
    8888- args: [all_box_switches, light_switch_7]
    8989  classname: puzzle.StateLogicalAndPuzzler
    9090  name: all_switches
    9191- args:
    92   - [1406, 1265]
     92  - [1500, 1200]
     93  - cargo_bay
     94  - [1500, 1100]
     95  - 90
     96  - all_switches
     97  classname: PuzzleDoor
     98  name: switch_door_to_maintenance_office
     99- args:
     100  - [1500, 1150]
     101  - cargo_bay
     102  - [1500, 1250]
     103  - 90
     104  classname: Door
     105- args:
     106  - [1500, 1000]
     107  - keycard_blue
     108  classname: collectable.KeyCard
     109  name: keycard_blue
     110- args:
     111  - [1800, 1265]
    93112  - crew
    94113  - [110, 1650]
    95114  - 0
    96   - all_switches
    97   classname: PuzzleDoor
    98   name: switch_door_to_crew_quarters
    99 - args:
    100   - [1345, 1309]
    101   - 'To CREW QUARTERS: sealed due to box placement exclusion and drainage pipe complex blockages.'
     115  classname: Door
     116- args:
     117  - [1750, 1309]
     118  - 'To CREW QUARTERS: don't forget to return all safety gear to the lockers'
    102119  classname: Note
    103120- args:
     
    158175  - [1334, 1128]
    159176  - [1334, 1200]
    160   - [1406, 1200]
    161   - [1406, 1330]
     177  - [1800, 1200]
     178  - [1800, 1330]
    162179  - [1190, 1330]
    163180  - [1190, 1420]
     
    167184  - [470, 1200]
    168185  - [614, 1200]
    169   4:
     186  2:
    170187  - [200, 1600]
    171188  - [560, 1600]
     
    193210  - [200, 1780]
    194211  - [200, 1600]
    195   5:
     212  3:
    196213  - [470, 1690]
    197214  - [560, 1690]
     
    199216  - [470, 1870]
    200217  - [470, 1690]
    201   6:
     218  4:
    202219  - [650, 1870]
    203220  - [830, 1870]
     
    205222  - [650, 1690]
    206223  - [650, 1870]
    207   7:
     224  5:
    208225  - [920, 1600]
    209226  - [650, 1600]
     
    211228  - [920, 1510]
    212229  - [920, 1600]
     230  6:
     231  - [1400, 1150]
     232  - [1600, 1150]
     233  - [1600, 910]
     234  - [1400, 910]
     235  - [1400, 1150]
    213236size: [2400, 2410]
  • data/levels/cargo_bay

    r584 r585  
    55  - [470, 1265]
    66  - hangar
    7   - [2350, 1450]
     7  - [2855, 1405]
    88  - 0
    99  classname: Door
     
    123123  classname: Note
    124124lines: []
     125music: POL-cyber-factory-short.ogg
    125126polygons:
    126127  1:
  • nagslang/game_object.py

    r575 r585  
    362362class SokoBox(GameObject):
    363363    def __init__(self, space, position):
    364         body = make_body(1, pymunk.inf, position, 0.2)
     364        body = make_body(1, pymunk.inf, position, 0.1)
    365365        self.shape = pymunk.Poly(
    366366            body, [(-40, -40), (40, -40), (40, 40), (-40, 40)])
    367         self.shape.friction = 0.5
     367        self.shape.friction = 2.0
    368368        self.shape.collision_type = COLLISION_TYPE_FURNITURE
    369369        super(SokoBox, self).__init__(
  • nagslang/game_object.py

    r584 r585  
    401401
    402402    def _post_door_event(self, protagonist):
     403        self.door_opened()
    403404        DoorEvent.post(self.destination, self.dest_pos)
     405
     406    def door_opened(self):
     407        pass
    404408
    405409
     
    459463    @property
    460464    def is_open(self):
    461         return self._stored_state['is_open']
     465        if self._stored_state['is_open']:
     466            return True
     467        return self.puzzler.glue.get_state_of(self._key_state)
     468
     469    def door_opened(self):
     470        self._stored_state['is_open'] = True
    462471
    463472    def set_stored_state_dict(self, stored_state):
     
    465474        self._stored_state.setdefault('is_open', False)
    466475        return True
    467 
    468     def update(self, dt):
    469         if not self.is_open:
    470             self._stored_state['is_open'] = self.puzzler.glue.get_state_of(
    471                 self._key_state)
    472         super(PuzzleDoor, self).update(dt)
    473476
    474477    @classmethod
     
    529532        return [("name", "string"), ("end1", "coordinates"),
    530533                ("end2", "coordinates"), ("key_state", "puzzler")]
     534
     535    # The level knows that bulkheads are magical
     536    @classmethod
     537    def movable(cls):
     538        return True
    531539
    532540
     
    742750    def apply_effect(self, object_to_move):
    743751        movement = self.physicser.position - object_to_move.physicser.position
    744         local_force = self.force * (1 - (self._radius / movement.length))
     752        local_force = self.force * math.sqrt(
     753            object_to_move.get_shape().body.mass)
    745754        movement.length = local_force
    746         object_to_move.environmental_movement(-movement)
    747 
    748     @classmethod
    749     def requires(cls):
    750         return [("name", "string"), ("position", "coordinates"),
    751                 ("outline", "polygon (convex)")]
     755        object_to_move.environmental_movement(movement)
     756
     757    @classmethod
     758    def requires(cls):
     759        return [("name", "string"), ("position", "coordinates"),
     760                ("radius", "int"), ("force", "int")]
    752761
    753762
Note: See TracChangeset for help on using the changeset viewer.