jeudi 13 avril 2023

Variables using "random()" change everytime they are called

void draw() {
z = float(random(255));
x = float(random(255));
c = float(random(255));
background(z, x, c);
delay(500);
background(c, x, z);
}

I want the z, x, and c variables to not change upon being called into the 2nd background() command, but can't quite figure it out.

I tried making other variables, using frameRate(1), and moving the delay(500) command past the 2nd background(), but unfortunately the variables change upon being called the 2nd time, and i want them to keep their value until the next void draw() loop.




Aucun commentaire:

Enregistrer un commentaire