1/12/2017 - Creating a glitchy throbber

Hello!

I created this throbber using basic shapes. Basically what happens is that when we move the mouse on the screen the eyes of this nice guy change colour gradually from white to black.




This is my code:

var value = 0;

function setup() {
  createCanvas(400, 400);
 
}

function draw() {
  background(204, 120);
   
    fill(0);
    arc(180, 250, 150, 150, 0, PI + QUARTER_PI, CHORD);
   
    fill(value);
     ellipse(100, 100, 80, 80);
   
    fill(value);
  ellipse(300, 100, 80, 80);
  
}   

function mouseMoved() {
  value = value + 5;
  if (value > 255) {
    value = 0;
  }

 } 



Byee,
Eleonora

Comments

Popular Posts