So I started learning processing about 3 days ago, and I realy enjoyed what the program can do so far I know. But this morning I started working with arrays and objects and I couldnt figure out why my code wasnt working. If someone can please fix my code and also explain what I did wrong I would realy apriciate that <3
I want this code to make some ellipces on the screen
code:
Bubble[] b = new Bubble[10];
void setup() {
size(600, 600);
for (int i = 0; i < 10; i++) {
b[i] = new Bubble(i + 1,i,100);
}
}
void draw() {
background(20);
fill(255);
for(int i = 0; i < 10; i++){
b[i].display();
}
}
class Bubble {
float x, y, size;
Bubble(float thisx, float thisy, float thissize) {
x = thisx;
size = thissize;
y = thisy;
}
void display() {
fill(20);
ellipse(x + 10, y + 10, size, size);
}
}