Skip to content

Commit

Permalink
Paddle: fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroBurner committed Oct 31, 2021
1 parent c3e8814 commit 14fb7ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/displayapp/screens/Paddle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ void Paddle::Refresh() {
if (ballX >= LV_HOR_RES - ballSize - 1) {
dx *= -1;
dy += rand() % 3 - 1; // add a little randomization in wall bounce direction, one of [-1, 0, 1]
if (dy > 5) // limit dy to be in range [-5 to 5]
if (dy > 5) { // limit dy to be in range [-5 to 5]
dy = 5;
if (dy < -5)
}
if (dy < -5) {
dy = -5;
}
}

// checks if it is in the position of the paddle
Expand Down

0 comments on commit 14fb7ab

Please sign in to comment.