Advertisement
xeromino

Emo circle

Oct 8th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. float y;
  2. float speed = .5;
  3.  
  4. void setup() {
  5.   size(500, 500);
  6.   background(bg);
  7.   noStroke();
  8.  
  9.   for (int i=0; i<lines.length; i++) {
  10.     float _y = i*(height/num);
  11.     lines[i]= new myLine(_y);
  12.   }
  13. }
  14.  
  15. void draw() {
  16.   background(bg);
  17.   fill(f);
  18.   ellipse(width/2, height/2, 300, 300);
  19.   for (int i=0; i<lines.length; i++) {
  20.     lines[i].display();
  21.   }
  22. }
  23. class myLine {
  24.   float y;
  25.  
  26.   myLine(float _y) {
  27.     y = _y;
  28.   }
  29.  
  30.   void display() {
  31.     strokeWeight(15);
  32.     stroke(bg,80);
  33.     y -= speed;
  34.     if (y < 0) y = height;
  35.     line(0, y, width, 10);
  36.   }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement