Parcourir la source

share PVE maps + draw NPC in story mode

jblanked il y a 8 mois
Parent
commit
26c5996762
3 fichiers modifiés avec 11 ajouts et 1 suppressions
  1. 10 0
      game/game.c
  2. 1 1
      game/npc.c
  3. 0 0
      game/world.c

+ 10 - 0
game/game.c

@@ -97,6 +97,16 @@ 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->level_count = 1;
+        for (int i = 1; i < MAX_LEVELS; i++)
+        {
+            if (!allocate_level(game_manager, i))
+            {
+                FURI_LOG_E("Game", "Failed to allocate level %d", i);
+                break;
+            }
+            else
+                game_context->level_count++;
+        }
     }
     else if (game_context->game_mode == GAME_MODE_PVP)
     {

+ 1 - 1
game/npc.c

@@ -109,7 +109,7 @@ static void npc_render(Entity *self, GameManager *manager, Canvas *canvas, void
         current_sprite = npc_context->sprite_right;
     }
     // no NPCs in story mode for now
-    if (game_context->game_mode != GAME_MODE_STORY && game_context->story_step < STORY_TUTORIAL_STEPS)
+    if (game_context->game_mode != GAME_MODE_STORY || game_context->story_step >= STORY_TUTORIAL_STEPS)
     {
         // Draw NPC sprite relative to camera, centered on the NPC's position
         canvas_draw_sprite(

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
game/world.c


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff