Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DefinetlyNotAI authored May 14, 2024
1 parent 305e00c commit 70557ce
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions slotmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ static void highscores_save() {
furi_record_close(RECORD_STORAGE);
}


void game_results(SlotMachineApp* app) {
int matches[] = {0, 0, 0, 0, 0};
int matches[] = { 0, 0, 0, 0, 0 };
double total = 0;

for (int i = 0; i < COLUMNS_COUNT; i++) {
Expand All @@ -88,10 +89,16 @@ void game_results(SlotMachineApp* app) {
}

if (total > 0) {
app->money += total;
app->money += total; // Add winnings to the player's money
app->winamount = total;
app->winview = true;

// Add the bet amount back to the player's money
app->money += app->bet;

// Reset the bet amount
app->bet = 0;

if (total > highscore.highscore) {
highscore.highscore = total;
highscores_save();
Expand All @@ -103,6 +110,7 @@ void game_results(SlotMachineApp* app) {
}
}


void draw_container(Canvas* canvas) {
canvas_draw_rframe(canvas, 2, 12, 120, 34, 3);
canvas_draw_rframe(canvas, 2, 13, 120, 34, 3);
Expand Down

0 comments on commit 70557ce

Please sign in to comment.