Coding: Three Objects

screen-shot-2016-09-08-at-11-13-48-pm

The above is just a still image of an animation on the program Proccessing 3. The code for this is down below.

float circleX = 0;
float circleY = 0;
float circleW = 50;
float circleH = 100;
float circleStroke = 255;
float circleFill = 0;
float backgroundColor = 255;
float change = 0.5;
//triangle boy
float triangleboi =700;
float trianglegurl=200;
float triangleB = 650;
float triangleH = 205;
float triangleT = 625;
float triangleFF= 238;
float tricolor = (255/4);
float trichange =0.7;
//quads
float quadX = 400;
float quadY = 457;
float quadT= 123;
float quadR = 476;
float quadG = 101;
float quadJ = 121;
float quadI = 184;
float quadH = 256;
float quadchange =0.9;
float quadcolor = 0;
float quadcolor2= 0;
float colorful = (255);
//southpark
float cartman = 0;
float kyle = 40;
float stan = 30;
float kenny = 0;
float randy =600;
float chef = 0.9;
// Your basic setup
void setup() {
size(720,480);
smooth();
}
void draw() {
background(backgroundColor);
// rect
colorful = random(255);
fill(colorful);
rect (quadG,quadJ,quadT,quadI);
quadG = quadG + quadchange;
quadJ = quadJ + quadchange;
quadT = quadT+ quadchange;
quadI = quadI + quadchange;
stroke(circleStroke);
fill(circleFill);
ellipse(circleX,circleY,circleW,circleH);
// Change the values of all variables
circleX = circleX + change;
circleY = circleY + change;
circleW = circleW + change;
circleH = circleH – change;
circleStroke = circleStroke – change;
circleFill = circleFill + change;
//tri
stroke(tricolor);
fill(tricolor,100,255);
triangle(triangleboi,trianglegurl,triangleB,triangleH,triangleT,triangleFF);
// stuff
triangleboi = triangleboi – trichange;
trianglegurl = trianglegurl – trichange;
triangleB = triangleB + trichange;
triangleH = triangleH + trichange;
triangleT= triangleT + trichange;
triangleFF = triangleFF + trichange;
tricolor = tricolor – trichange + change;
tricolor = random(255);
// quad
fill(quadcolor);
stroke(quadcolor2);
quad (quadX,quadY,quadT,quadR,quadG,quadJ,quadI,quadH);
quadX = quadX – quadchange;
quadY = quadY + quadchange;
quadT= quadT + quadchange+trichange;
quadR = quadR + quadchange;
quadG = quadG – quadchange;
quadJ = quadJ – quadchange-quadchange;
quadI = quadI + quadchange;
quadH = quadH – quadchange;
quadcolor = quadcolor + quadchange;
stroke(0);
colorful = random(255);

fill(colorful);
ellipse (300,300,70,70);
// southpark
fill(cartman,kyle,stan,kenny);
rect(cartman,kyle,90,50);
cartman = cartman + chef;
fill(quadcolor,quadcolor2,cartman);
rect(stan,kenny,20,150);
kenny = kenny + chef;
rect(randy,kenny,50,65);
kenny=kenny+chef;
quadcolor= random(255);
randy = random(255);
}

Advertisements
This entry was posted in Timebased and tagged , . Bookmark the permalink.

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