Player animations now load dynamically from configuration files.

This commit is contained in:
2023-08-19 11:57:02 -05:00
parent 023c6f9005
commit cbfcb2793f
6 changed files with 35 additions and 52 deletions
+9 -48
View File
@@ -5,6 +5,7 @@
INCLUDE_game
INCLUDE_ANIMATION_DATA
INCLUDE_DATA
void sig::Animation::InitializeAnimations(){
@@ -208,54 +209,14 @@ void sig::Animation::InitializeAnimations(){
}
void sig::Animation::SetupPlayerAnimations(){
game->GetPlayer()->AddAnimation("WARRIOR_WALK_N");
game->GetPlayer()->AddAnimation("WARRIOR_WALK_E");
game->GetPlayer()->AddAnimation("WARRIOR_WALK_S");
game->GetPlayer()->AddAnimation("WARRIOR_WALK_W");
game->GetPlayer()->AddAnimation("WARRIOR_IDLE_N");
game->GetPlayer()->AddAnimation("WARRIOR_IDLE_E");
game->GetPlayer()->AddAnimation("WARRIOR_IDLE_S");
game->GetPlayer()->AddAnimation("WARRIOR_IDLE_W");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSWORD_E");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSWORD_S");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSWORD_N");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSWORD_W");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSONICSWORD_E");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSONICSWORD_S");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSONICSWORD_N");
game->GetPlayer()->AddAnimation("WARRIOR_SWINGSONICSWORD_W");
game->GetPlayer()->AddAnimation("RANGER_WALK_N");
game->GetPlayer()->AddAnimation("RANGER_WALK_E");
game->GetPlayer()->AddAnimation("RANGER_WALK_S");
game->GetPlayer()->AddAnimation("RANGER_WALK_W");
game->GetPlayer()->AddAnimation("RANGER_IDLE_N");
game->GetPlayer()->AddAnimation("RANGER_IDLE_E");
game->GetPlayer()->AddAnimation("RANGER_IDLE_S");
game->GetPlayer()->AddAnimation("RANGER_IDLE_W");
game->GetPlayer()->AddAnimation("RANGER_SHOOT_S");
game->GetPlayer()->AddAnimation("RANGER_SHOOT_N");
game->GetPlayer()->AddAnimation("RANGER_SHOOT_W");
game->GetPlayer()->AddAnimation("RANGER_SHOOT_E");
game->GetPlayer()->AddAnimation("WIZARD_WALK_N");
game->GetPlayer()->AddAnimation("WIZARD_WALK_E");
game->GetPlayer()->AddAnimation("WIZARD_WALK_S");
game->GetPlayer()->AddAnimation("WIZARD_WALK_W");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_N");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_E");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_S");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_W");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_ATTACK_N");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_ATTACK_E");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_ATTACK_S");
game->GetPlayer()->AddAnimation("WIZARD_IDLE_ATTACK_W");
game->GetPlayer()->AddAnimation("WIZARD_ATTACK_N");
game->GetPlayer()->AddAnimation("WIZARD_ATTACK_E");
game->GetPlayer()->AddAnimation("WIZARD_ATTACK_S");
game->GetPlayer()->AddAnimation("WIZARD_ATTACK_W");
game->GetPlayer()->AddAnimation("WIZARD_CAST_N");
game->GetPlayer()->AddAnimation("WIZARD_CAST_E");
game->GetPlayer()->AddAnimation("WIZARD_CAST_S");
game->GetPlayer()->AddAnimation("WIZARD_CAST_W");
int counter=0;
while("Player"_A.HasProperty("PLAYER_ANIMATION["+std::to_string(counter)+"]")){
game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_N");
game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_E");
game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_S");
game->GetPlayer()->AddAnimation(DATA["Player"]["PLAYER_ANIMATION["+std::to_string(counter)+"]"].GetString()+"_W");
counter++;
}
ANIMATION_DATA.SetInitialized();
}