Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull main #2

Merged
merged 3 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# flipper-jetpack-joyride

`JETPACKS, ROCKETS, AND ADVENTURE AWAITS!`

![JETRIDE](docs/screenshots/gameplay.png)

## Jetpack Joyride Game Remake 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 Joyride" 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-joyride`.
- 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.
Binary file added docs/screenshots/gameplay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions jetpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
#include "includes/game_state.h"

#define TAG "Jetpack Joyride"
#define SAVING_DIRECTORY "/ext/apps/Games"
#define SAVING_FILENAME SAVING_DIRECTORY "/jetpack.save"
#define SAVING_FILENAME APP_DATA_PATH("jetpack.save")
static GameState* global_state;

typedef enum {
Expand All @@ -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;
Expand All @@ -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));
Expand Down