-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpat_5_6_rainbowflag.pde
206 lines (148 loc) · 4.01 KB
/
pat_5_6_rainbowflag.pde
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
// made by Anna
//FIX COLOURS
//NO BACKGROUNDS PLEASE
float circle1X = 280;
float circle1Y = 110;
float circle2X = 320;
float circle2Y = 190;
float circle3X = 250;
float circle3Y = 180;
float circle4X = 490;
float circle4Y = 350;
float circle5X = 550;
float circle5Y = 180;
float circle6X = 280;
float circle6Y = 110;
/*
float speed1 = 1.0;
float speed2 = 2.0;
float speed3 = 2.5;
float speed4 = 1.5;
float speed5 = 2.0;
*/
float angle = 0;
int radius = 5;
float xspeed1 = 2.8; // Speed of the shape
float yspeed1 = 2.2; // Speed of the shape
float xspeed2 = 2.8; // Speed of the shape
float yspeed2 = 2.2; // Speed of the shape
float xspeed3 = 2.8; // Speed of the shape
float yspeed3 = 2.2; // Speed of the shape
float xspeed4 = 2.8; // Speed of the shape
float yspeed4 = 2.2; // Speed of the shape
float xspeed5 = 2.8; // Speed of the shape
float yspeed5 = 2.2; // Speed of the shape
float xspeed6 = 2.8; // Speed of the shape
float yspeed6 = 2.2; // Speed of the shape
//int xdirection = 1; // Left or Right
//int ydirection = 1; // Top to Bottom
void setup()
{
size(720,480);
// background(0,0,0);
}
void draw()
{
// background(0,0,0);
// start drawing tile
AnnasTile();
circle1X = circle1X + cos(angle+2)*radius * xspeed1;
circle1Y = circle1Y + sin(angle+2)*radius * yspeed1;
circle2X = circle2X + cos(angle+5)*radius * xspeed2;
circle2Y = circle2Y + sin(angle+5)*radius * yspeed2;
circle3X = circle3X + cos(angle+2)*radius * xspeed3;
circle3Y = circle3Y + sin(angle+2)*radius * yspeed3;
circle4X = circle4X + cos(angle+3)*radius * xspeed4;
circle4Y = circle4Y + sin(angle+3)*radius * yspeed4;
circle5X = circle5X + cos(angle+8)*radius * xspeed5;
circle5Y = circle5Y + sin(angle+8)*radius * yspeed5;
circle6X = circle6X + cos(angle+4)*radius * xspeed6;
circle6Y = circle6Y + sin(angle+4)*radius * yspeed6;
//DO THIS FOR X AND Y AND FOR EVERY CIRCLE!!! ...could probably simplify a lot with loops though...
if (circle1Y < 0 || circle1Y > height)
{
yspeed1*=-1;
}
if (circle1X < 0 || circle1X > width)
{
xspeed1*=-1;
}
//CIRCLE 2
if (circle2X < 0 || circle2X > width)
{
xspeed2*=-1;
}
if (circle2Y < 0 || circle2Y > height)
{
yspeed2*=-1;
}
//CIRCLE 3
if (circle3X < 0 || circle3X > width)
{
xspeed3*=-1;
}
if (circle3Y < 0 || circle3Y > height)
{
yspeed3*=-1;
}
//CIRCLE 4
if (circle4X < 0 || circle4X > width)
{
xspeed4*=-1;
}
if (circle4Y < 0 || circle4Y > height)
{
yspeed4*=-1;
}
//CIRCLE 5
if (circle5X < 0 || circle5X > width)
{
xspeed5*=-1;
}
if (circle5Y < 0 || circle5Y > height)
{
yspeed5*=-1;
}
//CIRCLE 6
if (circle6X < 0 || circle6X > width)
{
xspeed6*=-1;
}
if (circle6Y < 0 || circle6Y > height)
{
yspeed6*=-1;
}
angle += PI*50+(sin(angle)+20);
}
void AnnasTile() {
//circle 1 (bottom)
strokeWeight(1);
stroke(50,150,200);
fill(255, 255, 0); // (228, 128, 80); //(0,125,255); (128, 128, 0);
circle(circle1X, circle1Y, 120);
//circle 2
strokeWeight(1);
stroke(50,150,200);
fill(0, 64, 255); // (255, 219, 88); //(255,155,30); (255, 113, 52);
circle(circle2X, circle2Y, 90);
//circle 3
strokeWeight(1);
stroke(50,200,200);
fill(255, 0, 0); //(255, 113, 52); //(255,255,0); (255, 219, 88);
circle(circle3X, circle3Y, 50);
//circle 4
strokeWeight(1);
stroke(50,200,200);
fill(255, 128, 0); //(255, 203, 52); //(255,255,0); (235, 215, 168)
circle(circle4X, circle4Y, 50);
//circle 5
strokeWeight(1);
stroke(50,200,200);
fill(128, 0, 255); // (255, 153, 152); //(255,255,0); (235, 215, 230)
circle(circle5X, circle5Y, 50);
//circle 6
strokeWeight(1);
stroke(50,200,200);
fill(0, 255, 0); // (255, 153, 152); //(255,255,0); (235, 215, 230)
circle(circle6X, circle6Y, 50);
}