PROCESSING__ practicing integers, transactions, arrays, for loops and if statements (studio V – mill of time)

MILL OF TIME I::

IMAGES::

senyera001 senyera019 senyera033 senyera055 senyera314

VIDEO::

CODE::

color[] P={ #c42a2a, #091ff0,#f0ed09,#ffffff };
void setup(){
size(800,400);
background(255);

}
int r=32;
int q=2;

void draw(){

translate(width/2, height/2);
rotate(r);
fill(255,30);
rect(0,0,width,height);
noStroke();
for(int d=10;d<height; d=d+1){

house(d,d,P[int(random(P.length))]);
}

r=r+10;

rotate(q);
busca();

q=q+1;

}
void busca(){

for(int y=0; y<height/2; y=y+4){
triangleA(0,y);

}

}

void house(float x, int y, color c){
fill(c);
rect(x+10,y+35,30,30);

}

void triangleA(int x, int y){
fill(0);
noStroke();
triangle(x, y, x+20, y, x+10, y+20);

}


MILL OF TIME II::

IMAGES::

rellotge003 rellotge021 rellotge036 rellotge053 rellotge068 rellotge185 rellotge200 rellotge241 rellotge320 rellotge342

VIDEO::

CODE::


color[] P={ #c42a2a, #091ff0,#f0ed09,#ffffff };
void setup(){
size(800,400);
background(255);

}
int r=32;
int q=2;

void draw(){

calendar();

translate(width/2, height/2);
rotate(r);
fill(255,30);
rect(0,0,width,height);
noStroke();
for(int d=10;d<height; d=d+1){

house(d,d,P[int(random(P.length))]);
}

r=r+10;

rotate(q);
busca();

q=q+1;

}
void busca(){

for(int y=0; y<height/2; y=y+4){
triangleA(0,y);

}

}

void house(float x, int y, color c){
fill(c);
rect(x+10,y+35,30,30);

}

void triangleA(int x, int y){
fill(0);
noStroke();
triangle(x, y, x+20, y, x+10, y+20);

}

void calendar(){
String ye= str(year());
String mo= str(month());
String d= str(day());
String h= str(hour());
String m= str(minute());
String s= str(second());
String time = ye +”/”+ mo + “/” + d + ” ” + h +”:” + m + “:” + s;

if(mouseX<width/2){
fill(P[int(random(P.length))]);

}
else{
fill(0);
}
textSize(30);
text(time,mouseX,mouseY);
}
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