Not working for me :(
Compiling works, no errors getting returned.
But if a shot hits an asteroid it says:
-------------------------------------------------------------------------------------
java.lang.NullPointerException
at Shot.hitAnAsteroid(Shot.java:58)
at Shot.act(Shot.java:34)
at greenfoot.core.Simulation.actActor(Simulation.java:594)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:552)
at greenfoot.core.Simulation.runContent(Simulation.java:215)
at greenfoot.core.Simulation.run(Simulation.java:205)
--------------------------------------------------------------------------------------------------
private void hitAnAsteroid() {
Space spaceWorld = (Space) getWorld(); // get a reference to the world
XX Counter counter = spaceWorld.getCounter(); // get a reference to the counter XX
counter.bumpCount(5); }
--------------------------------------------------------------------------------------------------
that´s the code, the line marked with X´s is supposedly containing the error... but i dont get it
Any help appreciated :)
Recent Comments
2017/6/14
tut-access-p2