final death anim
authorhgn <hgodden00@gmail.com>
Sun, 12 Dec 2021 00:23:22 +0000 (00:23 +0000)
committerhgn <hgodden00@gmail.com>
Sun, 12 Dec 2021 00:23:22 +0000 (00:23 +0000)
fishladder.c

index 8c433fb46966e9652da8a9b607b24e78069d908b..e344844a9dbef28b4799ecf53c62cadbca2b0a57 100644 (file)
@@ -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;