Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int num = 25;
- myLine[] lines = new myLine[num];
- color bg = #000000;
- color f = #00CCCC;
- color s = #006666;
- float y, theta, diam;
- float speed = .4;
- void setup() {
- size(500, 500);
- background(bg);
- for (int i=0; i<lines.length; i++) {
- float _y = i*(height/num);
- lines[i]= new myLine(_y);
- }
- }
- void draw() {
- background(bg);
- fill(f);
- stroke(s);
- strokeWeight(3);
- ellipse(width/2, height/2, 300, 300);
- for (int i=0; i<lines.length; i++) {
- lines[i].display();
- }
- fill(bg);
- stroke(f);
- strokeWeight(20);
- diam = map(sin(theta), -1, 1, 100, 200);
- ellipse(width/2, height/2, diam, diam);
- theta += .03;
- }
- class myLine {
- float y;
- myLine(float _y) {
- y = _y;
- }
- void display() {
- strokeWeight(10);
- stroke(bg);
- y -= speed;
- if (y < 0) y = height;
- line(0, y, width, y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement