Alright as you said, I redid it without rectMode(CENTER);
I redid the bricks, they seem to be ok for now but I now have a problem between the paddle and the ball, the collision only happens on the edges of the paddle.
As you said, I should adapt this
if ((xPaddle - Paddle) < xBalle && (xPaddle + Paddle) > xBalle &&
(yPaddle - 10) < yBalle && (yPaddle) > yBalle) {
// Si la balle rebondit sur le paddle, inverse la vitesse
ySpeed = - ySpeed;
}
not forgetting
and remember then the paddle is touched by ball at px … px + pw // py - ball_r
But it is not making any difference when I try to adapt the paddle. Am I doing it wrong? How should it be then?
Thank you!