Hi.
I have this bit of code in my constructor for a world
and it should create three object of the class spider, but only creates one. Does sombody know why this is happening? I'm fairly new to programming, so i think the solution will be very simple
public void startGame() { Fly fly = new Fly(); addObject(fly , getWidth()/2 +100, getHeight()/2); BarLife barLife = new BarLife(200 , fly); addObject(barLife , 112 , 15); Enemy spider = new Spider(); for(int i=0 ; i<3 ; i++) { int x = Greenfoot.getRandomNumber( getWidth() ); int y = Greenfoot.getRandomNumber( getHeight() ); addObject(spider , x , y); } }