diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-02-13 01:03:07 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-02-13 01:03:07 (GMT) |
commit | 03be821e6a5fcee2ad7a3dbd433276357ed4b8ae (patch) | |
tree | 9d0c61c0fbe7eaf273e736265b39aaf5e8c5546f /game_map.py | |
parent | 4ad228fbf024e6f7ca6026d367714533e07b5f4e (diff) |
Add window to edit the map in the activity.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'game_map.py')
-rw-r--r-- | game_map.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/game_map.py b/game_map.py index 92897f8..caaf32e 100644 --- a/game_map.py +++ b/game_map.py @@ -35,7 +35,7 @@ We represent this map with the following structure: class GameMap(): - data = {'max_x': 4, 'max_y': 6, + default_data = {'max_x': 4, 'max_y': 6, 'rooms': {'A': {'wall_color': (0.7, 0.8, 0.7)}, 'B': {'wall_color': (0.8, 0.8, 0.6)}, @@ -73,6 +73,12 @@ class GameMap(): {'position': [2, 4, 'E'], 'objects': ['door_17']}, {'position': [3, 4, 'S'], 'objects': ['door_18']}]} + def __init__(self, data=None): + if data is None: + self.data = self.default_data + else: + self.data = data + def get_room(self, x, y): """ Return room key and the dictionary based in the position x,y in the map""" |