diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-02-21 03:41:40 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-02-21 03:41:40 (GMT) |
commit | 2ff9cc16b223b38687a1c0c1c2798ce26aece7cf (patch) | |
tree | fe239d6f76d3ceca8067f78409371eeba013c024 /mapnav.py | |
parent | b68ae2d0c20fb38158380f3f488e08560832331d (diff) |
Move the information of the doors in the walls to another array.
The doors have different properties than the other objects
attached to the walls. The doors are present at the two sides of the wall,
and the position is fixed. I have moved the doors to a 'doors' array,
and the 'objects' array will be loaded with the other objects.
I think the code will be simpler in this way.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'mapnav.py')
-rw-r--r-- | mapnav.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -54,7 +54,8 @@ class MapNavView(gtk.DrawingArea): reversed_direction = \ self._game_map.get_reversed_direction(self.direction) wall_info = self._game_map.get_wall_info(x, y, reversed_direction) - if wall_info is None or self._game_map.have_door(wall_info): + if wall_info is None or \ + self._game_map.have_door(x, y, reversed_direction): new_x, new_y, new_direction = \ self._game_map.cross_door(x, y, reversed_direction) new_direction = self.direction @@ -102,8 +103,7 @@ class MapNavView(gtk.DrawingArea): return self.cache_info[key] else: # have door? - wall_info = self._game_map.get_wall_info(x, y, direction) - have_door = self._game_map.have_door(wall_info) + have_door = self._game_map.have_door(x, y, direction) # there are a page at cw direction? cw_direction = self._game_map.get_direction_cw(direction) wall_cw = self._game_map.get_wall_info(x, y, cw_direction) is \ |