Created
October 22, 2014 01:22
-
-
Save eevee/98e1e3aa126383cfb45f to your computer and use it in GitHub Desktop.
Flax collision detection ported to inform 7 style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Walk.check(Solid) | |
def cant_walk_through_solid_objects(event, _): | |
event.cancel() | |
@Walk.check(DoorPhysics) | |
def cant_walk_through_closed_doors(event, _): | |
if not IOpenable(event.target).open: | |
event.cancel() | |
@Walk.perform(Physics) | |
def do_walk(event, _): | |
event.world.current_map.move(event.actor, event.target.position) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment