Skip to content

Commit 7e21cec

Browse files
authoredAug 29, 2018
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.
1 parent dcd1a15 commit 7e21cec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

Diff for: ‎src/game.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -3833,23 +3833,23 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
38333833
/*
38343834
Damage flash
38353835
*/
3836-
if (runData.damage_flash > 0.0) {
3836+
if (runData.damage_flash > 0.0f) {
38373837
video::SColor color(runData.damage_flash, 180, 0, 0);
38383838
driver->draw2DRectangle(color,
38393839
core::rect<s32>(0, 0, screensize.X, screensize.Y),
38403840
NULL);
38413841

3842-
runData.damage_flash -= 100.0 * dtime;
3842+
runData.damage_flash -= 384.0f * dtime;
38433843
}
38443844

38453845
/*
38463846
Damage camera tilt
38473847
*/
3848-
if (player->hurt_tilt_timer > 0.0) {
3849-
player->hurt_tilt_timer -= dtime * 5;
3848+
if (player->hurt_tilt_timer > 0.0f) {
3849+
player->hurt_tilt_timer -= dtime * 6.0f;
38503850

3851-
if (player->hurt_tilt_timer < 0)
3852-
player->hurt_tilt_strength = 0;
3851+
if (player->hurt_tilt_timer < 0.0f)
3852+
player->hurt_tilt_strength = 0.0f;
38533853
}
38543854

38553855
/*

0 commit comments

Comments
 (0)
Please sign in to comment.