Could you please help me create a timer of 60 seconds .
// In Constructor
private boolean TimerStart = false; // used to start the timer, set off by another method... i.e. TimerStart = true;
private int Timer 3600; // 60x60 (60 ticks, 60 seconds)
...
if (TimerStart == true)
{
Timer--; // Or Timer = Timer - 1;
if (Timer <= 0)
{
// Do whatever happens when the timer runs out here... or just remove it :P
}
}
// field
private int countdown = 3600;
// in act
if (countdown > 0 && --countdown == 0)
{
// game over code here
}// field
private int countdown = 3600;
// in act
if (countdown > 0 && --countdown == 0)
{
// game over code here
}