I want to the missile to be added to the world every 2000 milliseconds. I wrote this to do it:
I know its already simple, but is there a way to simplify it further?
if(Greenfoot.isKeyDown("space")) { if(shoot) { world.addObject(missile,getX()+25,getY()); delay = timer+1000; shoot = false; } } if(delay <= timer) { shoot = true; }