there's no error with my code but then it keeps on showing a terminal window
public void addScore()
{
if(isTouching(NonBio.class))
{
counter.add(10);
}
}
java.lang.NullPointerException
at Kiwi.act(Kiwi.java:32)
at greenfoot.core.Simulation.actActor(Simulation.java:604)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:562)
at greenfoot.core.Simulation.runContent(Simulation.java:221)
at greenfoot.core.Simulation.run(Simulation.java:211)
java.lang.NullPointerException
at Kiwi.addScore(Kiwi.java:73)
at Kiwi.act(Kiwi.java:29)
at greenfoot.core.Simulation.actActor(Simulation.java:604)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:562)
at greenfoot.core.Simulation.runContent(Simulation.java:221)
at greenfoot.core.Simulation.run(Simulation.java:211)