現在、「Breakout」に似たゲームを開発中です。私が抱えている問題は、ボールがレンガの端を越えるたびに、レンガを取り除いたり、ボールの方向を変えたりしないことです。
if (ball.Left > l.Left && (ball.Left + ball.Width) < l.Left-margin + l.Width)
{
if (ball.Top > l.Height && ball.Top < l.Top)
{
this.Controls.Remove(l);
ballDX *= -1;
ballDY *= -1;
}
else if (ball.Top < l.Height && ball.Top > l.Bottom)
{
this.Controls.Remove(l);
ballDX *= +1;
ballDY *= +1;
}
}