private float x1, y1, x2, y2;
void setup()
{
size(600, 800);
PImage img = loadImage("CityNight.jpg");
image(img, 0, 0);
noStroke();
colorMode(HSB);
frameRate(30);
rectMode(CENTER);
for (int i=0; i<10; i++) {
fill(255, 100);
rect(random(120, width-120), random(120, height-120), 30, random(50, 100));
}
}
void draw()
{
if (frameCount<100) {
fill(random(20, 80), random(50, 170), random(40, 170), 150);
x1 = random(120, width - 120);
y1 = random(120, height - 120);
x2 = random(10, 30);
y2 = random(20, 40);
rect(x1, y1, x2, y2);
}
}
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .