Playing games now affect Flipper's level

All games now will increase flipper's level when you start them or win in some of them

Games with endless play like tetris or flappy bird has no winning logic so they will increase level only when you start them
This commit is contained in:
MX
2023-02-05 15:39:10 +03:00
parent 246dcdb23f
commit 72f250195c
12 changed files with 50 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
#include <gui/gui.h>
#include <input/input.h>
#include <storage/storage.h>
#include <dolphin/dolphin.h>
#include "digits.h"
#include "array_utils.h"
@@ -382,7 +383,7 @@ int32_t game_2048_app() {
ValueMutex state_mutex;
if(!init_mutex(&state_mutex, game_state, sizeof(GameState))) {
FURI_LOG_E("SnakeGame", "cannot create mutex\r\n");
FURI_LOG_E("2048Game", "cannot create mutex\r\n");
free(game_state);
return 255;
}
@@ -397,6 +398,9 @@ int32_t game_2048_app() {
Gui* gui = furi_record_open(RECORD_GUI);
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
// Call dolphin deed on game start
DOLPHIN_DEED(DolphinDeedPluginGameStart);
bool is_finished = false;
while(!is_finished) {
FuriStatus event_status = furi_message_queue_get(event_queue, &input, FuriWaitForever);