diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-02-21 23:56:24 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-02-21 23:56:24 (GMT) |
commit | 5b45b6e35c5d90e483cc0b81d4562ebf27d7e407 (patch) | |
tree | 488ea32e6324e1afabc4441185a0b2e6afff5230 /game_map.py | |
parent | 5e068d9062129e939f0b903f14bbc78699794369 (diff) |
Add / delete and position of furniture in the map
The x,y posittion in the wall is in pixels, then is not resolution independent
we need change it to be in porcentage of the width / height
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'game_map.py')
-rw-r--r-- | game_map.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/game_map.py b/game_map.py index 2f1ccc4..ab78fc7 100644 --- a/game_map.py +++ b/game_map.py @@ -178,6 +178,15 @@ class GameMap(): wall_info['objects'].append(wall_object) self.data['walls'].append(wall_info) + def del_object_from_wall(self, x, y, direction, wall_object): + for wall in self.data['walls']: + if wall['position'] == [x, y, direction]: + # locate the object: + for order, existing_object in enumerate(wall['objects']): + if existing_object == wall_object: + del wall['objects'][order] + break + def get_wall_color(self, x, y): room = self.get_room(x, y) return self.data['rooms'][room]['wall_color'] |