Ejemplo n.º 1
0
        private void CalculateNewBallPosition(ref BallInfo bi)
        {
            bi.Left += bi.DirectionX;
            if (bi.Left >= MAX_X || bi.Left <= 0)
            {
                bi.DirectionX *= -1;
                bi.Left       += bi.DirectionX;
            }

            bi.Top += bi.DirectionY;
            if (bi.Top >= MAX_Y || bi.Top <= 0)
            {
                bi.DirectionY *= -1;
                bi.Top        += bi.DirectionY;
            }
        }
 private void _positionCalculator_OnBallInfoCallback(int id, BallInfo bi)
 {
     Clients.All.updateBallInfo(id, bi);
 }