xeromino

sketch02_b

Oct 17th, 2016
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function setup() {
  2.   createCanvas(900, 600);
  3.   background(50, 100, 150);
  4. }
  5.  
  6. function draw() {
  7.   // no background statement here = more and more ellipses on the screen
  8.   // select a random color
  9.   fill(random(255), random(255), random(255));
  10.   // add a 4th value to change the transparency
  11.   // fill(random(255), random(255), random(255),150);
  12.   // set stroke to white
  13.   stroke(255);
  14.   //set the width of the stroke to 2 pixels
  15.   strokeWeight(2);
  16.   // use noStroke() to remove the stroke
  17.   // noStroke();
  18.   // use noFill() to remove the surface fill
  19.   // noFill();
  20.  
  21.   // drawing an ellipse at a random location
  22.   ellipse(random(width), random(height), 50, 50);
  23.  
  24. }
  25.  
  26. function keyTyped() {
  27.   // save screen as JPG image in the sketch folder
  28.   // frameCount is the number of frames having been shown up to the point when you pressed a key
  29.   save(frameCount + ".jpg");
  30. }
Add Comment
Please, Sign In to add comment