-
Notifications
You must be signed in to change notification settings - Fork 0
/
rack.py
49 lines (44 loc) · 1.6 KB
/
rack.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
import pygame
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Rack Class !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
class rack(pygame.sprite.Sprite):
def __init__(self, rack_id):
self.rack_id =rack_id
self.shape_count = 0
self.red_square=(1190,144)
self.red_pentagon=(1190,179)
self.red_triangle=(1190,118)
self.green_square = (600, 144)
self.green_pentagon = (600, 179)
self.green_triangle = (600, 118)
self.blue_square = (885, 144)
self.blue_pentagon = (885, 179)
self.blue_triangle = (885, 118)
def add_shape(self):
#print("add_shape called")
self.shape_count+=1
return
def get_rack_location(self,color,shape):
if color == "red":
if shape == "square":
return self.red_square
elif shape == "pentagon":
return self.red_pentagon
elif shape == "triangle":
return self.red_triangle
elif color == "green":
if shape == "square":
return self.green_square
elif shape == "pentagon":
return self.green_pentagon
elif shape == "triangle":
return self.green_triangle
elif color == "blue":
if shape == "square":
return self.blue_square
elif shape == "pentagon":
return self.blue_pentagon
elif shape == "triangle":
return self.blue_triangle
else:
print("False Return")
return (0,0)