-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshapes.py
167 lines (156 loc) · 5.33 KB
/
shapes.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import pygame
class colours():
black = (0,0,0)
white = (255,255,255)
burgandy = (100,0,0)
red = (255,0,0)
green = (0,0,255)
class shape():
stage0 = pygame.image.load("stage0.jpg")
maxStage = 10
mistakes = 0
misCount = 0
def __init__(self):
self.image =shape.stage0
self.showing = "stage0"
self.stage = 0
def updateStage(self):
self.stage +=1
def newGame(self):
del self
def draw(self):
self.screen.fill(colours.white)
self.screen.blit(self.image, (0,0) )
def checkStage(self):
if self.stage >self.maxStage:
return
if self.stage == int(self.showing[5:]):
return
def sequence(self,u,d,r,l):
if d ==l==r==u ==0 and self.stage>= self.maxStage:
self.updateStage()
if self.stage > self.maxStage + 30:
print("your score for that was" + str(self.mistakes))
self.__init__()
self.newGame()
self.misCount +=1
if self.misCount >100:
self.misCount = 0
print("new count")
class Heart(shape):
stages= []
stages.append("first hold down the up key")
stages.append("then hold down on the down key")
stages.append("to finish relise ur fingers!")
stage1= pygame.image.load("stage1.png")
stage2= pygame.image.load("stage2.png")
stage3 = pygame.image.load("stage3.png")
screen = pygame.Surface((97,90),0,32)
maxStage =3
def __init__(self):
super().__init__()
def checkStage(self):
super().checkStage()
if self.stage == 0:
self.image = Heart.stage0
self.showing = "stage0"
elif self.stage ==1:
self.image = Heart.stage1
self.showing = "stage1"
elif self.stage == 2:
self.image = Heart.stage2
self.showing = "stage2"
else:
self.image = Heart.stage3
self.showing = "stage3"
def sequence(self, upCount, downCount,r,l):
super().sequence(upCount,downCount,r,l)
if self.stage == 0 and upCount == 10:
self.updateStage()
elif downCount ==15 and self.stage == 1:
self.updateStage()
elif downCount == 0 and self.stage== 2:
self.updateStage()
if self.misCount == 0:
if self.stage == 0 and [downCount !=0 or r != 0 or l !=0]:
self.mistakes +=1
elif self.stage ==1 and [upCount !=0 or r != 0 or l !=0]:
self.mistakes +=1
elif self.stage == 2 and [upCount !=0 or downCount !=0 or r != 0 or l !=0]:
self.mistakes +=1
class Leaf(shape):
stage1= pygame.image.load("leaf1.jpg")
stage2= pygame.image.load("leaf2.jpg")
stage3= pygame.image.load("leaf3.jpg")
stage4 = pygame.image.load("leaf4.jpg")
stage5 =pygame.image.load("leaf5.jpg")
stage6 = pygame.image.load("leaf6.jpg")
stage7 = pygame.image.load("leaf7.jpg")
maxStage = 7
stages = []
stages.append("first press up to make a dot")
stages.append("then go left")
stages.append("then go right")
stages.append("now go left again")
stages.append("now go right again")
stages.append("to end pull the jug down")
stages.append("to finish realise your fingers!!")
screen = pygame.Surface((97,90),0,32)
def __init__(self):
super().__init__()
def checkStage(self):
super().checkStage()
if self.stage == 0:
self.image = Leaf.stage0
self.showing = "stage0"
elif self.stage ==1:
self.image = Leaf.stage1
self.showing = "stage1"
elif self.stage == 2:
self.image = Leaf.stage2
self.showing = "stage2"
elif self.stage == 3:
self.image = Leaf.stage3
self.showing = "stage3"
elif self.stage == 4:
self.image = Leaf.stage4
self.showing = "stage4"
elif self.stage == 5:
self.image = Leaf.stage5
self.showing = "stage5"
elif self.stage == 6:
self.image = Leaf.stage6
self.showing = "stage6"
else:
self.image = Leaf.stage7
self.showing = "stage7"
def sequence(self, u,d,r,l):
super().sequence(u,d,r,l)
if self.stage ==0:
if u == 10:
self.updateStage()
elif [d>0 or r>0 or l>0] and self.misCount == 0:
self.mistakes +=1
elif self.stage == 1 or self.stage == 3:
if l == 10:
self.updateStage()
elif [u>0 or r>0 or l>0] and self.misCount == 0:
self.mistakes +=1
elif self.stage == 2 or self.stage == 4:
if r == 10:
self.updateStage()
elif [u>0 or d>0 or l>0] and self.misCount == 0:
self.mistakes +=1
elif self.stage == 5:
if d == 50:
self.updateStage()
elif [u>0 or d>0 or l>0] and self.misCount == 0:
self.mistakes +=1
elif self.stage>= 6:
if d ==l==r==u ==0:
self.updateStage()
elif self.misCount == 0:
self.mistakes +=1
#_______________
elif self.stage ==20:
self.stage= 0