This site requires JavaScript, please enable it in your browser!
Greenfoot back
Navique
Navique wrote ...

2018/4/11

What does this error mean?

1
2
Navique Navique

2018/4/11

#
danpost wrote...
Okay. Change your Replay codes (what is shown above) to this:
public class Replay extends Actor
{
    public void act()
    {
        if (Greenfoot.mouseClicked(this)) {
           Gameover goWorld = (Gameover) getWorld();
           counter counter = goWorld .getCounter();
           Greenfoot.setWorld(new CalamityBeginning(counter.returnCount()));
        }
    }
}
Thanks for the help! I've copied this code to another button, but I get a NullPointerException. Could you help out? Here is the code:
public class BacktoCal extends Actor
{
    private counter theCounter;
    public void act()
    {
        
           if (Greenfoot.mouseClicked(this)) {
           CreditsScreen goWorld = (CreditsScreen) getWorld();
           counter counter = goWorld .getCounter();
           Greenfoot.setWorld(new CalamityBeginning(counter.returnCount()));
        }
        
    }
    //v
    
}
danpost danpost

2018/4/11

#
And the error output is ...
Navique Navique

2018/4/12

#
danpost wrote...
And the error output is ...
Never mind, I fixed the issue. Thank you for your time.
You need to login to post a reply.
1
2