I am getting the error that it doesn't recognize the variable timerText in act(), but it works in prepare()? any suggestions?
(in prepare()) Text timerText = new Text(); addObject(timerText,80,558); timerText.setText("Time left: " + (timer/60));
public class MyWorld extends World { private int timer = 1800; public MyWorld() { super(1000, 600, 1); prepare(); act(); } public void act() { if (timer>0){ timer--; if (timer%60==0) timerText.setText("Time left: " + (timer/60)); if (timer == 0) Greenfoot.setWorld(new TitleWorld()); } }