Minor screen shake adjustments

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
2023-07-06 18:11:52 +00:00
parent d08b3848b8
commit d2ab61472a
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -577,8 +577,14 @@ void Crawler::UpdateCamera(float fElapsedTime){
lastWorldShakeAdjust=std::max(0.f,lastWorldShakeAdjust-fElapsedTime);
if(worldShakeTime-fElapsedTime>0){
if(lastWorldShakeAdjust==0){
lastWorldShakeAdjust=util::random(0.2)+0.05;
worldShakeVel={util::random(300)-150,util::random(300)-150};
lastWorldShakeAdjust=util::random(0.04)+0.01;
worldShakeVel={util::random(200)+100,util::random(200)+100};
if(rand()%2==0){
worldShakeVel.x*=-1;
}
if(rand()%2==0){
worldShakeVel.y*=-1;
}
}
worldShake+=worldShakeVel*fElapsedTime;
} else {