-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
127 lines (116 loc) · 8.34 KB
/
models.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
""" This module contains models of objects that can be imported to the game """
import random
poly_1 = (10, 10, 10), (20, 20, 0), (-20, 20, 0), (-10, 10, 10)
poly_2 = (-10, 10, 10), (-20, 20, 0), (-20, -20, 0), (-10, -10, 10)
poly_3 = (-10, -10, 10), (-20, -20, 0), (20, -20, 0), (10, -10, 10)
poly_4 = (10, -10, 10), (20, -20, 0), (20, 20, 0), (10, 10, 10)
poly_5 = (10, 10, 10), (-10, 10, 10), (-10, -10, 10), (10, -10, 10)
poly_6 = (20, 20, 0), (-20, 20, 0), (-20, -20, 0), (20, -20, 0)
# Truncated Square Pyramid, sides are parallel to the coordinate axes.
pyramid_model = [{'crds': poly_1, 'color': 'red', 'outline': 'black', 'width': 2},
{'crds': poly_2, 'color': 'green', 'outline': 'black', 'width': 2},
{'crds': poly_3, 'color': 'blue', 'outline': 'black', 'width': 2},
{'crds': poly_4, 'color': 'black', 'outline': 'black', 'width': 2},
{'crds': poly_5, 'color': 'grey', 'outline': 'black', 'width': 2},
{'crds': poly_6, 'color': 'orange', 'outline': 'black', 'width': 2},
]
wall_1 = (-10, 0, 0), (-10, 40, 0), (50, 40, 0), (50, 0, 0)
wall_2 = (-10, 0, 0), (-10, 40, 0), (-10, 40, 20), (-10, 0, 20)
wall_3 = (10, 0, 0), (10, 20, 0), (10, 20, 20), (10, 0, 20)
wall_4 = (-10, 40, 0), (50, 40, 0), (50, 40, 20), (-10, 40, 20)
wall_5 = (10, 20, 0), (50, 20, 0), (50, 20, 20), (10, 20, 20)
corner_model = [{'crds': wall_1, 'color': 'red', 'outline': 'black', 'width': 0},
{'crds': wall_2, 'color': 'green', 'outline': 'black', 'width': 0},
{'crds': wall_3, 'color': 'green', 'outline': 'black', 'width': 0},
{'crds': wall_4, 'color': 'green', 'outline': 'black', 'width': 0},
{'crds': wall_5, 'color': 'green', 'outline': 'black', 'width': 0},
]
colors = ['green', 'blue', 'grey', 'orange', 'pink', 'violet', 'yellow']
map_obj_crds = ((-200, -200, 0), (-200, -200, 120), (-200, 300, 120), (-200, 300, 0),
(-200, -200, 0), (-200, -200, 120), (300, -200, 120), (300, -200, 0),
(300, -200, 0), (300, -200, 120), (300, 300, 120), (300, 300, 0),
(300, 300, 0), (300, 300, 120), (100, 300, 120), (100, 300, 0),
(-200, 300, 0), (-200, 300, 120), (0, 300, 120), (0, 300, 0),
(0, 300, 0), (0, 300, 120), (0, 600, 120), (0, 600, 0),
(100, 300, 0), (100, 300, 120), (100, 600, 120), (100, 600, 0),
(0, 600, 0), (0, 600, 120), (-100, 800, 120), (-100, 800, 0),
(-100, 800, 0), (-100, 800, 120), (-100, 1100, 120), (-100, 1100, 0),
(0, 800, 0), (0, 800, 120), (0, 1000, 120), (0, 1000, 0),
(-100, 1100, 0), (-100, 1100, 120), (600, 1100, 120), (600, 1100, 0),
(0, 1000, 0), (0, 1000, 120), (500, 1000, 120), (500, 1000, 0),
(500, 1000, 0), (500, 1000, 120), (500, 800, 120), (500, 800, 0),
(600, 1100, 0), (600, 1100, 120), (600, 700, 120), (600, 700, 0),
(600, 700, 0), (600, 700, 120), (200, 700, 120), (200, 700, 0),
(500, 800, 0), (500, 800, 120), (0, 800, 120), (0, 800, 0),
(100, 600, 0), (100, 600, 120), (400, 300, 120), (400, 300, 0),
(400, -300, 0), (400, -300, 120), (400, 300, 120), (400, 300, 0),
(500, 0, 0), (500, 0, 120), (500, 300, 120), (500, 300, 0),
(500, 300, 0), (500, 300, 120), (700, 300, 120), (700, 300, 0),
(500, 400, 0), (500, 400, 120), (1200, 400, 120), (1200, 400, 0),
(500, 0, 0), (500, 0, 120), (700, 0, 120), (700, 0, 0),
(700, 0, 0), (700, 0, 120), (700, 300, 120), (700, 300, 0),
(500, -100, 0), (500, -100, 120), (800, -100, 120), (800, -100, 0),
(800, -100, 0), (800, -100, 120), (800, 300, 120), (800, 300, 0),
(500, -100, 0), (500, -100, 120), (500, -200, 120), (500, -200, 0),
(500, -200, 0), (500, -200, 120), (900, -200, 120), (900, -200, 0),
(900, -200, 0), (900, -200, 120), (900, 300, 120), (900, 300, 0),
(1000, 100, 0), (1000, 100, 120), (1000, 200, 120), (1000, 200, 0),
(1000, 100, 0), (1000, 100, 120), (1100, 100, 120), (1100, 100, 0),
(1000, 200, 0), (1000, 200, 120), (1100, 200, 120), (1100, 200, 0),
(1100, 100, 0), (1100, 100, 120), (1100, 200, 120), (1100, 200, 0),
(1100, 0, 0), (1100, 0, 120), (1200, 0, 120), (1200, 0, 0),
(1100, 0, 0), (1100, 0, 120), (1100, -100, 120), (1100, -100, 0),
(1100, -100, 0), (1100, -100, 120), (1200, -100, 120), (1200, -100, 0),
(1200, -100, 0), (1200, -100, 120), (1200, 0, 120), (1200, 0, 0),
(200, 700, 0), (200, 700, 120), (500, 400, 120), (500, 400, 0),
(1200, 100, 0), (1200, 100, 120), (1200, 200, 120), (1200, 200, 0),
(1200, 200, 0), (1200, 200, 120), (1300, 200, 120), (1300, 200, 0),
(1200, 100, 0), (1200, 100, 120), (1300, 100, 120), (1300, 100, 0),
(1300, 100, 0), (1300, 100, 120), (1300, 200, 120), (1300, 200, 0),
(400, -300, 0), (400, -300, 120), (1400, -300, 120), (1400, -300, 0),
(1400, -300, 0), (1400, -300, 120), (1400, 0, 120), (1400, 0, 0),
(1400, 0, 0), (1400, 0, 120), (1500, 0, 120), (1500, 0, 0),
(1400, 100, 0), (1400, 100, 120), (1600, 100, 120), (1600, 100, 0),
(1500, 0, 0), (1500, 0, 120), (1500, -300, 120), (1500, -300, 0),
(1600, 100, 0), (1600, 100, 120), (1600, -200, 120), (1600, -200, 0),
(1600, -200, 0), (1600, -200, 120), (1700, -200, 120), (1700, -200, 0),
(1500, -300, 0), (1500, -300, 120), (1800, -300, 120), (1800, -300, 0),
(1700, -200, 0), (1700, -200, 120), (1700, 0, 120), (1700, 0, 0),
(1800, -300, 0), (1800, -300, 120), (1800, -100, 120), (1800, -100, 0),
(1700, 0, 0), (1700, 0, 120), (2000, 0, 120), (2000, 0, 0),
(1800, -100, 0), (1800, -100, 120), (2100, -100, 120), (2100, -100, 0),
(2000, 0, 0), (2000, 0, 120), (2000, 200, 120), (2000, 200, 0),
(2100, -100, 0), (2100, -100, 120), (2100, 500, 120), (2100, 500, 0),
(1400, 100, 0), (1400, 100, 120), (1400, 200, 120), (1400, 200, 0),
(1400, 200, 0), (1400, 200, 120), (2000, 200, 120), (2000, 200, 0),
(1400, 300, 0), (1400, 300, 120), (2000, 300, 120), (2000, 300, 0),
(2000, 300, 0), (2000, 300, 120), (2000, 400, 120), (2000, 400, 0),
(2000, 400, 0), (2000, 400, 120), (1500, 400, 120), (1500, 400, 0),
(2100, 500, 0), (2100, 500, 120), (1600, 500, 120), (1600, 500, 0),
(1400, 300, 0), (1400, 300, 120), (1500, 400, 120), (1500, 400, 0),
(1600, 500, 0), (1600, 500, 120), (1600, 600, 120), (1600, 600, 0),
(1600, 600, 0), (1600, 600, 120), (800, 600, 120), (800, 600, 0),
(1200, 400, 0), (1200, 400, 120), (1200, 500, 120), (1200, 500, 0),
(1200, 500, 0), (1200, 500, 120), (700, 500, 120), (700, 500, 0),
(700, 500, 0), (700, 500, 120), (700, 800, 120), (700, 800, 0),
(800, 600, 0), (800, 600, 120), (800, 700, 120), (800, 700, 0),
(800, 700, 0), (800, 700, 120), (1200, 700, 120), (1200, 700, 0),
(700, 800, 0), (700, 800, 120), (900, 800, 120), (900, 800, 0),
(900, 800, 0), (900, 800, 120), (900, 1000, 120), (900, 1000, 0),
(900, 1000, 0), (900, 1000, 120), (1200, 1000, 120), (1200, 1000, 0),
(1200, 1000, 0), (1200, 1000, 120), (1200, 700, 120), (1200, 700, 0),
(0, 0, 0), (0, 100, 0), (100, 100, 0), (100, 0, 0),
(1000, 800, 0), (1100, 800, 0), (1100, 900, 0), (1000, 900, 0))
map_obj = ()
tup = ()
i = 0
for i in range(len(map_obj_crds)):
tup += map_obj_crds[i],
if (i+1) % 4 == 0:
map_obj += tup,
tup = ()
labyrinth_model = []
floor = (-800, -800, 0), (-800, 1800, 0), (2800, 1800, 0), (2800, -800, 0)
labyrinth_model += [{'crds': floor, 'color': '#17fbaf', 'outline': 'black', 'width': 0}]
for i in range(len(map_obj)):
labyrinth_model += [{'crds': map_obj[i], 'color': random.choice(colors), 'outline': 'black', 'width': 0}]