Skip to content

Commit

Permalink
adjust visual effect
Browse files Browse the repository at this point in the history
  • Loading branch information
ktpss95112 committed Aug 23, 2024
1 parent 3236175 commit 0fb085a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fw/Core/Hitcon/App/BouncingDVDApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ void BouncingDVD::update(int now) {

int new_x = x + dx;
int new_y = y + dy;
constexpr bool stop_on_border = false;
bool cross_border = false;
if (!(0 <= new_x && (new_x + FONT_WIDTH - 1) < DISPLAY_WIDTH)) {
dx = -dx;
if (!stop_on_border) x = x + dx;
cross_border = true;
}
if (!(0 <= new_y && (new_y + FONT_HEIGHT - 1) < DISPLAY_HEIGHT)) {
dy = -dy;
if (!stop_on_border) y = y + dy;
cross_border = true;
}
if (cross_border) {
Expand Down

0 comments on commit 0fb085a

Please sign in to comment.