We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I am new to Processing, so I may not understand things that may seem clear to experiences Processing users. I have trouble in resetting a timer : time = millis()/1000;
. I have tried using an if statement ( in the next comment), but I think it starts from the beginning of the program.
Can anyone help?
Answers
dX is the position of a horizontally moving image to the right, and by each level, the speed increases. Please point out my mistakes or improvements if I have any.
Can you post all your code? We need to be able to execute it to see what is your approach.
Kf
millis()
is always equal to time since the beginning of the sketch starting. Look at these statements from your code:In every case, you are doing the same thing -- setting a variable to the number of milliseconds since the sketch started. This is why your
if
statements have no effect.You need a pattern more like this (depending on the kind of timer you want, how you want to control it, whether start times or stop time or both are important, etc. etc.):
Thanks @jeremydouglass!!!! :)
I'm so happy now, thanks to everyone who helped me! :3 SC