I'm trying to duplicate the Astro invaders (Stern) version. This a work in early progress. I'm hung up,
where I'm trying to have the first invader 'ship' appear @ the top of the screen and begin movement in a
downward direction. It sort of works (but not the way I think it should).
What I did is created one ship, located it in the starting position, and it moves down to a certain determined
level.
My problem is the control (PictureBox) appears in the correct position and moves down (Black color...) and
at the right level turns 'Yellow'. I'm trying to get to appear 'Yellow' before it starts it's downward movement.
This is my current code. Not sure how to have code show up in a certain format/view on this forum.
where I'm trying to have the first invader 'ship' appear @ the top of the screen and begin movement in a
downward direction. It sort of works (but not the way I think it should).
What I did is created one ship, located it in the starting position, and it moves down to a certain determined
level.
My problem is the control (PictureBox) appears in the correct position and moves down (Black color...) and
at the right level turns 'Yellow'. I'm trying to get to appear 'Yellow' before it starts it's downward movement.
This is my current code. Not sure how to have code show up in a certain format/view on this forum.
public Timer ship_m = new Timer(); public int i = 0; public int x = 527; public int y = 0; public int t = 0; public int shipDwn = 1; public PictureBox ship = new PictureBox(); // int gunX = 571; int gunY = 540; private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { for (i = 0; i < 5; i++) { drawship(); Timer ship_m = new Timer(); for (y = 0; y < 68; y++) { ship_m.Enabled = true; ship_m.Interval = 1; ship.Location = new Point(x, y + shipDwn); // //ship_m.Enabled = false; for (t = 0; t < (5000000 * 3); t++) ; // } } } private void drawship() { ship.Size = new Size(31, 12); ship.Location = new Point(x, y); ship.BorderStyle = BorderStyle.FixedSingle; ship.BackColor = Color.Yellow; this.Controls.Add(ship); ship.Show(); }