public void Click(int x, int y) { foreach (var ball in Topcinja) { ball.move(new Point(ball.Center.X + Velocity, ball.Center.Y)); if (ball.isHit(x, y)) { ball.State++;; } } for (int i = 0; i < Topcinja.Count; i++) { if (Topcinja[i].State == 3) { Hit++; Topcinja.RemoveAt(i); } } }
public void Move() { foreach (var ball in Topcinja) { ball.move(new Point(ball.Center.X + Velocity, ball.Center.Y)); if (ball.Center.X >= Width) { ball.State = -1; } } for (int i = 0; i < Topcinja.Count; i++) { if (Topcinja[i].State == -1) { Topcinja.RemoveAt(i); Misses++; } } }