Labels

Monday, 14 May 2012

DSDN 142 - Development

Here I have played around with different versions of my idea! I personally dont like this because its not really interactive but still its a experiment..

CODE:
 float ob1 = 10;
float ob2 = 10;
void setup(){
  size(500,500);
 
}
 
  void draw(){
      background(255);
    
      Myobject();
      ob1 = ob1 +((mouseX-ob1)/10.0);
      ob2 = ob2 +((mouseY-ob2)/10.0);
  }
     
      void Myobject(){
        ellipse(ob1,ob1,ob2,ob2);
        ob1 = ob1+ (mouseX-ob1)/10.0;
        ob2 = ob2+ (mouseY-ob2)/10.0;
    
      }
     
      Maybe with this code I could create a 'keypressed' action, and when you press the key the ellipse races around the screen, I also want to incopirate when the mouse touches the the ellipse the ellipse avoids it. And i could even introduce more ellipse's, and the can act like balls floating. And then I could make the ellipse's bounce of each other and trying to avoid each other in a playful fashion.

No comments:

Post a Comment