|
|
|
@ -49,6 +49,9 @@ Crawler::Crawler() |
|
|
|
|
std::string MAP_CONFIG = CONFIG_PATH + "map_config"_S; |
|
|
|
|
utils::datafile::Read(DATA,MAP_CONFIG); |
|
|
|
|
|
|
|
|
|
std::string PLAYER_CONFIG = CONFIG_PATH + "player_config"_S; |
|
|
|
|
utils::datafile::Read(DATA,PLAYER_CONFIG); |
|
|
|
|
|
|
|
|
|
for(std::string&cl:DATA.GetProperty("class_list").GetValues()){ |
|
|
|
|
std::cout<<cl<<std::endl; |
|
|
|
|
utils::datafile::Read(DATA,CONFIG_PATH + "class_directory"_S + cl + ".txt"); |
|
|
|
@ -212,16 +215,16 @@ void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
|
}; |
|
|
|
|
std::string staircaseDirection=GetPlayerStaircaseDirection(); |
|
|
|
|
if(RightHeld()){ |
|
|
|
|
player->SetX(player->GetX()+fElapsedTime*100*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.x=100; |
|
|
|
|
player->SetX(player->GetX()+fElapsedTime*"Player.MoveSpd"_F*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.x="Player.MoveSpd"_F; |
|
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
|
player->SetY(player->GetY()-60*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-60; |
|
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F; |
|
|
|
|
} else
|
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
|
player->SetY(player->GetY()+60*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=60; |
|
|
|
|
} |
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F; |
|
|
|
|
} |
|
|
|
|
player->SetFacingDirection(RIGHT); |
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
|
@ -229,15 +232,15 @@ void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
|
setIdleAnimation=false; |
|
|
|
|
} |
|
|
|
|
if(LeftHeld()){ |
|
|
|
|
player->SetX(player->GetX()-fElapsedTime*100*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.x=-100; |
|
|
|
|
player->SetX(player->GetX()-fElapsedTime*"Player.MoveSpd"_F*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.x=-"Player.MoveSpd"_F; |
|
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
|
player->SetY(player->GetY()+60*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=60; |
|
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F; |
|
|
|
|
} else
|
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
|
player->SetY(player->GetY()-60*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-60; |
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F; |
|
|
|
|
} |
|
|
|
|
if(setIdleAnimation){ |
|
|
|
|
player->SetFacingDirection(LEFT); |
|
|
|
@ -248,8 +251,8 @@ void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
|
setIdleAnimation=false; |
|
|
|
|
} |
|
|
|
|
if(UpHeld()){ |
|
|
|
|
player->SetY(player->GetY()-fElapsedTime*100*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-100*fElapsedTime; |
|
|
|
|
player->SetY(player->GetY()-fElapsedTime*"Player.MoveSpd"_F*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=-"Player.MoveSpd"_F*fElapsedTime; |
|
|
|
|
if(setIdleAnimation){ |
|
|
|
|
player->SetFacingDirection(UP); |
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
@ -259,8 +262,8 @@ void Crawler::HandleUserInput(float fElapsedTime){ |
|
|
|
|
setIdleAnimation=false; |
|
|
|
|
} |
|
|
|
|
if(DownHeld()){ |
|
|
|
|
player->SetY(player->GetY()+fElapsedTime*100*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y=100*fElapsedTime; |
|
|
|
|
player->SetY(player->GetY()+fElapsedTime*"Player.MoveSpd"_F*player->GetMoveSpdMult()); |
|
|
|
|
player->movementVelocity.y="Player.MoveSpd"_F*fElapsedTime; |
|
|
|
|
if(setIdleAnimation){ |
|
|
|
|
player->SetFacingDirection(DOWN); |
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
|