Просмотр исходного кода

Squashed 'jetpack_joyride/' changes from ffe7f179a..6e226f224

6e226f224 fixing some big bugs
49c48ceb2 move base pack here
REVERT: ffe7f179a rename game
REVERT: 45ae6f114 Rename app
REVERT: dfd514d4c Move jetpack joyride save
REVERT: 2e4dc9c1f Update README.md
REVERT: 660477c83 added readme
REVERT: 2f0d5a1b6 divided distance by 10
REVERT: c119197c5 aesthetic tweeks
REVERT: 3cd551699 set starting distance back to 0
REVERT: 136adfd02 tweeked game balance
REVERT: b9f49b4d0 points removed, it's coins now
REVERT: cbe4bdb4c shooting scientists no longer yields coins
REVERT: 345e0dca5 new endscreen
REVERT: 570d9c5e0 added persistent highscore
REVERT: 5cf257db6 refactor
REVERT: 8efb60f25 better agility
REVERT: c9f4083fb scientist improvements
REVERT: e38fdcf4d missile improvements
REVERT: 23f5973ce included sprite dimensions
REVERT: 1e64c2981 added missile alert sprite
REVERT: fc7e1cdca rework backgrounds
REVERT: ddc01d2c8 coin patterns
REVERT: 0e4afd5de updated background
REVERT: f418fcaf5 new background assets + workaround for semi-transparent assets
REVERT: 0d4a1fc1d add rolling background + bi-directional scientists
REVERT: 9a464804a add float point
REVERT: b17297329 fix colision particle vs scientist
REVERT: 3b2aba91a missiles!
REVERT: 299bf0bea fix dead scientist position
REVERT: 8733df650 enable bitmap transparency
REVERT: fac9bd169 fix particle spawn position
REVERT: 1d2154138 add missile assets
REVERT: e50eb229e improved assets
REVERT: 0d87ae5a8 Merge pull request #1 from timstrasser/refactor
REVERT: 9119e769e major refactor #1
REVERT: 347b3ed4a first implementation of scientists
REVERT: da417333c add particles
REVERT: 3864797ec collectable coins!
REVERT: 6d51b9931 Merge remote-tracking branch 'refs/remotes/origin/master'
REVERT: 03ae906b2 add random coins
REVERT: 3a117f44c fix Portal 3
REVERT: 09b7137e2 implement most basic jetpack functionality
REVERT: 5947a05a7 add 4k UHD graphics
REVERT: ac2ceb0ef macos things...
REVERT: 7ade00d6d first commit

git-subtree-dir: jetpack_joyride
git-subtree-split: 6e226f224b02d47d162f2bfa757161dc90ef19e6
Willy-JL 2 лет назад
Родитель
Сommit
6614955c16
10 измененных файлов с 18 добавлено и 46 удалено
  1. 0 4
      .gitignore
  2. 0 30
      README.md
  3. 2 2
      application.fam
  4. BIN
      docs/screenshots/gameplay.png
  5. 1 1
      includes/background_asset.c
  6. 1 1
      includes/background_assets.h
  7. 1 1
      includes/coin.c
  8. 1 1
      includes/missile.c
  9. 1 1
      includes/scientist.c
  10. 11 5
      jetpack.c

+ 0 - 4
.gitignore

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

+ 0 - 30
README.md

@@ -1,30 +0,0 @@
-# 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.

+ 2 - 2
application.fam

@@ -1,8 +1,8 @@
 # For details & more options, see documentation/AppManifests.md in firmware repo
 # For details & more options, see documentation/AppManifests.md in firmware repo
 
 
 App(
 App(
-    appid="jetpack_game",
-    name="Jetpack Game",
+    appid="jetpack_joyride",
+    name="Jetpack Joyride",
     apptype=FlipperAppType.EXTERNAL,
     apptype=FlipperAppType.EXTERNAL,
     entry_point="jetpack_game_app",
     entry_point="jetpack_game_app",
     cdefines=["APP_JETPACK_GAME"],
     cdefines=["APP_JETPACK_GAME"],

BIN
docs/screenshots/gameplay.png


+ 1 - 1
includes/background_asset.c

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

+ 1 - 1
includes/background_assets.h

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

+ 1 - 1
includes/coin.c

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

+ 1 - 1
includes/missile.c

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

+ 1 - 1
includes/scientist.c

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

+ 11 - 5
jetpack.c

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