Hey guys I was hoping some of you here may know how to help me with this problem I'm having where I have created picture boxes that are aliens in a game of space invaders and they move from left to right down once then right to left just like traditional space invaders.
My problem is that when they move, they are moving in a snake formation rather than as a whole unit, its like they just run in a big zig zag shape overlapping each other, I have been trying to figure out how to move them all down at once. I have my code for the move method at the bottom of this post, if anyone can give me any advice or tips I would greatly appreciate that!!!
Thanks a lot!!!
public override void Move()
{
if ((position.X < boundary.Width -50) && (counter == 0))
{
position.X += 1;
picture.Location = position;
}
else if ((position.X == boundary.Width - 50) && (counter == 0))
{
position.Y = position.Y + 50;
counter++;
picture.Location = position;
} else if ((position.X > 0) && (counter == 1))
{
position.X -= 1;
picture.Location = position;
}
else if ((position.X == 0) && (counter == 1))
{
position.Y = position.Y + 50;
counter--;
picture.Location = position;
}
}
// aliens move from right to left then moving down and to the right etc....
}