Hi Iām very new to programming so excuse if this is an easy question, but why is only one of my particles showing up (p2)?
Thanks in advance
Particle p1;
Particle p2;
void setup() {
size(600,400);
p1 = new Particle(300,200,80);
p2 = new Particle(70,70,100);
}
void draw() {
background(0);
p1.display();
p2.display();
}
float x, y;
float r;
class Particle {
Particle(float tempX, float tempY, float tempR) {
x = tempX;
y = tempY;
r = tempR;
}
void display() {
fill(255,0,0);
ellipse(x,y,r*2,r*2);
}
}