-
Notifications
You must be signed in to change notification settings - Fork 0
/
room.py
116 lines (92 loc) · 1.71 KB
/
room.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
import pygame
import cmath
import random
import math
x1 = 5
y1 = 5
x2 = 5
y2 = 10
def deg0():
global x1
global x2
for x in range(10):
x2 -= 5
#30deg =
#60deg =
def deg90():
global y2
for x in range(10):
y2 += 5
def deg120():
global x1
global y1
global y2
global x2
for x in range(22):
x2 += 2.5
y2 += 4.33
#150deg =
def deg180():
global x2
for x in range(11):
x2 += 5
#210deg =
#240deg =
def deg270():
global y2
for x in range(29):
y2 -= 5
#300deg =
#330deg =
#360deg =
xDistance = (abs(x1 - x2))
yDistance = (abs(y1 - y2))
#x2Distance = (abs(x2 - x3))
#y2Distance = (abs(y2 - y3))
def findPytha(a,b):
x = cmath.sqrt(((a**2) + (b**2)))
return x
curX = 0
curY = 0
pygame.init()
white = (255, 255, 255)
black = (0, 0, 0)
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)
gameDisplay = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Room')
counter = 0
drawings = []
gameExit = False
while not gameExit:
for event in pygame.event.get():
if event.type == pygame.QUIT:
gameExit = True
counter += 1
drawing = ((x1, y1), (x2, y2))
if counter == 10:
deg90()
drawings.append(drawing)
gameDisplay.fill(white)
if counter >= 10:
pygame.draw.aalines(gameDisplay, black, True, drawings[0])
if counter == 20:
deg120()
drawings.append(drawing)
if counter >= 20:
pygame.draw.aalines(gameDisplay, black, True, drawings[1])
if counter == 30:
deg180()
drawings.append(drawing)
if counter >= 40:
pygame.draw.aalines(gameDisplay, black, True, drawings[2])
if counter == 50:
deg90()
drawings.append(drawing)
if counter >= 50:
pygame.draw.aalines(gameDisplay, black, True, drawings[3])
print(drawings)
pygame.display.update()
pygame.quit()
quit()