mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-19 11:21:39 +03:00
Playing games now affect Flipper's level
All games now will increase flipper's level when you start them or win in some of them Games with endless play like tetris or flappy bird has no winning logic so they will increase level only when you start them
This commit is contained in:
parent
246dcdb23f
commit
72f250195c
@ -5,6 +5,7 @@
|
||||
#include <gui/view.h>
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define TAG "Arkanoid"
|
||||
|
||||
@ -397,6 +398,9 @@ int32_t arkanoid_game_app(void* p) {
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
GameEvent event;
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
|
@ -571,6 +571,8 @@ int32_t blackjack_app(void* p) {
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
AppEvent event;
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
for(bool processing = true; processing;) {
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "level.h"
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define SOUND
|
||||
|
||||
@ -989,6 +990,9 @@ int32_t doom_app() {
|
||||
music_player_worker_load_rtttl_from_string(plugin_state->music_instance->worker, dsintro);
|
||||
music_player_worker_start(plugin_state->music_instance->worker);
|
||||
#endif
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
PluginState* plugin_state = (PluginState*)acquire_mutex_block(&state_mutex);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <gui/gui.h>
|
||||
#include <gui/icon_animation_i.h>
|
||||
#include <input/input.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define TAG "Flappy"
|
||||
#define DEBUG false
|
||||
@ -307,6 +308,9 @@ int32_t flappy_game_app(void* p) {
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
GameEvent event;
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <storage/storage.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "sandbox.h"
|
||||
|
||||
@ -461,6 +462,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();
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <gui/gui.h>
|
||||
#include <input/input.h>
|
||||
#include <storage/storage.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "digits.h"
|
||||
#include "array_utils.h"
|
||||
@ -382,7 +383,7 @@ int32_t game_2048_app() {
|
||||
|
||||
ValueMutex state_mutex;
|
||||
if(!init_mutex(&state_mutex, game_state, sizeof(GameState))) {
|
||||
FURI_LOG_E("SnakeGame", "cannot create mutex\r\n");
|
||||
FURI_LOG_E("2048Game", "cannot create mutex\r\n");
|
||||
free(game_state);
|
||||
return 255;
|
||||
}
|
||||
@ -397,6 +398,9 @@ int32_t game_2048_app() {
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
bool is_finished = false;
|
||||
while(!is_finished) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &input, FuriWaitForever);
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <notification/notification.h>
|
||||
#include <notification/notification_messages.h>
|
||||
#include <gui/canvas_i.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define Y_FIELD_SIZE 6
|
||||
#define Y_LAST (Y_FIELD_SIZE - 1)
|
||||
@ -530,6 +531,9 @@ int32_t heap_defence_app(void* p) {
|
||||
game->game_status = 0;
|
||||
game->animation = AnimationPause;
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
GameEvent event = {0};
|
||||
while(event.input.key != InputKeyBack) {
|
||||
if(furi_message_queue_get(event_queue, &event, 100) != FuriStatusOk) {
|
||||
|
@ -8,6 +8,8 @@
|
||||
#include <dialogs/dialogs.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "assets.h"
|
||||
|
||||
#define PLAYFIELD_WIDTH 16
|
||||
@ -255,6 +257,9 @@ static bool game_won(Minesweeper* minesweeper_state) {
|
||||
dialog_message_set_buttons(message, NULL, "Play again", NULL);
|
||||
dialog_message_set_icon(message, NULL, 72, 17);
|
||||
|
||||
// Call dolphin deed when we win the game
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameWin);
|
||||
|
||||
DialogMessageButton choice = dialog_message_show(dialogs, message);
|
||||
dialog_message_free(message);
|
||||
furi_string_free(tempStr);
|
||||
@ -409,6 +414,9 @@ int32_t minesweeper_app(void* p) {
|
||||
Gui* gui = furi_record_open("gui");
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
PluginEvent event;
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
|
@ -491,6 +491,8 @@ int32_t solitaire_app(void* p) {
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
AppEvent event;
|
||||
|
||||
// Call Dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
for(bool processing = true; processing;) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <string.h>
|
||||
#include <furi_hal_resources.h>
|
||||
#include <furi_hal_gpio.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define BORDER_OFFSET 1
|
||||
#define MARGIN_OFFSET 3
|
||||
@ -383,6 +384,9 @@ int32_t tetris_game_app() {
|
||||
Piece* newPiece = malloc(sizeof(Piece));
|
||||
uint8_t downRepeatCounter = 0;
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
for(bool processing = true; processing;) {
|
||||
// This 10U implicitly sets the game loop speed. downRepeatCounter relies on this value
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 10U);
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <input/input.h>
|
||||
#include <stdlib.h>
|
||||
#include <gui/view.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#define TAG "TicTacToe"
|
||||
|
||||
@ -330,6 +331,9 @@ int32_t tictactoe_game_app(void* p) {
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
GameEvent event;
|
||||
for(bool processing = true; processing;) {
|
||||
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include <gui/gui.h>
|
||||
#include <input/input.h>
|
||||
#include <stdlib.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
//ORIGINAL REPO: https://github.com/Dooskington/flipperzero-zombiez
|
||||
//AUTHORS: https://github.com/Dooskington | https://github.com/DevMilanIan
|
||||
@ -313,6 +314,9 @@ int32_t zombiez_game_app(void* p) {
|
||||
Gui* gui = furi_record_open(RECORD_GUI);
|
||||
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
|
||||
|
||||
// Call dolphin deed on game start
|
||||
DOLPHIN_DEED(DolphinDeedPluginGameStart);
|
||||
|
||||
PluginEvent event;
|
||||
bool isRunning = true;
|
||||
while(isRunning) {
|
||||
|
Loading…
Reference in New Issue
Block a user