Hiya I'm doing a screensaver in BlueJ .. and i have made few circles but need to make a loop so that new circles get created at random points although i m not sure how to do it.. this is how much i have done.
public class ScreenSaver
{
// instance variables - replace the example below with your own
private Circle a;
private Circle b;
private Circle c;
private Circle d;
/**
* Constructor for objects of class ScreenSaver
*/
public ScreenSaver()
{
// initialise instance variables
//x = 0;
}
public void draw()
{
a = new Circle();
a.moveVertical(70);
a.changeSize(70);
a.slowMoveVertical(-100);
a.makeVisible();
b= new Circle();
b.changeColor("red");
b.moveHorizontal(30);
b.makeVisible();
b.slowMoveVertical(-100);
b.slowMoveVertical(100);
}
How do I get to make loops so that new circles get created at random points?