Kinect.Pong.Models.Paddle.DetermineMovement C# (CSharp) Method

DetermineMovement() private method

private DetermineMovement ( Ball ballToTrack ) : void
ballToTrack Ball
return void
        private void DetermineMovement(Ball ballToTrack)
        {
            //Move paddle towards ball
            if (ballToTrack != null)
            {
                if (ballToTrack.Position.Y > Position.Y + Height/2)
                {
                    SetDirection(_speed);
                }
                if (ballToTrack.Position.Y < Position.Y + Height/2)
                {
                    SetDirection(-_speed);
                }
            }
                //Don't move when not! tracking a ball
            else
            {
                _yVelocity = 0;
            }
        }