This site requires JavaScript, please enable it in your browser!
Greenfoot back
Dsprt_Grenft_Usr_Neds_Hlp

Dsprt_Grenft_Usr_Neds_Hlp

Welcome to my page

Dsprt_Grenft_Usr_Neds_Hlp's scenarios

This user has not made any scenarios.

Dsprt_Grenft_Usr_Neds_Hlp's collections

This user has no collections

Recent Comments

Dsprt_Grenft_Usr_Neds_Hlp

2017/6/14

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 :)