これはアルカノイドのボール衝突の私のコードです:
Rectangle intersection = Rectangle.Intersect(block.Rect2D, ball.BallRec);
if (intersection.Width > intersection.Height)
{
ball.yVel = -ball.yVel;
}
else if (intersection.Width < intersection.Height)
{
ball.xVel = -ball.xVel;
}
else
{
ball.xVel = -ball.xVel;
ball.yVel = -ball.yVel;
}
残念ながら、特に高速の場合、ボールはブロックに「溶けて」奇妙に跳ね返ることがあります。どうすれば修正できますか?