For this assignment I went for something fairly simple. My idea was to create a rainy day image with a moving cloud image that would float around by manipulating the mouse. I was able to get a nice backdrop of rain falling with the help of some videos. Initially, I wanted to download a cloud image , but I ended up using the white block instead to act as a moving cloud . The yellow circle was placed in the top left corner simply to emulate the sun. I wish I was able to explore a little bit more with the use of moving images. For future projects thats something I would like to incorporate and get better at .
Drop [] drops = new Drop[600];
void setup() {
size(1000, 500);
for (int i = 0; i < drops.length; i++) {
drops[i] = new Drop();
}
}
void draw() {
background(169, 200, 232);
for (int i = 0; i < drops.length; i++) {
drops[i].show();
drops[i].fall();
fill(255, 251, 116);
ellipse(100, 60, 70, 70);
fill(253, 255, 250);
rect(mouseX, mouseY, 60, 60);
}
}
class Drop {
float x = random(width);
float y = random(-400, -50);
float z = random (0, 20);
float len = map(z, 0, 20, 10, 20);
float yspeed = map(z, 0, 20, 1, 20);
void fall() {
y = y + yspeed;
//yspeed = yspeed + 0.3;
if (y > height) {
y = random(-200, -100);
yspeed = map(z, 0, 20, 4, 10);
}
}
void show() {
float thick = map(z, 0, 20, 1, 3);
strokeWeight(thick);
stroke(57, 43, 201);
line(x, y, x, y+len);
}
}
videos: https://www.youtube.com/watch?v=KkyIDI6rQJI