Parcourir la source

Merge reversi from https://github.com/xMasterX/all-the-plugins

Willy-JL il y a 2 ans
Parent
commit
15e29c4e39
5 fichiers modifiés avec 9 ajouts et 4 suppressions
  1. 4 0
      reversi/application.fam
  2. 5 4
      reversi/game_reversi.c
  3. BIN
      reversi/img/1.png
  4. BIN
      reversi/img/2.png
  5. BIN
      reversi/img/3.png

+ 4 - 0
reversi/application.fam

@@ -12,4 +12,8 @@ App(
     fap_icon="game_reversi.png",
     fap_category="Games",
     fap_icon_assets_symbol="game_reversi",
+    fap_author="@dimat",
+    fap_weburl="https://github.com/zyuhel/flipperzero-racegame",
+    fap_version="1.2",
+    fap_description="Reversi game, the game controls should be intuitive. Longs press on OK opens the menu to start a new game.",
 )

+ 5 - 4
reversi/game_reversi.c

@@ -38,10 +38,9 @@ static void input_callback(InputEvent* input_event, void* ctx) {
 
 static void draw_callback(Canvas* const canvas, void* ctx) {
     furi_assert(ctx);
-
     const AppState* app_state = ctx;
     furi_mutex_acquire(app_state->mutex, FuriWaitForever);
-    if(app_state == NULL) return;
+
     const GameState* game_state = &app_state->game;
 
     canvas_clear(canvas);
@@ -326,16 +325,18 @@ int32_t game_reversi_app() {
                 furi_mutex_acquire(app_state.mutex, FuriWaitForever);
                 app_state.selected_menu_item = 0;
                 app_state.screen = AppScreenMenu;
-                view_port_update(view_port);
+                
                 furi_mutex_release(app_state.mutex);
+                view_port_update(view_port);
                 continue;
             }
             if(input.type != InputTypePress) continue;
 
             furi_mutex_acquire(app_state.mutex, FuriWaitForever);
             is_finished = !handle_key(&app_state, input.key);
-            view_port_update(view_port);
+
             furi_mutex_release(app_state.mutex);
+            view_port_update(view_port);
         }
         view_port_update(view_port);
     }

BIN
reversi/img/1.png


BIN
reversi/img/2.png


BIN
reversi/img/3.png