|
|
@ -434,6 +434,7 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
Menu::OpenMenu(MenuType::PAUSE); |
|
|
|
Menu::OpenMenu(MenuType::PAUSE); |
|
|
|
} |
|
|
|
} |
|
|
|
float animationSpd=0.f; |
|
|
|
float animationSpd=0.f; |
|
|
|
|
|
|
|
player->movementVelocity={}; |
|
|
|
if(player->GetVelocity().mag()<"Player.Move Allowed Velocity Lower Limit"_F&&player->CanMove()){ |
|
|
|
if(player->GetVelocity().mag()<"Player.Move Allowed Velocity Lower Limit"_F&&player->CanMove()){ |
|
|
|
auto GetPlayerStaircaseDirection=[&](){ |
|
|
|
auto GetPlayerStaircaseDirection=[&](){ |
|
|
|
for(LayerTag&layer:MAP_DATA[GetCurrentLevel()].LayerData){ |
|
|
|
for(LayerTag&layer:MAP_DATA[GetCurrentLevel()].LayerData){ |
|
|
@ -460,14 +461,14 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
}else animationSpd=1.f; |
|
|
|
}else animationSpd=1.f; |
|
|
|
player->SetX(player->GetX()+fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->SetX(player->GetX()+fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.x=moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.x+=moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
} else
|
|
|
|
} else
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
} |
|
|
|
} |
|
|
|
player->SetFacingDirection(RIGHT); |
|
|
|
player->SetFacingDirection(RIGHT); |
|
|
|
|
|
|
|
|
|
|
@ -488,14 +489,14 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
}else animationSpd=1.f; |
|
|
|
}else animationSpd=1.f; |
|
|
|
player->SetX(player->GetX()-fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->SetX(player->GetX()-fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.x=-moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.x+=-moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
if(staircaseDirection=="RIGHT"){ |
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()+"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+="Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
} else
|
|
|
|
} else
|
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
if(staircaseDirection=="LEFT"){ |
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+=-"Player.StaircaseClimbSpd"_F*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
newAimingAngle-=vf2d{1,0}; |
|
|
|
newAimingAngle-=vf2d{1,0}; |
|
|
@ -515,7 +516,7 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
}else animationSpd=1.f; |
|
|
|
}else animationSpd=1.f; |
|
|
|
player->SetY(player->GetY()-fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()-fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y=-moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+=-moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
|
|
|
|
|
|
|
|
newAimingAngle-=vf2d{0,1}; |
|
|
|
newAimingAngle-=vf2d{0,1}; |
|
|
|
|
|
|
|
|
|
|
@ -534,7 +535,7 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
moveAmt*=controllerAmt; |
|
|
|
}else animationSpd=1.f; |
|
|
|
}else animationSpd=1.f; |
|
|
|
player->SetY(player->GetY()+fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->SetY(player->GetY()+fElapsedTime*moveAmt*player->GetMoveSpdMult()); |
|
|
|
player->movementVelocity.y=moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
player->movementVelocity.y+=moveAmt*fElapsedTime*player->GetMoveSpdMult(); |
|
|
|
|
|
|
|
|
|
|
|
newAimingAngle+=vf2d{0,1}; |
|
|
|
newAimingAngle+=vf2d{0,1}; |
|
|
|
|
|
|
|
|
|
|
@ -564,7 +565,6 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
} |
|
|
|
} |
|
|
|
if(UpReleased()){ |
|
|
|
if(UpReleased()){ |
|
|
|
player->SetLastReleasedMovementKey(UP); |
|
|
|
player->SetLastReleasedMovementKey(UP); |
|
|
|
player->movementVelocity.y=0; |
|
|
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(RightHeld()){ |
|
|
|
if(RightHeld()){ |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
@ -579,7 +579,6 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
} |
|
|
|
} |
|
|
|
if(RightReleased()){ |
|
|
|
if(RightReleased()){ |
|
|
|
player->SetLastReleasedMovementKey(RIGHT); |
|
|
|
player->SetLastReleasedMovementKey(RIGHT); |
|
|
|
player->movementVelocity.x=0; |
|
|
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(UpHeld()){ |
|
|
|
if(UpHeld()){ |
|
|
|
player->UpdateWalkingAnimation(UP); |
|
|
|
player->UpdateWalkingAnimation(UP); |
|
|
@ -594,7 +593,6 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
} |
|
|
|
} |
|
|
|
if(LeftReleased()){ |
|
|
|
if(LeftReleased()){ |
|
|
|
player->SetLastReleasedMovementKey(LEFT); |
|
|
|
player->SetLastReleasedMovementKey(LEFT); |
|
|
|
player->movementVelocity.x=0; |
|
|
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(RightHeld()){ |
|
|
|
if(RightHeld()){ |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
@ -609,7 +607,6 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
} |
|
|
|
} |
|
|
|
if(DownReleased()){ |
|
|
|
if(DownReleased()){ |
|
|
|
player->SetLastReleasedMovementKey(DOWN); |
|
|
|
player->SetLastReleasedMovementKey(DOWN); |
|
|
|
player->movementVelocity.y=0; |
|
|
|
|
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(player->GetState()==State::NORMAL||player->GetState()==State::PREP_CAST){ |
|
|
|
if(RightHeld()){ |
|
|
|
if(RightHeld()){ |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
|
player->UpdateWalkingAnimation(RIGHT); |
|
|
@ -3914,7 +3911,7 @@ void AiL::ShowDamageVignetteOverlay(){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AiL::GlobalGameUpdates(){ |
|
|
|
void AiL::GlobalGameUpdates(){ |
|
|
|
levelTime+=fElapsedTime; |
|
|
|
levelTime+=GetElapsedTime(); |
|
|
|
SteamAPI_RunCallbacks(); |
|
|
|
SteamAPI_RunCallbacks(); |
|
|
|
STEAMINPUT( |
|
|
|
STEAMINPUT( |
|
|
|
ActivateActionSetForAllControllers(Input::ingameControlsHandle); |
|
|
|
ActivateActionSetForAllControllers(Input::ingameControlsHandle); |
|
|
@ -3925,15 +3922,15 @@ void AiL::GlobalGameUpdates(){ |
|
|
|
for(std::vector<std::shared_ptr<DamageNumber>>::iterator it=DAMAGENUMBER_LIST.begin();it!=DAMAGENUMBER_LIST.end();++it){ |
|
|
|
for(std::vector<std::shared_ptr<DamageNumber>>::iterator it=DAMAGENUMBER_LIST.begin();it!=DAMAGENUMBER_LIST.end();++it){ |
|
|
|
DamageNumber*dn=(*it).get(); |
|
|
|
DamageNumber*dn=(*it).get(); |
|
|
|
if(dn->pauseTime>0){ |
|
|
|
if(dn->pauseTime>0){ |
|
|
|
dn->pauseTime-=fElapsedTime; |
|
|
|
dn->pauseTime-=GetElapsedTime(); |
|
|
|
} else{ |
|
|
|
} else{ |
|
|
|
dn->lifeTime+=fElapsedTime; |
|
|
|
dn->lifeTime+=GetElapsedTime(); |
|
|
|
if(dn->lifeTime<=1){ |
|
|
|
if(dn->lifeTime<=1){ |
|
|
|
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){ |
|
|
|
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){ |
|
|
|
if(dn->invertedDirection){ |
|
|
|
if(dn->invertedDirection){ |
|
|
|
dn->pos.y+=dn->riseSpd*fElapsedTime; |
|
|
|
dn->pos.y+=dn->riseSpd*GetElapsedTime(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
dn->pos.y-=dn->riseSpd*fElapsedTime; |
|
|
|
dn->pos.y-=dn->riseSpd*GetElapsedTime(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -3944,9 +3941,9 @@ void AiL::GlobalGameUpdates(){ |
|
|
|
if(GetMousePos()!=lastMousePos){ |
|
|
|
if(GetMousePos()!=lastMousePos){ |
|
|
|
lastMouseMovement=0.f; |
|
|
|
lastMouseMovement=0.f; |
|
|
|
lastMousePos=GetMousePos(); |
|
|
|
lastMousePos=GetMousePos(); |
|
|
|
}else lastMouseMovement+=fElapsedTime; |
|
|
|
}else lastMouseMovement+=GetElapsedTime(); |
|
|
|
|
|
|
|
|
|
|
|
vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-fElapsedTime); |
|
|
|
vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-GetElapsedTime()); |
|
|
|
|
|
|
|
|
|
|
|
if(Audio::Engine().IsPlaying(GetPlayer()->cooldownSoundInstance)){ |
|
|
|
if(Audio::Engine().IsPlaying(GetPlayer()->cooldownSoundInstance)){ |
|
|
|
Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f)); |
|
|
|
Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f)); |
|
|
|