-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathObstical.py
33 lines (28 loc) · 1.65 KB
/
Obstical.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
class Obstical:
def __init__(self, main_window, state=0):
self.main_window = main_window
self.state = state
self.color = 'black'
self.thickness = 20
self.obsticals = []
self.construct()
def construct(self):
if self.state == 0:
# without any obsticals
pass
elif self.state == 1:
# two holes in the corners like this -> ---
self.obsticals.append(self.main_window.create_rectangle(200, 300, 600, 300+self.thickness, fill=self.color))
elif self.state == 2:
# two paralel lines top of each other -> ---- \n\t----
self.obsticals.append(self.main_window.create_rectangle(0, 150, 550, 150+self.thickness, fill=self.color))
self.obsticals.append(self.main_window.create_rectangle(250, 350, 800, 350+self.thickness, fill=self.color))
elif self.state == 3:
# just a hole in the right side like this -> ----- ---
self.obsticals.append(self.main_window.create_rectangle(0, 300, 500, 300+self.thickness, fill=self.color))
self.obsticals.append(self.main_window.create_rectangle(600, 300, 800, 300+self.thickness, fill=self.color))
else:
# just a hole in the right side like this -> -- -- --
self.obsticals.append(self.main_window.create_rectangle(0, 300, 200, 300+self.thickness, fill=self.color))
self.obsticals.append(self.main_window.create_rectangle(300, 300, 500, 300+self.thickness, fill=self.color))
self.obsticals.append(self.main_window.create_rectangle(600, 300, 800, 300+self.thickness, fill=self.color))