if you look at your code in space you have got this
public void act()
{
if(Greenfoot.getRandomNumber(200)<10)
{addObject(new robot(), Greenfoot.getRandomNumber(700), 0); }
addObject(new rocket(), 300,500);
}
where you add the rocket that needs to be in the constructor instead of being in act like this.
public space()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(600, 600, 1);
setPaintOrder(scoreboard.class,robot.class,rocket.class,counter.class);
addObject(score,100,560);
addObject(new rocket(), 300,500);
}
that should work :P
Well idk if it was what you suggested or not but i decided to see if it had something to do with the rocket image so i changed the image and did what you said also and it works fine. Trying to upload the new version now
2012/5/7
2012/5/7
2012/5/7