Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 20;
- myLine[] lines = new myLine[num];
- color bg = #C02942;
- color f = #ECD078;
- color s = #006666;
- float y, theta, diam;
- float speed = .3;
- float diam1=1;
- float diam2 = 0;
- boolean grow1 = true;
- boolean grow2 = true;
- void setup() {
- size(300, 300);
- background(bg);
- noStroke();
- diam1= 0;
- for (int i=0; i<lines.length; i++) {
- float _y = i*(height/num);
- lines[i]= new myLine(_y);
- }
- }
- void draw() {
- background(bg);
- fill(f);
- if (grow1) diam1 +=4;
- if (diam1 > width*.75) grow1 = false;
- ellipse(width/2, height/2, diam1, diam1);
- for (int i=0; i<lines.length; i++) {
- lines[i].display();
- }
- fill(#542437);
- ellipse(width/2, height/2, diam2, diam2);
- if (frameCount > 90 && grow2==true) {
- diam2 += 30;
- }
- else {
- diam2 -= 3*.9;
- }
- if (diam2 > diam1+10) {
- grow2 = false;
- diam1 = 0;
- }
- if (diam2 < 1) diam2 =0;
- //if (frameCount % 4 == 0) saveFrame("line-###.gif");
- //if (frameCount > 211) noLoop();
- }
- class myLine {
- float y;
- myLine(float _y) {
- y = _y;
- }
- void display() {
- strokeWeight(8);
- stroke(bg);
- y -= speed;
- if (y < 0) y = height;
- line(0, y, width, y);
- noStroke();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement