Skip to content

Commit

Permalink
feat: randomize start position
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomoferretti committed Nov 26, 2023
1 parent a469b47 commit 95055ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dvd_logo.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ int32_t dvd_logo_app(void* p) {

// Init state
DvdLogoState* dvd_logo_state = malloc(sizeof(DvdLogoState));
dvd_logo_state->position.x = 0; //rand() % MAX_WIDTH;
dvd_logo_state->position.y = 0; //rand() % MAX_HEIGHT;
dvd_logo_state->stepX = -1; //rand() % MAX_WIDTH;
dvd_logo_state->stepY = -1; //rand() % MAX_HEIGHT;
dvd_logo_state->position.x = rand() % MAX_WIDTH;
dvd_logo_state->position.y = rand() % MAX_HEIGHT;
dvd_logo_state->stepX = (rand() % 2) ? 1 : -1;
dvd_logo_state->stepY = (rand() % 2) ? 1 : -1;
dvd_logo_state->notifications = furi_record_open(RECORD_NOTIFICATION);
dvd_logo_bounce(dvd_logo_state);

Expand Down

0 comments on commit 95055ec

Please sign in to comment.