Changeset 192:3dc2b6290e66


Ignore:
Timestamp:
Sep 3, 2013, 7:16:22 PM (7 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
rebase_source:
5c8bf08fb7b436b824d91e247fc99dc5b13557c4
Message:

Document collision handler a little better.

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/game_object.py

    r191 r192  
    387387        (including `None`) to process the collision as normal.
    388388        """
    389         pass
     389        return True
    390390
    391391
  • nagslang/screens/area.py

    r191 r192  
    8585        gobj = arbiter.shapes[1].physicser.game_object
    8686        result = gobj.collide_with_protagonist()
     87        # The collision handler must return `True` or `False`. We don't want to
     88        # accidentally reject collisions from handlers that return `None`, so
     89        # we explicitly check for `False` and treate everything else as `True`.
    8790        if result is False:
    8891            return False
Note: See TracChangeset for help on using the changeset viewer.