-
Notifications
You must be signed in to change notification settings - Fork 1
/
Calf.spx
119 lines (107 loc) · 1.56 KB
/
Calf.spx
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
onMsg "start", => {
setXYpos -80, 0
turnTo 90
show
}
onMsg "menu", => {
hide
}
onMsg "menu", => {
for !calfPlay {
if calfDie == false {
for i := 0; i < 10; i++ {
if calfPlay == false {
changeYpos -0.5
}
wait 0.05
}
for i := 0; i < 10; i++ {
if calfPlay == false {
changeYpos 0.5
}
wait 0.05
}
}
}
}
onMsg "tap", => {
setCostume 0
for calfPlay {
calfGravity = calfGravity - 0.25
wait 0.05
}
}
onMsg "tap", => {
for calfPlay {
for !(keyPressed(KeySpace) || mousePressed) {
wait 0.01
}
calfGravity = 0.8
for i := 0; i < 10; i++ {
changeYpos 3.5
wait 0.03
}
wait 0.03
}
}
onMsg "tap", => {
for calfPlay {
for !(keyPressed(KeySpace) || mousePressed) {
wait 0.01
}
play mwing, true
wait 0.04
}
}
onMsg "tap", => {
for calfPlay {
if touching("Pipe") || touching(EdgeTop) || ypos < -123.9 {
calfPlay = false
calfDie = true
calfGravity = 0
broadcast "game over"
gotoFront
break
}
wait 0.03
}
}
onMsg "tap", => {
flag := 0
for calfPlay {
if calfGravity != 0.0 {
if heading < 150 && flag == 0 {
turn calfGravity*-0.75
} else {
if heading < 90 {
flag = 0
} else {
flag = 1
}
turn calfGravity*0.75
}
changeYpos calfGravity
}
wait 0.03
}
}
onMsg "game over", => {
if touching("Pipe") {
play mhit, true
}
play mdie, false
}
onMsg "game over", => {
stop OtherScriptsInSprite
wait 0.1
for !touching("Ground") {
changeYpos -10
wait 0.04
}
setYpos -124
turnTo 180
for !calfPlay{
nextCostume
wait 0.1
}
}