diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-08-29 22:00:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-29 22:00:49 +0100 |
commit | 7e21cec55bba7e5507cc84c2a53895429b812aff (patch) | |
tree | 0533e3cc82bc5b06cb4426512f50939afef11ba2 | |
parent | dcd1a15545c3a8e6ec9bdabd1358f808a1214314 (diff) | |
download | minetest-7e21cec55bba7e5507cc84c2a53895429b812aff.tar.gz minetest-7e21cec55bba7e5507cc84c2a53895429b812aff.tar.bz2 minetest-7e21cec55bba7e5507cc84c2a53895429b812aff.zip |
Damage flash/hurt tilt: Make shorter to reduce player blindness (#7399)
Damage flash is shortened from 0.98-1.27s to 0.25s-0.33s to reduce
player in-game blindness, especially useful for combat situations.
It is also visually more comfortable.
Camera hurt tilt is made slightly shorter to match in duration.
Both flash and camera tilt are now of similar length to a typical
damage sound, such as the one used by Minetest Game which is 0.27s.
The 3 effects become more synchronised and unified.
-rw-r--r-- | src/game.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp index fbfbdd547..34606172c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3833,23 +3833,23 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, /* Damage flash */ - if (runData.damage_flash > 0.0) { + if (runData.damage_flash > 0.0f) { video::SColor color(runData.damage_flash, 180, 0, 0); driver->draw2DRectangle(color, core::rect<s32>(0, 0, screensize.X, screensize.Y), NULL); - runData.damage_flash -= 100.0 * dtime; + runData.damage_flash -= 384.0f * dtime; } /* Damage camera tilt */ - if (player->hurt_tilt_timer > 0.0) { - player->hurt_tilt_timer -= dtime * 5; + if (player->hurt_tilt_timer > 0.0f) { + player->hurt_tilt_timer -= dtime * 6.0f; - if (player->hurt_tilt_timer < 0) - player->hurt_tilt_strength = 0; + if (player->hurt_tilt_timer < 0.0f) + player->hurt_tilt_strength = 0.0f; } /* |