diff nagslang/game_object.py @ 180:026297a03963

Add DoorEvent and tweak ScreenChange to keep more state when the player goes through a door
author Neil Muller <drnlmuller@gmail.com>
date Tue, 03 Sep 2013 16:58:45 +0200
parents 054944c6472b
children dfacd08b8566
line wrap: on
line diff
--- a/nagslang/game_object.py	Tue Sep 03 16:57:09 2013 +0200
+++ b/nagslang/game_object.py	Tue Sep 03 16:58:45 2013 +0200
@@ -9,7 +9,7 @@
     ZORDER_FLOOR, COLLISION_TYPE_DOOR, COLLISION_TYPE_PLAYER)
 from nagslang.options import options
 from nagslang.resources import resources
-from nagslang.events import ScreenChange
+from nagslang.events import DoorEvent
 
 
 class PuzzleGlue(object):
@@ -406,5 +406,4 @@
         for shape in space.shape_query(self.get_shape()):
             if shape.collision_type == COLLISION_TYPE_PLAYER:
                 # Force to new position
-                shape.body.position = self.dest_pos
-                ScreenChange.post(self.destination)
+                DoorEvent.post(self.destination, self.dest_pos)