private void IntervalTick(object sender, EventArgs e) { foreach (Invader Invader in Invaders) { Invader.MoveDown(); } SpelPaneel.Invalidate(); }
private void OnClick(object sender, EventArgs e) { Point point = SpelPaneel.PointToClient(Cursor.Position); if (point.X < 90) { int Center = Invaders[0].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[0].Hit(); } } else if (point.X < 180) { int Center = Invaders[1].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[1].Hit(); } } else if (point.X < 270) { int Center = Invaders[2].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[2].Hit(); } } else if (point.X < 360) { int Center = Invaders[3].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[3].Hit(); } } else if (point.X < 450) { int Center = Invaders[4].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[4].Hit(); } } else if (point.X < 540) { int Center = Invaders[5].Positie + 25; if (point.Y > Center - 10 && point.Y < Center + 55) { Invaders[5].Hit(); } } }