Changeset 185:dfacd08b8566 for nagslang
- Timestamp:
- 09/03/13 17:48:02 (9 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nagslang/game_object.py
r180 r185 42 42 43 43 44 class FloorSwitchPuzzler(Puzzler): 44 class CollidePuzzler(Puzzler): 45 def __init__(self, *collision_types): 46 if not collision_types: 47 collision_types = (COLLISION_TYPE_PLAYER,) 48 self._collision_types = collision_types 49 45 50 def get_state(self): 46 51 space = self.game_object.get_space() 47 52 for shape in space.shape_query(self.game_object.get_shape()): 48 if shape.collision_type in SWITCH_PUSHERS:53 if shape.collision_type in self._collision_types: 49 54 return True 50 55 return False … … 352 357 False: resources.get_image('objects', 'sensor_off.png'), 353 358 }), 354 FloorSwitchPuzzler(),359 CollidePuzzler(*SWITCH_PUSHERS), 355 360 ) 356 361
Note:
See TracChangeset
for help on using the changeset viewer.