I'm trying to have an actor access a method written in the world class, but I'm receiving a cannot find symbol-message error. Any idea what the problem is ?
public class GameCounter extends Actor
{
public int numberCorrect;
public int getNumberCorrect()
{
return numberCorrect;
}
public void checkNumberCorrect()
{
if (getNumberCorrect()==1)
{
World world = getWorld();
world.endGame();
}
}
}
public class MyWorld extends World
{
public void endGame()
{
showText("Score:" + score.getScore() + "/16", getWidth()/2, getHeight()/2);
Greenfoot.stop();
}
}
