10.2

Moons [] array Offullmoon = new Moon [9];

void setup(){
size(700, 700);
for(int i = 0; i < array Of-fullmoon.length; i++){
arrayOffullmoon [i] = new Suns(color (random(0, 225)), int (random(0, width)), int (random(0, height)), int (random(50, 100)), int (random(50, 100)));

}
}

void draw(){

background(208,234,180);

for(int i = 0; i < array of-fullmoon.length; i++) {
array[i].display();
}

}

class Moons {
int w;
int h;
int moonColor;
int xpos;
int ypos;

Moons(color tempColor, int _xpos, int _ypos, int _w, int _h){
w = _w;
h = _h;
moonColor = tempColor;
xpos = _xpos;
ypos = _ypos;
}

void display(){
fill(moonColor);
ellipse(xpos, ypos, w, h);
}

}

Print this page
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *