From a808ec6e5814392aa191098e06dfc30ef3687bdd Mon Sep 17 00:00:00 2001 From: hgn Date: Sun, 12 Dec 2021 00:23:22 +0000 Subject: [PATCH] final death anim --- fishladder.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fishladder.c b/fishladder.c index 8c433fb..e344844 100644 --- a/fishladder.c +++ b/fishladder.c @@ -2090,14 +2090,13 @@ void vg_render(void) { float death_anim_time = world.sim_internal_time - fish->death_time; + // Death animation if( death_anim_time > 0.0f && death_anim_time < 1.0f ) { - // Death animation - v2_muladds( fish->physics_co, fish->physics_v, -1.0f * world.sim_internal_delta, fish->physics_co ); - render_pos[2] = 1.0f - death_anim_time; - - //fish->physics_co[0] = fish->pos[0] + 0.5f + sinf( vg_time * 40.0f ); - //fish->physics_co[1] = fish->pos[1] + 0.5f + cosf( vg_time * 45.0f ); + float amt = 1.0f-death_anim_time*death_anim_time; + + v2_muladds( fish->physics_co, fish->physics_v, -1.0f * world.sim_internal_delta * amt, fish->physics_co ); + render_pos[2] = amt; } else if( world.sim_internal_time > fish->death_time ) continue; -- 2.25.1