Hi, I got a strange problem with my Arkanoid clone, whenever the ball hits a corner of the paddle it doesn't bounce off like expected:
https://media.giphy.com/media/vguZfLMc4eyiu3M7ls/giphy.gif
I already tried to fix it on several ways, one of them was:
/*I use the Collision class from Sonar Systems tutorial videos, although it happens with normal getGlobalBounds().intersects (and so on) collision check too.*/
else if (Collision::PixelPerfectTest(ball, paddle.getShape()))
{
if (!ball.getGlobalBounds().contains(paddle.getShape().getPosition().x, paddle.getShape().getPosition().y))
{
y_ballSpeed = -y_ballSpeed;
}
}
I wanted to check if the ball collides with the top left corner of the paddle (I could check every corner by adding some numbers above), if not it would normally bounce off, but it doesn't have any effect. The problem appears only if the ball hits a corner, except of that it works pretty well.