Fix centering of camera for overworld map.
This commit is contained in:
+5
-3
@@ -387,15 +387,17 @@ void Crawler::HandleUserInput(float fElapsedTime){
|
||||
|
||||
void Crawler::UpdateCamera(float fElapsedTime){
|
||||
lastWorldShakeAdjust=std::max(0.f,lastWorldShakeAdjust-fElapsedTime);
|
||||
if(worldShakeTime-fElapsedTime>0){
|
||||
if(worldShakeTime>0){
|
||||
worldShakeTime-=fElapsedTime;
|
||||
if(worldShakeTime<=0){
|
||||
camera.SetTarget(player->GetPos());
|
||||
}
|
||||
if(lastWorldShakeAdjust==0){
|
||||
lastWorldShakeAdjust=0.02;
|
||||
worldShakeVel.x*=-1;
|
||||
worldShakeVel.y*=-1;
|
||||
}
|
||||
worldShake=player->GetPos()+worldShakeVel;
|
||||
}else{
|
||||
camera.SetTarget(player->GetPos());
|
||||
}
|
||||
worldShakeTime=std::max(0.f,worldShakeTime-fElapsedTime);
|
||||
camera.Update(fElapsedTime);
|
||||
|
||||
Reference in New Issue
Block a user