Explorar el Código

Revert "Merge jetpack_joyride from https://github.com/xMasterX/all-the-plugins"

This reverts commit 59e505954bbf66428f5b2565f69c4b9e39d0b11f, reversing
changes made to d9db5623dae27ae6ec4749d35043a29a2e72a1da.
Willy-JL hace 2 años
padre
commit
da54845f30

+ 4 - 0
jetpack_joyride/.gitignore

@@ -0,0 +1,4 @@
+dist/*
+.vscode
+.clang-format
+.editorconfig

+ 30 - 0
jetpack_joyride/README.md

@@ -0,0 +1,30 @@
+# flipper-jetpack-game
+
+`JETPACKS, ROCKETS, AND ADVENTURE AWAITS!`
+
+![JETRIDE](docs/screenshots/gameplay.png)
+
+## Game Remake of Jetpack Joyride for Flipper Zero
+- Recreated based on the classic Jetpack Joyride game for Flipper Zero.
+- Get ready for a thrilling ride filled with obstacles, coins, and of course, jetpacks!
+
+### Usage
+
+- Start the "Jetpack Game" plugin and navigate Barry through the lab with your jetpack.
+
+### Build
+
+- Recursively clone your base firmware (official or not).
+- Clone this repository in `applications_user`.
+- Build with `./fbt fap_dist APPSRC=applications_user/flipper-jetpack-game`.
+- Retrieve the built fap in the dist subfolders.
+
+For more information about the build tool, check [here](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/fbt.md).
+
+### Credits
+
+- Original Game: Jetpack Joyride by Halfbrick Studios.
+
+---
+
+Feel free to raise an issue or contribute to the project! Your feedback helps make the game better for everyone.

BIN
jetpack_joyride/docs/screenshots/gameplay.png


+ 1 - 1
jetpack_joyride/includes/background_asset.c

@@ -1,4 +1,4 @@
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 
 #include "background_assets.h"
 

+ 1 - 1
jetpack_joyride/includes/background_assets.h

@@ -9,7 +9,7 @@
 #include "point.h"
 #include "states.h"
 #include "game_sprites.h"
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 
 #define BG_ASSETS_MAX 3
 

+ 1 - 1
jetpack_joyride/includes/coin.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 #include <gui/gui.h>
 
 #include "coin.h"

+ 1 - 1
jetpack_joyride/includes/missile.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 #include <gui/gui.h>
 
 #include "states.h"

+ 1 - 1
jetpack_joyride/includes/scientist.c

@@ -1,7 +1,7 @@
 #include "scientist.h"
 #include "game_sprites.h"
 
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 #include <gui/gui.h>
 
 void scientist_tick(SCIENTIST* const scientists) {

+ 5 - 11
jetpack_joyride/jetpack.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 
-#include <jetpack_joyride_icons.h>
+#include <jetpack_game_icons.h>
 #include <furi.h>
 #include <gui/gui.h>
 #include <gui/icon_animation.h>
@@ -17,9 +17,8 @@
 
 #include "includes/game_state.h"
 
-#define TAG "Jetpack Joyride"
-#define SAVING_DIRECTORY "/ext/apps/Games"
-#define SAVING_FILENAME SAVING_DIRECTORY "/jetpack.save"
+#define TAG "Jetpack Game"
+#define SAVING_FILENAME APP_DATA_PATH("jetpack.save")
 static GameState* global_state;
 
 typedef enum {
@@ -41,6 +40,7 @@ static SaveGame save_game;
 
 static bool storage_game_state_load() {
     Storage* storage = furi_record_open(RECORD_STORAGE);
+    storage_common_migrate(storage, EXT_PATH("apps/Games/jetpack.save"), SAVING_FILENAME);
     File* file = storage_file_alloc(storage);
 
     uint16_t bytes_readed = 0;
@@ -55,12 +55,6 @@ static bool storage_game_state_load() {
 static void storage_game_state_save() {
     Storage* storage = furi_record_open(RECORD_STORAGE);
 
-    if(storage_common_stat(storage, SAVING_DIRECTORY, NULL) == FSE_NOT_EXIST) {
-        if(!storage_simply_mkdir(storage, SAVING_DIRECTORY)) {
-            return;
-        }
-    }
-
     File* file = storage_file_alloc(storage);
     if(storage_file_open(file, SAVING_FILENAME, FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
         storage_file_write(file, &save_game, sizeof(SaveGame));
@@ -360,8 +354,8 @@ int32_t jetpack_game_app(void* p) {
             }
         }
 
-        furi_mutex_release(game_state->mutex);
         view_port_update(view_port);
+        furi_mutex_release(game_state->mutex);
     }
 
     furi_timer_free(timer);