Ejemplo n.º 1
0
        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);
                }
            }
        }
Ejemplo n.º 2
0
        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++;
                }
            }
        }
Ejemplo n.º 3
0
 public void addBall(Ball b)
 {
     Topcinja.Add(b);
 }