Anyone know how to add a limit to a counter that displays a success message when reached
OR
a time limit counting down from a specified time that when reached displays a "time out" message?
int counter; //the counter you are using;
int counterLimit; //the limit of the counter;
public void act() {
if (counter >= counterLimit) {
//the winner message;
//or whatever you want in this case;
}
}//in the act mehtod;
if (counter < counterMax) {//counter counts up every act and counterMax is the number of acts you want for the time;
counter++;
}
else {
//time up;
}