I have a timer on my screen that counts down which works fine. However, when the program does the method Greenfoot.ask(), the timer stops counting down. The timer continues to count down only when the user's input is finally done.
I want the timer to continue counting down while the Greenfoot.ask() method is still going. Is there a way to do this? So for example this is what it would look like.
public MyWorld()
{
super(600, 400, 1);
addObject(new Timer(), 500, 500);
addObject(new UserInput(), 200, 200);
}
public class Timer extends Actor
{
private int time = 180;
public void act()
{
setImage(new GreenfootImage("" + time, 20, Color.WHITE, Color.BLACK));
time--;
}
}
public class UserInput extends Actor
{
public void act()
{
String input = Greenfoot.ask(".......");
}
}
