Wednesday 13 April 2011

Progress so far.

To begin my application I setup my page size, background colour etc. I then created the circle and line by using void Draw. To control the placement of each line and cirlce I have used the mouseX and mouseY function.

Here is a screen shot of what the code came up with -














I now need to work out how to make each circle be clicked to where I want it to go and stay, because I don't want to circles and line to follow everywhere the mouse goes. Only where it is clicked, is where it should stay.


This is the code for this piece of my application:

void setup(){
 size(500,500);
 background(255);
}

void draw(){
  strokeWeight(3);
  stroke(0);
  smooth();
  line(mouseX,mouseY,250,500);
  ellipse(mouseX,mouseY,30,30);


} 

No comments:

Post a Comment