proce55or

Untitled

Feb 5th, 2014
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. /* This code creates a picture of expanding "star".
  2.  Based on 'Fun Programming' video tutorials
  3.  */
  4.  
  5.  
  6. float r = 0;
  7.  
  8. void setup() {
  9.   size(600, 600);
  10.   background(0);
  11.   smooth();
  12.   noStroke();
  13. }
  14.  
  15. void draw() {
  16.   translate(width/2, height/2);
  17.   rotate(r);
  18.   fill(random(255), 0, random(10, 100), 60);
  19.   float circle_size = random(5, 8);
  20.   //change parameters below to get different versions of the image
  21.   quad(100 + r, 10, circle_size, circle_size, 0, cos(r), 100, 10);
  22.   r = r + 0.9;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment