Hello, I want to make a function where the location and color of the square change every 8 seconds.
This function must be executed once every eight seconds. However, it will continue to run for 8 seconds, so I want to solve this problem.
How should I use the time?
if ((int)ofGetElapsedTimef() != 0 && (int)ofGetElapsedTimef() % 8 == 0) {
for (int i = 0; i < 17800; i++)
{
randomA[i] = 0;
}
index += 1;
zpos = -300;
a = 255;
}