Paddle: compare ballX coordinate with horizontal resolution
Fix the comment as the comparison checks if the ball is at the right side of the screen. Compare the x coordinate of the ball with the horizontal resolution of the screen, instead of the vertical resolution. On the PinePhone this does make no difference as we have square 240x240 screen. Change it anyways to be completely correct.
This commit is contained in:
parent
91b2e50252
commit
7cd4929bfd
|
@ -47,8 +47,8 @@ void Paddle::Refresh() {
|
|||
dy *= -1;
|
||||
}
|
||||
|
||||
// checks if it has touched the side (left side)
|
||||
if (ballX >= LV_VER_RES - ballSize - 1) {
|
||||
// checks if it has touched the side (right side)
|
||||
if (ballX >= LV_HOR_RES - ballSize - 1) {
|
||||
dx *= -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue