We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to implement a timer into my code so that after a certain time it restarts. However, I want the timer to be hidden until it reaches the last three seconds.
So far, I know I should use else and else if, and I'm working on a pseudocode kind of thing. I would like to know if I'm on the right track!
I have a class called Timer, and inside I have a void restart. In void restart, I have if ((timeSoFar == 5){ start(); }
Then in the main code, I call it in void draw. However, whenever it reaches 5, it does not restart but instead keeps counting. I have declared timeSoFar as 0. The code works when I use KeyPressed but I can't seem to make it do it automatically. Before I move onto it showing for the last three seconds, I want to make the timer go by itself.
Any help is appreciated! Thank you.
Answers
It is nice to describe your code, but it would be nicer to show it... If it is too long or off-topic, try to isolate the code specific to the timer in a simpler sketch.
Thank you TfGuy44 and PhiLho for your help and inquiry! TfGuy44 has helped me with the timer.
Have a good day!