Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function setup() {
  2.     var canvas = createCanvas(800, 600);
  3.     canvas.parent('container');
  4.     frameRate(60);
  5.     x = random(1, 184); // [1, 184]
  6.     console.log("x = " + x);
  7.     y = x + 36; // x + 36
  8.     console.log("y = " + y);
  9.    
  10.     xb = random(x, y-11); // [x, y-11]
  11.     console.log("xb = " + xb);
  12.     yb = xb + 4;
  13.     console.log("yb = " + yb);
  14. }
  15.  
  16. function draw() {
  17.     background(25);
  18.  
  19.     angleMode(DEGREES); // using degrees not radian
  20.     translate(400, 300); // origin is the middle of the canvas;
  21.     noFill();
  22.     strokeWeight(4);
  23.  
  24.     stroke(color("#595959")); // gray
  25.     ellipse(0, 0, 150, 150); // gray ellipse
  26.  
  27.     strokeWeight(10);
  28.     stroke(color(255, 255, 255)); // white
  29.     arc(0, 0, 150, 150, x, y); // white outline
  30.     stroke(color(0, 0, 0)); // black
  31.     strokeWeight(8);
  32.     arc(0, 0, 150, 150, x, y); // black arc
  33.  
  34.     strokeWeight(10);
  35.     stroke(color(255, 255, 255)); // white
  36.     arc(0, 0, 150, 150, xb, yb); // white arc
  37.  
  38.     stroke(color(173, 6, 6)); // red
  39.     strokeWeight(4);
  40.     rotate(frameCount*3);
  41.     line(0, -65, 0, -90); // red dot
  42.    
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement