Changeset 224:b6db213e53a2
- Timestamp:
- 09/04/13 15:25:26 (9 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
data/levels/level1
r209 r224 51 51 - Run around, press some buttons, have fun! 52 52 classname: Note 53 - args: 54 - [800, 680] 55 - [900, 680] 56 - door_switch 57 classname: Bulkhead 58 name: switch_bulkhead 53 59 lines: 54 60 - - [750, 680] 61 - [800, 680] 62 - - [900, 680] 55 63 - [950, 680] 56 64 - - [750, 480] -
nagslang/game_object.py
r222 r224 221 221 if self.puzzler.get_state(): 222 222 DoorEvent.post(self.destination, self.dest_pos) 223 224 225 class Bulkhead(GameObject): 226 zorder = ZORDER_FLOOR 227 228 def __init__(self, space, end1, end2, key_state=None): 229 body = make_body(None, None, (0, 0)) 230 self.shape = pymunk.Segment(body, tuple(end1), tuple(end2), 3) 231 self.shape.collision_type = COLLISION_TYPE_DOOR 232 if key_state is None: 233 puzzler = puzzle.YesPuzzler() 234 else: 235 puzzler = puzzle.StateProxyPuzzler(key_state) 236 super(Bulkhead, self).__init__( 237 SingleShapePhysicser(space, self.shape), 238 render.ShapeStateRenderer(), 239 puzzler, 240 ) 241 242 def collide_with_protagonist(self): 243 if self.puzzler.get_state(): 244 # Reject the collision, we can walk through. 245 return False 246 return True
Note:
See TracChangeset
for help on using the changeset viewer.