Processing Animation V2

WARNING: VIDEO BELOW AS MANY FLASHING COLORS, DO NOT WATCH IF YOU ARE PRONE TO SEIZURES!

I have redone my Processing animation. The changes I made to not only the size of the screen and the motion of the shapes is that if a hold down on the mouse, the colors of the shapes will change.

The Code for this animation is provided below:float circleX = 0;
float circleY = 0;
float circleW = 50;
float circleH = 100;
float circleStroke = 255;
color circleFill;
float backgroundColorR = 20;
float backgroundColorG = 255;
float backgroundColorB = 124;
float change = 0.5;
boolean randomColor;
float triX1 = 1280;
float triX2 = 1000;
float triX3 = 730;
float triY1 = 0;
float triY2 = 300;
float triY3 = 60;
float squareX = 640;
float squareY = 720;
float squareW = 60;
float squareH = 60;
color triColor;
color rectFill;
void setup() {
size(1280,720);
smooth();
}
void draw() {
background(backgroundColorR,backgroundColorG,backgroundColorB);
stroke(circleStroke);
fill(rectFill);
rectMode(CENTER);
rect(squareX,squareY,squareW,squareH);
fill(circleFill);
if (randomColor == true) {
circleFill = color (random(255),random(255),random(255));
}
ellipse(circleX,circleY,circleW,circleH);
fill(triColor);
triangle(triX1,triY1,triX2,triY2,triX3,triY3);
circleX = circleX + change * 2;
circleY = circleY + change;
circleW = circleW – change;
circleH = circleH + change;
circleStroke = circleStroke – change;
triX1 = triX1 – change;
triX2 = triX2 – change / 7;
triX3 = triX3 – change * 3;
triY1 = triY1 + change *2;
triY2 = triY2 + change;
triY3 = triY3 + change / 4;
triColor = circleFill / 7;
squareX = squareX + change / 50;
squareY = squareY – change;
squareW = squareW – change * 2;
squareH = squareH – change * 3;
rectFill = circleFill / 20;
}
void mousePressed() {
randomColor = true;
}
void mouseReleased() {
randomColor = false;
}

Advertisements

About degrafgo

I am a fun, green loving guy who owns 3 YouTube channels under the name DeGraphics.
This entry was posted in Lectures & Workshops, Time Based 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