Updating draw with int
in
Programming Questions
•
2 years ago
I've been googling for hours upon end with no luck as of yet. I'm trying to make a simple countdown script and have it be reflected in a draw (the numbers keep writing over themselves right now). Here is my script so far; does anyone have any clue what I've screwed up?
Thanks in advance
Thanks in advance
- int c; //time
int cmin;
int csec;
int cmil;
int climit = 1;
int secs = 20; //Time in seconds
PFont arial6;
PFont freeSans;
int seconds;
void setup()
{
frameRate(1);
size(400, 250);
background(1);
arial6 = loadFont("Arial-BoldMT-16.vlw");
freeSans = loadFont("ArialMT-120.vlw");
fill(#EE0000);
}
void draw() {
c = (secs+2)*1000 - millis();
cmin = (c/(60*1000));
csec = (c/(1000));
cmil = c*00;
println("MIN: "+cmin+" SEC: "+csec+" MIL: "+cmil);
// seconds -= csec;
// String message = GetPlural(seconds, "second");
textFont(freeSans, 32);
text("LAUNCHING IN:",50,50);
textFont(freeSans, 48);
text(csec+" SECONDS",50,100);
//WAIT TO ZERO
if (csec == 0)
{
println("BOOM");
exit();
}
if (csec == 5 )
{
println("COMMITED");
}
}
1