Changeset 192:3dc2b6290e66 for nagslang


Ignore:
Timestamp:
09/03/13 19:16:22 (8 years ago)
Author:
Jeremy Thurgood <firxen@…>
Branch:
default
Phase:
public
Rebase:
35633862663038666237623433366238323464393165323437666339396463356231333535376334
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.