xxxxxxxxxx
/*------------------------
Final - Radar
Created 4/17
Kali Johnston
SP 2017
knjohnston0704@gmail.com
---------------------------*/
float s=1; //scale
float r=0; //rotation
void setup(){
size(600,600);
background(0);
rectMode(CENTER);
frameRate(24);
}
void draw(){
//background
fill(0,30);
translate(300,300);
rect(0,0,width,height);
resetMatrix();
//center squares
translate(300,300);
rotate(r);
fill(#55D86A,40);
rect(0,0,100,100,15);
fill(#44D399,50);
rect(40,40,100,100,15);
//tail squares
fill(0,random(255),random(255));
rect(100,100,10,10);
rect(120,120,15,15);
rect(150,150,20,20);
rect(180,180,25,25);
resetMatrix();
r =r+0.05;
//expanding and contracting circles
noFill();
stroke(180);
strokeWeight(.5);
translate(width/2, height/2);
ellipse(0, 0, 50, 50); //center ellipse
//outer circles, s is percentage to scale circles. Negative pulls in, positive pushes out
scale(1-s);
ellipse(0, 0, 50, 50);
scale(3-s);
ellipse(0, 0, 50, 50);
scale(1+s);
ellipse(0, 0, 50, 50);
//conditions of scaling
s+=.1;
if (s>5) { //if s is greater than five set s to .1
s=.1;
}
}