Sunday, August 30, 2015

Pre Lab3 - Balloon

void setup(){
 size(300, 300);
}

void draw(){
  background(#000000);
  int posX = mouseX;
  int posY = mouseY;
   if(posY<100){
   fill(#DD0000); //change color red
  }
  else if(posY>200){
   fill(#00DD00); //change color green
  }
  else fill(#000000); //change color clear
  draw_ballon(posX ,posY);
}

void draw_ballon(int posX, int posY){
 ellipse(posX ,posY, 50, 50);
 stroke(#FFFFFF);
 line(posX ,posY+25, posX, posY+75);
}
 

No comments:

Post a Comment