summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Paddle.cpp
diff options
context:
space:
mode:
authorReinhold Gschweicher <pyro4hell@gmail.com>2021-09-09 20:50:43 (GMT)
committerReinhold Gschweicher <pyro4hell@gmail.com>2021-10-11 19:46:19 (GMT)
commit7cd4929bfdb7f82778af8c3f6fed5fb107f1152b (patch)
tree660a1d053c51e27e24751916862bc1b2b60581ab /src/displayapp/screens/Paddle.cpp
parent91b2e50252f488b490ce6659293d633b029c34c7 (diff)
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.
Diffstat (limited to 'src/displayapp/screens/Paddle.cpp')
-rw-r--r--src/displayapp/screens/Paddle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp
index 3b6d60e..26c2368 100644
--- a/src/displayapp/screens/Paddle.cpp
+++ b/src/displayapp/screens/Paddle.cpp
@@ -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;
}