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

2017/3/19

helppppp

bdbornilla bdbornilla

2017/3/19

#
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); } }
davmac davmac

2017/3/19

#
and what does it say in the terminal window...?
bdbornilla bdbornilla

2017/3/20

#
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)
Super_Hippo Super_Hippo

2017/3/20

#
It seems like 'counter' is null and not the counter in your world.
You need to login to post a reply.