Greenfoot Terminal Window:
java.lang.NullPointerException
at AvoiderWorld.act(AvoiderWorld.java:37)
at greenfoot.core.Simulation.actWorld(Simulation.java:600)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:535)
at greenfoot.core.Simulation.runContent(Simulation.java:215)
at greenfoot.core.Simulation.run(Simulation.java:205)
In game when enemy is spawned it should add 5 points this is part of the source code
theCounter.addScore(5) is 37.
public void act()
{
if(Greenfoot.getRandomNumber(1000) < 20)
{
Negativac e = new Negativac();
addObject(e, Greenfoot.getRandomNumber(getWidth()-20)+10, - 30);
theCounter.addScore(5);
}
}
