Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
//This is a character from the Kirby games. I do not own Dark Matter.

void setup () {
 //window size
  size(400,400);
}

void draw () {
  //framerate will be 60
  frameRate(60);
 
  //dark blue background (outer space)
  background(0,0,55);
  ellipseMode(CENTER);
  
  //Starting from line 14, these stars will be in the background
 
  //star one
  fill(250,250,0,100);
  ellipse(40 + (mouseX * 0.35),40,20,20);
  
  //star two 
  fill(250,250,0,70);
  ellipse(360 + (mouseX * 0.5),40,30,30);
  
  //star three
  fill(250,250,0,45);
  ellipse( 160 + (mouseX * 0.2),320,25,25);
  
  //star four
  fill(250,250,0,120);
  ellipse( -60 + (mouseX * 0.4), 160, 30,30);
  
  //Star five
  fill(250,250,0,120);
  ellipse( -100 + (mouseX * 0.4), 240,20,20);
  
  //star six
  fill(250,250,0,70);
  ellipse( 225 + (mouseX * 0.45), 120, 25,25);
  
  //Star seven 
  fill(250,250,0,90);
  ellipse( 440 + (mouseX * 0.5), 133, 30,30);
  
  //star eight
  fill(250,250,0,50);
  ellipse( 400 + (mouseX * 0.6), 75, 25,25);
  
  //star nine
  fill(250,250,0,80);
  ellipse( 380 + (mouseX *1.2),325, 30,30);
  
  //star ten
  fill(250,250,0,90);
  ellipse( 300 + (mouseX *0.7),275, 30,30);
  
  //star Eleven
  fill(250,250,0,40);
  noStroke();
  ellipse( -10 + (mouseX *0.3),151, 15,15);
  
  //star twelve
  fill(250,250,0,110);
  ellipse( -30 + (mouseX *1.2),70, 40,40);
  
  //the orange pellet's on Dark Matter's body
  
  //Orange pellet one
  fill(255,148,0);
  ellipse(300,300,90,90);
  
  //Orange pellet two
  fill(255,148,0);
  ellipse(320,200,90,90);
  
  //Orange pellet three
  fill(255,148,0);
  ellipse(300,100,90,90);
  
  //Orange pellet four
  fill(255,148,0);
  ellipse(200,80,90,90);
  
  //Orange pellet five
  fill(255,148,0);
  ellipse(100,100,90,90);
  
  //Orange pellet six
  fill(255,148,0);
  ellipse(80,200,90,90);
  
  //Orange pellet seven
  fill(255,148,0);
  ellipse(100,300,90,90);
  
  //Orang pellet eight
  fill(255,148,0);
  ellipse(200,320,90,90);
  
  //Dark matter's main body parts
  
  //Main Body
  fill(0);
  ellipse(200,200,220,220);
  
  //white of the eye
  fill(255);
  ellipse(200,200,120,90);
  
  //Eye pupil
  fill(0);
  ellipseMode(CENTER);
  ellipse(185 + (mouseX * 0.2) - 25, 205 + (mouseY * 0.1)- 25, 40,40);
  
  //bright part of orange pellets
  
  //shade one
  
  fill(255,175,50);
  ellipse(300,300,45,45);
  
  //shade two
  
  fill(255,175,50);
  ellipse(335,200,45,45);
  
  //Shade three
  fill(255,175,50);
  ellipse(300,100,45,45);

  //shade four
  fill(255,175,50);
  ellipse(200,65,45,45);
   
  //shade five 
  fill(255,175,50);
  ellipse(100,100,45,45);
  
  //shade six
  fill(255,175,50);
  ellipse(65,200,45,45);
  
  //shade seven
  fill(255,175,50);
  ellipse(100,300,45,45);
  
  //shade eight
  fill(255,175,50);
  ellipse(200,335,45,45);
  
  //main body shade
  fill(35);
  ellipse(200,120,80,40);
  
  //star in front one
  fill(250,250,0,170);
  noStroke();
  ellipse(200 + (mouseX * 0.9),200,60,60);
  
  //star in front two
  fill(250,250,0,190);
  noStroke();
  ellipse(175 + (mouseX * 1.9),60,60,60);
  
  //star in front three
  fill(250,250,0,190);
  noStroke();
  ellipse(-60 + (mouseX * 1.5),369,60,60);
  
  //star in front four
  
  fill(250,250,0,190);
  noStroke();
  ellipse(0 + (mouseX * 0.9),0,60,60);
  
  //star in front five
  
  fill(250,250,0,190);
  noStroke();
  ellipse(-140 + (mouseX * 1),240,60,60);
  
  //star in front six
  
  fill(250,250,0,190);
  noStroke();
  ellipse(-240 + (mouseX * 1.1),60,60,60);
  
  //star in fornt seven
  
  fill(250,250,0,190);
  noStroke();
  ellipse(-140 + (mouseX * 0.9),400,60,60);
  
  //star in front eight
  
  fill(250,250,0,190);
  noStroke();
  ellipse(-140 + (mouseX * 1.6),65,60,60);
}
  //eye lid will appear when mouse is clicked for a bit
  
  void mousePressed(){
  frameRate(1);
  fill(0);
  ellipseMode(CENTER);
  ellipse(200,140,120,80);
  
  //main body shade
  fill(35);
  ellipse(200,120,80,40);
  
  }