Minor screen shake adjustments

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/28/head
parent d08b3848b8
commit d2ab61472a
  1. 10
      Crawler/Crawler.cpp
  2. 2
      Crawler/FireBolt.cpp

@ -577,8 +577,14 @@ void Crawler::UpdateCamera(float fElapsedTime){
lastWorldShakeAdjust=std::max(0.f,lastWorldShakeAdjust-fElapsedTime); lastWorldShakeAdjust=std::max(0.f,lastWorldShakeAdjust-fElapsedTime);
if(worldShakeTime-fElapsedTime>0){ if(worldShakeTime-fElapsedTime>0){
if(lastWorldShakeAdjust==0){ if(lastWorldShakeAdjust==0){
lastWorldShakeAdjust=util::random(0.2)+0.05; lastWorldShakeAdjust=util::random(0.04)+0.01;
worldShakeVel={util::random(300)-150,util::random(300)-150}; 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; worldShake+=worldShakeVel*fElapsedTime;
} else { } else {

@ -33,7 +33,7 @@ bool FireBolt::MonsterHit(Monster& monster)
for(int i=0;i<72;i++){ 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->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){ for(Monster&m:MONSTER_LIST){
if(geom2d::line(monster.GetPos(),m.GetPos()).length()<=2.5*24){ if(geom2d::line(monster.GetPos(),m.GetPos()).length()<=2.5*24){
m.Hurt(3*damage); m.Hurt(3*damage);

Loading…
Cancel
Save