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

fix furi check (removed player ctx save for now)

jblanked 1 год назад
Родитель
Сommit
9edfce02bf
2 измененных файлов с 12 добавлено и 12 удалено
  1. 5 5
      game/game.c
  2. 7 7
      game/player.c

+ 5 - 5
game/game.c

@@ -53,11 +53,11 @@ static void game_stop(void *ctx)
         FURI_LOG_E("Game", "Invalid game context");
         FURI_LOG_E("Game", "Invalid game context");
         return;
         return;
     }
     }
-    GameContext *game_context = ctx;
-    if (game_context->player_context)
-    {
-        save_player_context(game_context->player_context);
-    }
+    // GameContext *game_context = ctx;
+    // if (game_context->player_context)
+    // {
+    //     save_player_context(game_context->player_context);
+    // }
 }
 }
 
 
 /*
 /*

+ 7 - 7
game/player.c

@@ -29,7 +29,7 @@ void player_spawn(Level *level, GameManager *manager)
 
 
     // Add collision box to player entity
     // Add collision box to player entity
     // Box is centered in player x and y, and it's size is 10x10
     // Box is centered in player x and y, and it's size is 10x10
-    entity_collider_add_rect(game_context->players[0], 10 + PLAYER_COLLISION_HORIZONTAL, 10 + PLAYER_COLLISION_VERTICAL);
+    entity_collider_add_rect(game_context->players[0], 10, 10);
 
 
     // Get player context
     // Get player context
     PlayerContext *player_context = entity_context_get(game_context->players[0]);
     PlayerContext *player_context = entity_context_get(game_context->players[0]);
@@ -57,19 +57,19 @@ void player_spawn(Level *level, GameManager *manager)
     }
     }
 
 
     game_context->player_context = player_context;
     game_context->player_context = player_context;
-    save_player_context(player_context);
-    //  return;
-    //  }
+    // save_player_context(player_context);
+    //   return;
+    //   }
 
 
     // Copy loaded player context to player context
     // Copy loaded player context to player context
     // game_context->player_context = player_context;
     // game_context->player_context = player_context;
 
 
     // Load player sprite (we'll add this to the JSON later when players can choose their sprite)
     // Load player sprite (we'll add this to the JSON later when players can choose their sprite)
-    player_context->sprite_right = game_manager_sprite_load(manager, "player_right_naked_10x10px.fxbm");
-    player_context->sprite_left = game_manager_sprite_load(manager, "player_left_naked_10x10px.fxbm");
+    // player_context->sprite_right = game_manager_sprite_load(manager, "player_right_naked_10x10px.fxbm");
+    // player_context->sprite_left = game_manager_sprite_load(manager, "player_left_naked_10x10px.fxbm");
 
 
     // save the player context to storage
     // save the player context to storage
-    save_player_context(player_context);
+    // save_player_context(player_context);
 }
 }
 
 
 // Modify player_update to track direction
 // Modify player_update to track direction