-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolorswitch-circular.grph
More file actions
93 lines (93 loc) · 2.56 KB
/
colorswitch-circular.grph
File metadata and controls
93 lines (93 loc) · 2.56 KB
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
#requires GRPH 1.7
#import stdio
// This game was inspired from Color Switch's Circular game mode
back = (500,500 color[10 10 10])
Circle outline = Circle("Outline" 10,10 480,480 color[128 128 128] 5F rounded {15F, 20F})
validate: outline
/// The ball we are playing
Polygon ball = Polygon("Cursor" RED 470,250 500,240 495,250 500,260)
validate: ball
Circle center = Circle("Center" 240,240 20,20 WHITE)
Path red = Path(["Red path"] RED)
moveTo red: 250,250
lineTo red: 150,150
quadTo red: 60,250 150,350
closePath red:
Path green = Path(["Green path"] GREEN)
moveTo green: 250,250
lineTo green: 150,150
quadTo green: 250,60 350,150
closePath green:
Path yellow = Path(["Yellow path"] YELLOW)
moveTo yellow: 250,250
lineTo yellow: 350,350
quadTo yellow: 250,430 150,350
closePath yellow:
Path blue = Path(["Blue path"] BLUE)
moveTo blue: 250,250
lineTo blue: 350,350
quadTo blue: 430,250 350,150
closePath blue:
Group group = Group(red green yellow blue center)
setRotationCenter group: 250,250
validate: group
integer sending = 0
integer progress = 0
#while true
rotate group: 5°
#if isKeyPressedWithKeyCode[32] && sending == 0
sending = 1
translate ball: -1,0
#if sending >= 1
sending += 5
translate ball: -5,0
#if intersectsGrouped[ball red] && progress <= 0
#if getPaint[ball] == RED
translate ball: createPos[sending 0]
sending = 0
progress += 1
removeFromGroup group: red
setPaint ball: GREEN
#else
validate: Text(["You touched the wrong color!"] 58,300 0 30 WHITE)
end:
//
#elseif intersectsGrouped[ball green] && progress <= 1
#if getPaint[ball] == GREEN
translate ball: createPos[sending 0]
sending = 0
progress += 1
removeFromGroup group: green
setPaint ball: BLUE
#else
validate: Text(["You touched the wrong color!"] 58,300 0 30 WHITE)
end:
//
#elseif intersectsGrouped[ball blue] && progress <= 2
#if getPaint[ball] == BLUE
translate ball: createPos[sending 0]
sending = 0
progress += 1
removeFromGroup group: blue
setPaint ball: YELLOW
#else
validate: Text(["You touched the wrong color!"] 58,300 0 30 WHITE)
end:
//
#elseif intersectsGrouped[ball yellow] && progress <= 3
#if getPaint[ball] == YELLOW
translate ball: createPos[sending 0]
sending = 0
removeFromGroup group: yellow
validate: Text(["You won!"] 58,300 0 30 WHITE)
end:
#else
validate: Text(["You touched the wrong color!"] 58,300 0 30 WHITE)
end:
//
#elseif intersects[ball center]
validate: Text(["You touched the center!"] 58,300 0 30 WHITE)
end:
wait: 100
//
//