I am developing a game that functions like space invaders. so far I have the enemies spawning in a for loop like this:
for (var a=0; a<6; a++)
{
var bd:MovieClip = new bdenemy();
enemy1[a] = bd;
addChild(enemy1[a]);
enemy1[a].x = 50 + Math.random() * 700;
enemy1[a].y = 50;
}
however when i run the game the enemies just spawn in those parameters, overlapping most of the time. how can i make it so that each new enemy is a set x distance from the previous one, using an array like this? Thanks.