Hi. When I run my scenario, instead of waiting until the space bar is pressed, my bullet is summoned. it then stays where it is until it despawns. I get this error(my bullet is called Bomb):
java.lang.NullPointerException
at Bomb.act(Bomb.java:39)
at greenfoot.core.Simulation.actActor(Simulation.java:567)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:530)
at greenfoot.core.Simulation.runContent(Simulation.java:193)
at greenfoot.core.Simulation.run(Simulation.java:183)
I have absolutely no idea what is wrong. it says this is wrong:
particularly the line:
Thanks :)
if(life <= 0)
{
getWorld().removeObject(this);
}
else
{
life--;
}getWorld().removeObject(this);

