Browse Source

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

Willy-JL 2 years ago
parent
commit
3d8067e921
5 changed files with 13 additions and 4 deletions
  1. 2 1
      game15/README.md
  2. 3 1
      game15/application.fam
  3. 7 1
      game15/game15.c
  4. BIN
      game15/img/1.png
  5. 1 1
      game15/sandbox.c

+ 2 - 1
game15/README.md

@@ -1,6 +1,8 @@
 
 # Game "15" for Flipper Zero
 
+[Original link](https://github.com/x27/flipperzero-game15)
+
 Logic game [Wikipedia](https://en.wikipedia.org/wiki/15_puzzle)
 
 ![Game screen](images/Game15.png)
@@ -9,4 +11,3 @@ Logic game [Wikipedia](https://en.wikipedia.org/wiki/15_puzzle)
 
 ![Popoup](images/Game15Popup.png)
 
-FAP file for firmware 0.69.1

+ 3 - 1
game15/application.fam

@@ -3,10 +3,12 @@ App(
     name="Game 15",
     apptype=FlipperAppType.EXTERNAL,
     entry_point="game15_app",
-    cdefines=["APP_GAME15"],
     requires=["gui"],
     stack_size=1 * 1024,
     fap_icon="game15_10px.png",
     order=30,
     fap_category="Games",
+    fap_author="@x27",
+    fap_version="1.1",
+    fap_description="Logic Game",
 )

+ 7 - 1
game15/game15.c

@@ -3,6 +3,7 @@
 #include <notification/notification.h>
 #include <notification/notification_messages.h>
 #include <storage/storage.h>
+#include <dolphin/dolphin.h>
 
 #include "sandbox.h"
 
@@ -423,6 +424,8 @@ static void game_event_handler(GameEvent const event) {
                     sandbox_loop_exit();
                 }
                 break;
+            default:
+                break;
             }
         }
     } else if(event.type == EventTypeTick) {
@@ -431,7 +434,6 @@ static void game_event_handler(GameEvent const event) {
 }
 
 static void game_alloc() {
-    srand(DWT->CYCCNT);
     key_stack_init();
     notification = furi_record_open(RECORD_NOTIFICATION);
     notification_message_block(notification, &sequence_display_backlight_enforce_on);
@@ -457,6 +459,10 @@ int32_t game15_app() {
 
     sandbox_init(
         FPS, (SandboxRenderCallback)render_callback, (SandboxEventHandler)game_event_handler);
+
+    // Call dolphin deed on game start
+    dolphin_deed(DolphinDeedPluginGameStart);
+
     sandbox_loop();
     sandbox_free();
     game_free();

BIN
game15/img/1.png


+ 1 - 1
game15/sandbox.c

@@ -46,8 +46,8 @@ void sandbox_loop() {
 
         if(sandbox_user_event_handler) sandbox_user_event_handler(event);
 
-        view_port_update(sandbox_view_port);
         furi_mutex_release(sandbox_mutex);
+        view_port_update(sandbox_view_port);
     }
 }