jblanked 8 месяцев назад
Родитель
Сommit
870fb037d1
6 измененных файлов с 66 добавлено и 44 удалено
  1. 2 2
      game/game.c
  2. 1 1
      game/level.c
  3. 1 31
      game/player.c
  4. 59 8
      game/story.c
  5. 3 1
      game/story.h
  6. 0 1
      game/world.h

+ 2 - 2
game/game.c

@@ -78,7 +78,7 @@ static void game_start(GameManager *game_manager, void *ctx)
                 FURI_LOG_E("Game", "Failed to allocate level %d", i);
                 if (i == 0)
                 {
-                    game_context->levels[0] = game_manager_add_level(game_manager, world_training());
+                    game_context->levels[0] = game_manager_add_level(game_manager, story_world());
                     game_context->level_count = 1;
                 }
                 break;
@@ -95,7 +95,7 @@ static void game_start(GameManager *game_manager, void *ctx)
         }
 
         // show tutorial only for now
-        game_context->levels[0] = game_manager_add_level(game_manager, world_training());
+        game_context->levels[0] = game_manager_add_level(game_manager, story_world());
         game_context->level_count = 1;
         for (int i = 1; i < MAX_LEVELS; i++)
         {

+ 1 - 1
game/level.c

@@ -12,7 +12,7 @@ bool allocate_level(GameManager *manager, int index)
     if (!world_list)
     {
         FURI_LOG_E("Game", "Failed to load world list");
-        game_context->levels[0] = game_manager_add_level(manager, world_training());
+        game_context->levels[0] = game_manager_add_level(manager, story_world());
         game_context->level_count = 1;
         return false;
     }

+ 1 - 31
game/player.c

@@ -492,37 +492,7 @@ static void player_update(Entity *self, GameManager *manager, void *context)
     // adjust tutorial step
     if (game_context->game_mode == GAME_MODE_STORY)
     {
-        switch (game_context->story_step)
-        {
-        case 0:
-            if (input.held & GameKeyLeft)
-                game_context->story_step++;
-            break;
-        case 1:
-            if (input.held & GameKeyRight)
-                game_context->story_step++;
-            break;
-        case 2:
-            if (input.held & GameKeyUp)
-                game_context->story_step++;
-            break;
-        case 3:
-            if (input.held & GameKeyDown)
-                game_context->story_step++;
-            break;
-        case 5:
-            if (input.held & GameKeyOk && game_context->is_menu_open)
-                game_context->story_step++;
-            break;
-        case 6:
-            if (input.held & GameKeyBack)
-                game_context->story_step++;
-            break;
-        case 7:
-            if (input.held & GameKeyBack)
-                game_context->story_step++;
-            break;
-        }
+        story_update(self, manager);
     }
 
     // Clamp the player's position to stay within world bounds

Разница между файлами не показана из-за своего большого размера
+ 59 - 8
game/story.c


+ 3 - 1
game/story.h

@@ -2,4 +2,6 @@
 #include <game/game.h>
 #include "flip_world.h"
 #define STORY_TUTORIAL_STEPS 9
-void story_draw(Entity *player, Canvas *canvas, GameManager *manager);
+void story_draw(Entity *player, Canvas *canvas, GameManager *manager);
+void story_update(Entity *player, GameManager *manager);
+const LevelBehaviour *story_world();

+ 0 - 1
game/world.h

@@ -11,7 +11,6 @@
 // Maximum number of world objects
 #define MAX_WORLD_OBJECTS 25
 
-const LevelBehaviour *world_training();
 const LevelBehaviour *world_pvp();
 bool world_json_draw(GameManager *manager, Level *level, const FuriString *json_data);
 FuriString *world_fetch(const char *name);

Некоторые файлы не были показаны из-за большого количества измененных файлов