My game is 800x800. It has a rocket and if it gets hit by an asteroid, it appears in a random location. What is the code for that?
if (getObjects(Rocket.class).isEmpty())
{
int x = Greenfoot.getRandomNumber(getWidth());
int y = Greenfoot.getRandomNumber(getHeight());
addObject(new Rocket(), x, y);
}