From d2ab61472a62c19e2e78dc3e95964d19d08be12f Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Thu, 6 Jul 2023 18:11:52 +0000 Subject: [PATCH] Minor screen shake adjustments Co-authored-by: sigonasr2 --- Crawler/Crawler.cpp | 10 ++++++++-- Crawler/FireBolt.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 07a16ed7..67c6e863 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -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 { diff --git a/Crawler/FireBolt.cpp b/Crawler/FireBolt.cpp index 58ab9904..c683af13 100644 --- a/Crawler/FireBolt.cpp +++ b/Crawler/FireBolt.cpp @@ -33,7 +33,7 @@ bool FireBolt::MonsterHit(Monster& monster) for(int i=0;i<72;i++){ game->AddEffect(Effect(monster.GetPos(),util::random(0.5),AnimationState::DOT_PARTICLE,util::random(2),util::random(0.4),{util::random(300)-150,util::random(300)-150},{255,uint8_t(util::random(190)+60),60})); } - game->SetupWorldShake(0.5); + game->SetupWorldShake(0.25); for(Monster&m:MONSTER_LIST){ if(geom2d::line(monster.GetPos(),m.GetPos()).length()<=2.5*24){ m.Hurt(3*damage);