Skip to content

Commit 7cd4929

Browse files
committed
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.
1 parent 91b2e50 commit 7cd4929

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/displayapp/screens/Paddle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ void Paddle::Refresh() {
4747
dy *= -1;
4848
}
4949

50-
// checks if it has touched the side (left side)
51-
if (ballX >= LV_VER_RES - ballSize - 1) {
50+
// checks if it has touched the side (right side)
51+
if (ballX >= LV_HOR_RES - ballSize - 1) {
5252
dx *= -1;
5353
}
5454

0 commit comments

Comments
 (0)