So I took a look at the links you guys wrote down here, and this is what I got down....
class Time
{
float seconds= 300;
void start()
{
if(time <0)
{
println("gameover");
}
}
}
but I still can't seem to understand how to make time go to zero...
I had written some class similar to what you seem to want. You need an update function inside your class. This will be called each time through draw and here you will check total time passed.
Start function should just set the start time. Of course, you will use millis() unless you want much higher level unnecessary over here.
Answers
What code do you have to display the one on the console?
Kf
A search in the forum provides some previous examples:
https://forum.processing.org/two/search?Search=countdown
Of interest,
https://forum.processing.org/two/discussion/16874/countdown-timer-once-the-time-is-set/p1
Kf
http://studio.SketchPad.cc/sp/pad/view/ro.9Djm2xo4wna7I/latest
So I took a look at the links you guys wrote down here, and this is what I got down.... class Time { float seconds= 300; void start() { if(time <0) { println("gameover");
} } }
but I still can't seem to understand how to make time go to zero...
I had written some class similar to what you seem to want. You need an update function inside your class. This will be called each time through draw and here you will check total time passed.
Start function should just set the start time. Of course, you will use millis() unless you want much higher level unnecessary over here.