PROCESSING__ practicing integers, transactions, arrays and for loops (studio IV – apocalypse)

IMAGES::

apocalipsis001 apocalipsis020 apocalipsis118 apocalipsis204 apocalipsis297 apocalipsis544 apocalipsis547

VIDEO::

CODE::


color[] P={ #eb5050, #e67012, #fcac22, #aa5903};
void setup(){
size(800,400);
background(255);

}
int r=32;
int n=30;

void draw(){
translate(width/2,height/2);
rotate(r);

fill(255,33);
noStroke();
rect(0,0,width,height);
for(float i=0;i<width; i=i+40 + random(-5,5)){
house(i,20,int(random(0,255)));
}
r=r+1;
fill(P[int(random(P.length))]);
ellipse(0,0,n,n);

n=n+2;

saveFrame(“apocalipsis###.png”);
}
void house(float x, int y, color c){
fill(c);
triangle(x+25,y+20,x+10,y+35,x+40,y+35);
rect(x+10,y+35,30,30);
rect(x+22,y+50,10,15);

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s