-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrack.py
29 lines (26 loc) · 803 Bytes
/
track.py
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
"""
track in format:
int track_width
int track_height
bool[][] track_tiles (0 if there is no track, 1 if there is)
((int, int), (int, int))[] track_boundaries (track wall)
((int, int), (int, int))[] track_checkpoints
((int, int), (int, int)) track_start
"""
class Track:
# you can declare empty track for ease of usage
def __init__(self):
self.width = 0
self.height = 0
self.tiles = [[]]
self.boundaries = []
self.checkpoints = []
self.start = ((0, 0), (0, 0))
# default init
def __init__(self, width, height, tiles, boundaries, checkpoints, start):
self.width = width
self.height = height
self.tiles = tiles
self.boundaries = boundaries
self.checkpoints = checkpoints
self.start = start