//"party" is term used in instructions (which is the one with all random colours, mad is for the party circles, orange is for the party background
3
//If I changed something or type in a code, I will mention, if not, it means it is copied exactly.
4
5
ArrayList<Particle>pts;
6
booleanonPressed, showInstruction, orange, winter, autumn, spring, summer, mad, winterx, autumnx, springx, summerx; //this is like a varialbe, true or false
7
PFontf; //I added the orange boolean to the summerx
8
PFontfo;
9
PImagephoto;
10
floatx;
11
floatz=0;
12
13
//This is just the set up
14
voidsetup() {
15
size(1280, 710);
16
smooth();
17
frameRate(50);
18
rectMode(CENTER);
19
pts=newArrayList<Particle>();
20
21
//This made-up command is a boolean and will be given as a setup (only in the beginning), and when "showInstruction" is activated, the letters will be like this
22
showInstruction=true;
23
//f is a made-up shortcut for the format and the look of the font
24
f=createFont("Phosphate", 90, true);
25
fo=createFont("Phosphate", 30, true); // I added this font myself.
26
}
27
28
//This is saying "This command is forever: if 'showInstruction' is activated, the image I named season appears, and letter 'click drag blablabla' will be shown as such a colour,
29
// and is centred blablabla and is the width* height* is for where the text will be put
30
voiddraw() {
31
//First, you should use preview and open a photo, then, just copy-paste an image from the internet and change the size so it's like four photos, then go to sketch and add sketch and add your image, and use the code to make it display. This is also from funprogramming
32
if (showInstruction) {
33
photo=loadImage("season.jpeg");
34
image(photo,x,0);
35
fill(255,255,180);
36
textAlign(CENTER, CENTER);
37
textFont(f);
38
textLeading(90);
39
text("Season Blub Bowls"+"\n"+
40
"Click & Drag "
41
,width*0.39, height*0.33);
42
textFont(fo);
43
textLeading(30);
44
text("Then press 'a', 's', 'd', 'f', 'p' to change season"+"\n"+
, width*0.39, height*0.61); //I changed the position and text.
47
}
48
49
//Below this, a code says that is mouse is clicked, "onPressed" will be activated (true), here it says if it is true, this will happen: drawing circle, the background covers. This one is copied exactly.
//The is a boolean, when these booleans are true, they are activated and the background will change colour, and for the mad part, it will change strokes and stuff.
60
//This is the code I took from funprogramming for the background of random colours with the shapes.
61
if (orange){
62
floatx=0;
63
while (x<width) {
64
65
floaty=0;
66
while(y<height) {
67
fill(random(0,130), 255, 255); // I only changed this part for this "if" sentence.
68
ellipse(20+x, 20+y, 60, 60);
69
y=y+40;
70
}
71
72
x=x+40;
73
}
74
75
z=z+0.02;
76
}
77
78
if (spring){
79
background(0,125,75); //I did this and the following 3 if sentences by myself. Some backgrounds are not used but it is an option for someone else to use a different colour, to take as reference.
80
}
81
82
if (winter){
83
// background(115,95,255);
84
background(150,215,255);
85
}
86
87
if (summer){
88
//background(220,40,40);
89
//background(255,115,0);
90
background(255,105,30);
91
}
92
93
if (autumn){
94
background(120,60,0);
95
}
96
97
//This is how the particles (which in this case are the circles), will be displayed and then when the size is small as zero, it gets removed.
98
for (inti=0; i<pts.size (); i++) {
99
Particlep=pts.get(i);
100
p.update();
101
p.display();
102
}
103
104
for (inti=pts.size ()-1; i>-1; i--) {
105
Particlep=pts.get(i);
106
if (p.dead) {
107
pts.remove(i);
108
}
109
}
110
111
112
}
113
114
115
116
117
118
//Here is what I mentioned when mouse is clicked, mousePressed is true.
119
voidmousePressed(){
120
onPressed=true;
121
if (showInstruction) {
122
showInstruction=false;
123
orange=true; // Added by me. It will start as the background with shapes of random colours, for "party"
124
mad=true; // Added by me. And it will start as the circles with all random colours.
125
}
126
}
127
128
// When the mouse goes from clicked to nothing, the onPress will not work, and will shut down
129
voidmouseReleased() {
130
onPressed=false;
131
}
132
133
//This part is if you press a key, then one specific boolean assigned to the key will be true, and the other ones will not be true. Further instructions in the bottoms states what happens when the booleans are true.
134
voidkeyPressed() {
135
if (key=='p') { //I made all of this...
136
orange=true;
137
spring=false;
138
winter=false;
139
summer=false;
140
autumn=false;
141
mad=true;
142
springx=false;
143
winterx=false;
144
summerx=false;
145
autumnx=false;
146
}
147
148
if (key=='a') {
149
spring=true;
150
orange=false;
151
winter=false;
152
summer=false;
153
autumn=false;
154
springx=true;
155
mad=false;
156
winterx=false;
157
summerx=false;
158
autumnx=false;
159
}
160
161
if (key=='f') {
162
winter=true;
163
spring=false;
164
orange=false;
165
summer=false;
166
autumn=false;
167
winterx=true;
168
springx=false;
169
mad=false;
170
summerx=false;
171
autumnx=false;
172
}
173
174
if (key=='s') {
175
summer=true;
176
spring=false;
177
winter=false;
178
autumn=false;
179
orange=false;
180
summerx=true;
181
springx=false;
182
winterx=false;
183
autumnx=false;
184
mad=false;
185
}
186
187
if (key=='d') {
188
autumn=true;
189
spring=false;
190
orange=false;
191
winter=false;
192
summer=false;
193
autumnx=true;
194
springx=false;
195
mad=false;
196
winterx=false;
197
summerx=false;
198
} //... until here
199
}
200
201
202
203
204
205
//This is the particles part. the particle(...) is how much they will move vertically and horrizontally, and how much they get smaller everytime.
//Here I say what the value of c will be using booleans. (booleans - as I understand - is mainly used when you put a keypressed in the void keyPressed, but the result you want to see belong to somewhere else (e.g. void draw / particle)
//This is to tell how a new circle comes out smaller each time.
283
voiddisplay() {
284
strokeWeight(weight+0.1);
285
stroke(c);
286
point(loc.x, loc.y);
287
}
288
}
289
290
//The changes usually have little difference from the original design. The image starts too big, so it doesn't show the whole image. I decided I would let it the way it is as I do not know how to fix it and I thought I could let it look like a powerpoint. I also made spring the biggest because green is the best for our eyes.
291
//I also changed the colour of the background for summer. I changed it from red to orange. It was because I found that red would be too bright and would sting people's eye, and is not pleasant. If the red was darker and less stinging, it doesn't feel like a red for summer.
292
//In my original plan, I had a dark blue included for winter, but I took it away as I thought the colours for winter should look more lighter like white snow.
293
//I also took away the purple from autumn because I did not think it fits autumn or contrasts with the background very well.
294
//I also changed the keys to change the season colour. Instead of using the first letter of seasons, I made it asdf for spring -> summer -> autumn -> winter relatively. I did it like that as I thought that is the order of seasons most people follow.
295
//I made p for party instead of m for mad or r for random or c for crazy. It is because I thought that I should give it an occasion or time like the seasons, so I thought party party party would be good.
296
//And I changed the name / title of this programme with some different pronunciation just to make it sound more interesting.
297
298
//I think the changes are small and it is about what I planned it to be. I have instructions with a season-pictures background that show at the beginning and will be gone when you start clicking or pressing.
299
//Also, the colours are pretty similar (red, yellow, and orange for summer / the mad or party one is pretty crazy, but that colour is laggy. However that cannot be fixed / green for spring, purple and light blue for winter, and orange and brown for autumn) as mentioned in the planning drawings.
300
//The circles do move in random directions like floating, while getting smaller and smaller. They also have a random-with-limits colours, and the same circle stay the same colour the whole time.
“Season_Blub_Bowls” by rexxx
https://openprocessing.org/sketch/176107
License CreativeCommons Attribution ShareAlike
https://creativecommons.org/licenses/by-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
CC Attribution ShareAlike
Season_Blub_Bowls
xxxxxxxxxx
// A lot of the codes are from the website.
//"party" is term used in instructions (which is the one with all random colours, mad is for the party circles, orange is for the party background
//If I changed something or type in a code, I will mention, if not, it means it is copied exactly.
ArrayList<Particle> pts;
boolean onPressed, showInstruction, orange, winter, autumn, spring, summer, mad, winterx, autumnx, springx, summerx; //this is like a varialbe, true or false
PFont f; //I added the orange boolean to the summerx
PFont fo;
PImage photo;
float x;
float z = 0;
//This is just the set up
void setup() {
size(1280, 710);
smooth();
frameRate(50);
rectMode(CENTER);
pts = new ArrayList<Particle>();
//This made-up command is a boolean and will be given as a setup (only in the beginning), and when "showInstruction" is activated, the letters will be like this
showInstruction = true;
//f is a made-up shortcut for the format and the look of the font
f = createFont("Phosphate", 90, true);
fo = createFont("Phosphate", 30, true); // I added this font myself.
}
//This is saying "This command is forever: if 'showInstruction' is activated, the image I named season appears, and letter 'click drag blablabla' will be shown as such a colour,
// and is centred blablabla and is the width* height* is for where the text will be put
void draw() {
//First, you should use preview and open a photo, then, just copy-paste an image from the internet and change the size so it's like four photos, then go to sketch and add sketch and add your image, and use the code to make it display. This is also from funprogramming
if (showInstruction) {
photo = loadImage("season.jpeg");
image(photo,x,0);
fill(255,255,180);
textAlign(CENTER, CENTER);
textFont(f);
textLeading(90);
text("Season Blub Bowls" +"\n"+
"Click & Drag "
,width*0.39, height*0.33);
textFont(fo);
textLeading(30);
text("Then press 'a', 's', 'd', 'f', 'p' to change season" + "\n" +
"a=Spring / s=Summer / d=Autumn / f=winter / p=party x 3"
, width*0.39, height*0.61); //I changed the position and text.
}
//Below this, a code says that is mouse is clicked, "onPressed" will be activated (true), here it says if it is true, this will happen: drawing circle, the background covers. This one is copied exactly.
if (onPressed) {
for (int i=0; i<10; i++) {
Particle newP = new Particle(mouseX,mouseY, i+pts.size(), i+pts.size());
pts.add(newP);
}
}
//The is a boolean, when these booleans are true, they are activated and the background will change colour, and for the mad part, it will change strokes and stuff.
//This is the code I took from funprogramming for the background of random colours with the shapes.
if (orange){
float x = 0;
while (x < width) {
float y = 0;
while(y < height) {
fill(random(0,130), 255, 255); // I only changed this part for this "if" sentence.
ellipse(20 + x, 20 + y, 60, 60);
y = y + 40;
}
x = x + 40;
}
z = z + 0.02;
}
if (spring){
background(0,125,75); //I did this and the following 3 if sentences by myself. Some backgrounds are not used but it is an option for someone else to use a different colour, to take as reference.
}
if (winter){
// background(115,95,255);
background(150,215,255);
}
if (summer){
//background(220,40,40);
//background(255,115,0);
background(255,105,30);
}
if (autumn){
background(120,60,0);
}
//This is how the particles (which in this case are the circles), will be displayed and then when the size is small as zero, it gets removed.
for (int i=0; i<pts.size (); i++) {
Particle p = pts.get(i);
p.update();
p.display();
}
for (int i=pts.size ()-1; i>-1; i--) {
Particle p = pts.get(i);
if (p.dead) {
pts.remove(i);
}
}
}
//Here is what I mentioned when mouse is clicked, mousePressed is true.
void mousePressed(){
onPressed = true;
if (showInstruction) {
showInstruction = false;
orange = true; // Added by me. It will start as the background with shapes of random colours, for "party"
mad = true; // Added by me. And it will start as the circles with all random colours.
}
}
// When the mouse goes from clicked to nothing, the onPress will not work, and will shut down
void mouseReleased() {
onPressed = false;
}
//This part is if you press a key, then one specific boolean assigned to the key will be true, and the other ones will not be true. Further instructions in the bottoms states what happens when the booleans are true.
void keyPressed() {
if (key == 'p') { //I made all of this...
orange = true;
spring = false;
winter = false;
summer = false;
autumn = false;
mad = true;
springx = false;
winterx = false;
summerx = false;
autumnx = false;
}
if (key == 'a') {
spring = true;
orange = false;
winter = false;
summer = false;
autumn = false;
springx = true;
mad = false;
winterx = false;
summerx = false;
autumnx = false;
}
if (key == 'f') {
winter = true;
spring = false;
orange = false;
summer = false;
autumn = false;
winterx = true;
springx = false;
mad = false;
summerx = false;
autumnx = false;
}
if (key == 's') {
summer = true;
spring = false;
winter = false;
autumn = false;
orange = false;
summerx = true;
springx = false;
winterx = false;
autumnx = false;
mad = false;
}
if (key == 'd') {
autumn = true;
spring = false;
orange = false;
winter = false;
summer = false;
autumnx = true;
springx = false;
mad = false;
winterx = false;
summerx = false;
} //... until here
}
//This is the particles part. the particle(...) is how much they will move vertically and horrizontally, and how much they get smaller everytime.
class Particle {
PVector loc, vel, acc;
int lifeSpan, passedLife;
boolean dead;
float alpha, weight, weightRange, decay, xOffset, yOffset;
color c; //here it mentiones that the particle will the fill as "c"
Particle(float x, float y, float xOffset, float yOffset) {
loc = new PVector(x, y);
float randDegrees = random(360);
vel = new PVector(cos(radians(randDegrees)), sin(radians(randDegrees)));
vel.mult(random(5));
acc = new PVector(0, 0);
lifeSpan = int(random(30, 90));
decay = random(0.75, 0.9);
//Here I say what the value of c will be using booleans. (booleans - as I understand - is mainly used when you put a keypressed in the void keyPressed, but the result you want to see belong to somewhere else (e.g. void draw / particle)
if (mad) { //I added from here
c = color(random(0,255), random(0,255), random(0,255));
}
if (springx) {
//c = color(random(10,95),random(90,255),random(0,75));
c = color(random(45,130),random(120,255),random(0,75));
}
if (winterx) {
//c = color(95,random(115,255),255);
//c = color (random(0,106),random(170,230),random(220,255));
c = color(random(95,225),random(150,255),255);
}
if (summerx) {
//c = color(random(150,255), random(0,185), random(0,20));
//c = color(random(200,255), random(,200), random(0,20));
c = color(random(225,255),random(0,240),0);
}
if (autumnx) {
c = color(random(120,255),random(60,128),0);
} //to here
weightRange = random(3, 50);
this.xOffset = xOffset;
this.yOffset = yOffset;
}
void update() {
if (passedLife>=lifeSpan) {
dead = true;
} else {
passedLife++;
}
alpha = float(lifeSpan-passedLife)/lifeSpan * 70+50;
weight = float(lifeSpan-passedLife)/lifeSpan * weightRange;
acc.set(0, 0);
float rn = (noise((loc.x+frameCount+xOffset)*0.01, (loc.y+frameCount+yOffset)*0.01)-0.5)*4*PI;
float mag = noise((loc.y+frameCount)*0.01, (loc.x+frameCount)*0.01);
PVector dir = new PVector(cos(rn), sin(rn));
acc.add(dir);
acc.mult(mag);
float randDegrees = random(360);
PVector randV = new PVector(cos(radians(randDegrees)), sin(radians(randDegrees)));
randV.mult(0.5);
acc.add(randV);
vel.add(acc);
vel.mult(decay);
vel.limit(3);
loc.add(vel);
}
//This is to tell how a new circle comes out smaller each time.
void display() {
strokeWeight(weight+0.1);
stroke(c);
point(loc.x, loc.y);
}
}
//The changes usually have little difference from the original design. The image starts too big, so it doesn't show the whole image. I decided I would let it the way it is as I do not know how to fix it and I thought I could let it look like a powerpoint. I also made spring the biggest because green is the best for our eyes.
//I also changed the colour of the background for summer. I changed it from red to orange. It was because I found that red would be too bright and would sting people's eye, and is not pleasant. If the red was darker and less stinging, it doesn't feel like a red for summer.
//In my original plan, I had a dark blue included for winter, but I took it away as I thought the colours for winter should look more lighter like white snow.
//I also took away the purple from autumn because I did not think it fits autumn or contrasts with the background very well.
//I also changed the keys to change the season colour. Instead of using the first letter of seasons, I made it asdf for spring -> summer -> autumn -> winter relatively. I did it like that as I thought that is the order of seasons most people follow.
//I made p for party instead of m for mad or r for random or c for crazy. It is because I thought that I should give it an occasion or time like the seasons, so I thought party party party would be good.
//And I changed the name / title of this programme with some different pronunciation just to make it sound more interesting.
//I think the changes are small and it is about what I planned it to be. I have instructions with a season-pictures background that show at the beginning and will be gone when you start clicking or pressing.
//Also, the colours are pretty similar (red, yellow, and orange for summer / the mad or party one is pretty crazy, but that colour is laggy. However that cannot be fixed / green for spring, purple and light blue for winter, and orange and brown for autumn) as mentioned in the planning drawings.
//The circles do move in random directions like floating, while getting smaller and smaller. They also have a random-with-limits colours, and the same circle stay the same colour the whole time.
See More Shortcuts