diff options
author | Manuel Quiñones <manuq@laptop.org> | 2012-02-06 11:21:58 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2012-02-06 11:21:58 (GMT) |
commit | ab44a6340c2172f4b305bb801174bf97111f771b (patch) | |
tree | 9fbfc40eb49968750148bb6ab64c7baecdfb98d2 /game_map.py | |
parent | 952583926af90301cfee57c19cf72f4de9954598 (diff) |
Add wall colors
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Diffstat (limited to 'game_map.py')
-rw-r--r-- | game_map.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/game_map.py b/game_map.py index f8d1035..b92ec6a 100644 --- a/game_map.py +++ b/game_map.py @@ -48,6 +48,19 @@ class GameMap(): 'FHHI', 'JJJJ'], + 'room_colors': { + 'A': (0.7, 0.8, 0.7), + 'B': (0.8, 0.8, 0.6), + 'C': (0.6, 0.6, 1), + 'D': (0.7, 0.8, 0.7), + 'E': (0.8, 0.8, 0.6), + 'F': (0.7, 0.8, 0.7), + 'G': (0.3, 0.4, 0.3), + 'H': (0.8, 0.8, 0.6), + 'I': (0.7, 0.8, 0.7), + 'J': (0.8, 0.8, 0.6), + }, + # walls are defined by the cell position x,y and the direction # N,S,E,W 'walls': [{'position': [0, 0, 'S'], 'objects': ['door_1']}, @@ -66,6 +79,7 @@ class GameMap(): {'position': [2, 4, 'E'], 'objects': ['door_17']}, {'position': [3, 4, 'S'], 'objects': ['door_18']}]} + def get_room(self, x, y): """ Return room key and the dictionary based in the position x,y in the map""" @@ -152,6 +166,10 @@ class GameMap(): # Nothing found return [] + def get_wall_color(self, x, y): + room = self.get_room(x, y) + return self.data['room_colors'][room] + def go_right(self, x, y, direction): """ Return next position if the user go to the right""" # check if there are a wall |