Changeset 256:2a0bad886956


Ignore:
Timestamp:
Sep 4, 2013, 10:06:37 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Message:

Collision handlers get the protagonist.

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r235 r256  
    137137        self.renderer.animate()
    138138
    139     def collide_with_protagonist(self):
     139    def collide_with_protagonist(self, protagonist):
    140140        """Called as a `pre_solve` collision callback with the protagonist.
    141141
     
    255255        )
    256256
    257     def collide_with_protagonist(self):
     257    def collide_with_protagonist(self, protagonist):
    258258        if self.puzzler.get_state():
    259259            DoorEvent.post(self.destination, self.dest_pos)
     
    283283        )
    284284
    285     def collide_with_protagonist(self):
     285    def collide_with_protagonist(self, protagonist):
    286286        if self.puzzler.get_state():
    287287            # Reject the collision, we can walk through.
  • nagslang/screens/area.py

    r247 r256  
    8484    def _collision_pre_solve_handler(self, space, arbiter):
    8585        gobj = arbiter.shapes[1].physicser.game_object
    86         result = gobj.collide_with_protagonist()
     86        result = gobj.collide_with_protagonist(self.protagonist)
    8787        # The collision handler must return `True` or `False`. We don't want to
    8888        # accidentally reject collisions from handlers that return `None`, so
Note: See TracChangeset for help on using the changeset viewer.