-
Notifications
You must be signed in to change notification settings - Fork 0
/
maps.py
84 lines (75 loc) · 2.44 KB
/
maps.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import zones
import turtle
from draw_utils import *
import power_cells
import markers
galactic_search_a_red = 1
galactic_search_a_blue = 2
galactic_search_b_red = 3
galactic_search_b_blue = 4
barrel_racing = 5
slalom = 6
bounce = 7
def draw_map(map):
turtle.tracer(False)
if map == galactic_search_a_red:
start_zone = zones.galactic_search_start
end_zone = zones.galactic_search_end
stars = power_cells.galactic_a_red
star_color = "red"
my_markers = markers.galactic_search
elif map == galactic_search_a_blue:
start_zone = zones.galactic_search_start
end_zone = zones.galactic_search_end
stars = power_cells.galactic_a_blue
star_color = "blue"
my_markers = markers.galactic_search
elif map == galactic_search_b_red:
start_zone = zones.galactic_search_start
end_zone = zones.galactic_search_end
stars = power_cells.galactic_b_red
star_color = "red"
my_markers = markers.galactic_search
elif map == galactic_search_b_blue:
start_zone = zones.galactic_search_start
end_zone = zones.galactic_search_end
stars = power_cells.galactic_b_blue
star_color = "blue"
my_markers = markers.galactic_search
elif map == barrel_racing:
start_zone = zones.barrel_racing_start
end_zone = zones.barrel_racing_end
stars = []
star_color = "blue"
my_markers = markers.barrel_racing
elif map == slalom:
start_zone = zones.slalom_start
end_zone = zones.slalom_end
stars = []
star_color = "blue"
my_markers = markers.slalom
elif map == bounce:
start_zone = zones.bounce_start
end_zone = zones.bounce_end
stars = power_cells.bounce
star_color = "green"
my_markers = markers.bounce
move(0, 0)
turtle.setheading(0)
turtle.speed(speed=0)
move(0, 15)
draw_rectangle(30, 15, 'white')
# Start zone
move(start_zone[0][0], start_zone[0][1])
draw_rectangle(start_zone[1], start_zone[2], 'green')
# End zone
move(end_zone[0][0], end_zone[0][1])
draw_rectangle(end_zone[1], end_zone[2], 'red')
# Draw markers
for marker in my_markers:
move(marker[0] - 0.125, marker[1] + 0.125)
draw_rectangle(0.25, 0.25, 'gray')
# Draw power cells
for star in stars:
move(star[0] - 0.25, star[1] + 0.25)
draw_rectangle(0.5, 0.5, star_color)