I’ve created a bouncing ball and want to randomize the color of the ball with each hit against the size perimeter. However, with the following code it will only randomize the color once and stay that color (filler is the randomized color).
if (xpos > width-rad || xpos < rad || ypos > height-rad || ypos < rad) {
fill(filler);
}
I’m pretty sure it has something to do with the fact that it has fulfilled one of the conditions and therefor remains that one color. I just don’t know how to work around it. I’ve tried with “else if” for each of the conditions, but that does not work either.