I’m only guessing that it has something to do with the fact that the moving circles are changing size, that it somehow makes the triangle do so as well.
How would I go about keeping the triangle at a fixed size? (917, y, 950, y-15, 950, y+15)
flake[] flake = new flake[30];
float speed = 10;
int x, y;
void setup(){
size(1000,800);
for(int i = 0; i < flake.length; i++){
flake[i] = new flake();
}
}
void draw(){
background(50);
x = mouseX;
y = mouseY;
display();
for(int i = 0; i < flake.length; i++){
flake[i].show();
flake[i].update();
}
}
void display() {
fill(0,255,0);
triangle(917, y, 950, y-15, 950, y+15);
}
class flake{
float y=random(height);
float x=random(-width);
float z = random(20, 100);
float size=map(z, 1, 30, 3, 20);
float speed=map(z, 1, 30, 0.1, 1);
void show(){
stroke(255);
strokeWeight(size);
point(x,y);
}
void update() {
x+=speed;
if(x>width) reset();
}
void reset(){
y = random(height);
x = random(-width,0);
z = random(20,100);
size=map(z,1,29,3,30);
speed=map(z,1,29,0.1,1);
}
}