Im trying to spawn several enemys but my problem is that only 1 row spawns and even if i change the y coordinate in the second one If() they spawn on the edges, so 9 of them spawn although u can clearly see its +xss which means they should after 1 spawned move about 30 pixels on the x axes in one direction
I thought i could just use another if() inside the for() and as soon as they reached a certain x position they would change the Y coordinate +20 . but getX() is not possible in (myWorld)

private void prepare()
{
Player player = new Player();
addObject(player,1,1);
player.setLocation(296,788);
int xs = 0;
int xss = 0;
for(int i = 0; i < 10; i++){
xs = xs + 50;
Invader invader = new Invader();
addObject(invader,345,366);
invader.setLocation(1+xs,363);
}
for(int i = 0; i < 10; i++){
xss = xss + 1;
Invader invader = new Invader();
addObject(invader,345,366);
invader.setLocation(1+xss,393);
}
}