示例#1
0
        public bool BolaEntrou(Ball ball)
        {
            bool entrou = false;

            if (ball.Direcao == Ball.DirecaoBola.Descendo)
                if ((ball.BallPosition.Y >= (340) && (ball.BallPosition.Y <= (350))) && ball.BallPosition.X >= this.copoLocation.X - 20 && ball.BallPosition.X <= (this.copoLocation.X + 60))
                {
                    ball.Status = GameStatus.BolaEntrou;
                    entrou = true;
                }

            return entrou;
        }
        public Copo ChecarBola(Ball ball)
        {
            foreach (var copo in copos)
            {
                if (copo.BolaEntrou(ball))
                {
                    Debug.WriteLine("ENTROU NO COPO: " + copo.Nome);
                    return copo;
                }
            }

            return null;
        }