-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMap.py
More file actions
executable file
·51 lines (40 loc) · 1.26 KB
/
Map.py
File metadata and controls
executable file
·51 lines (40 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#Length of the longest side of the map (square?)
LENGTH = 100
class Map(object):
"""Class handles the visual world
The coordinates are defined in the same way as pixels are defined.
X goes from left to right
Y goes from top to bottom
"""
#The world is 100x100 squares
world = [[None for x in range(100)] for x in range(100)]
def __init__(self, connection):
#Load map from harddrive
self.__load_map()
#Get near map from server
connection.request_field_of_view()
def __load_map(self):
"""Loads map from prev. sessions"""
self.world = [[1 for x in range(100)] for x in range(100)]
#A small river
self.world[14][14] = 3
self.world[14][13] = 3
self.world[14][12] = 3
self.world[14][11] = 3
self.world[14][10] = 3
self.world[14][8] = 3
self.world[14][7] = 3
self.world[14][6] = 3
self.world[14][6] = 3
#A road
self.world[16][9] = 2
self.world[15][9] = 2
self.world[14][9] = 2
self.world[13][9] = 2
self.world[12][9] = 2
Unknown = None
Grass = 1
Sand = 2
Water = 3
Stone = 4
Dirt = 5