/**************************************************************************//** * @author Paul Blasi, Caitlin Taggart * * @par Description: * The action a ball is to take when it collides with the right paddle * * @param[in] col - the type of collision that occurred * *****************************************************************************/ void BallCollideWithRightPaddle(CollisionTypeEnum col) { BALL.BounceOffPaddle(col); float ratio = ((RIGHT_PLAYER.Center.Y - BALL.Center.Y) / (RIGHT_PLAYER.Center.Y - RIGHT_PLAYER.Y_Max())); BALL.BounceOffPaddle(ratio); if (RIGHT_PLAYER.X_Vel() <= 0) { if (RIGHT_PLAYER.Velocity() > BALL.Velocity()) { BALL.IncreaseSpeed((RIGHT_PLAYER.Velocity() - BALL.Velocity()) / 3); } else { BALL.DecreaseSpeed(-1 * (RIGHT_PLAYER.Velocity() - BALL.Velocity()) / 3); } } if (LAST_PADDLE_COLLISION != "Right") { LEFT_PLAYER.ReduceSize(); RIGHT_PLAYER.ReduceSize(); } LAST_PADDLE_COLLISION = "Right"; }