Fix major overstep with last commit
[carveJwlIkooP6JGAAIwe30JlM.git] / player_physics.h
index f9584a2cd3fb916d4e7c1b8305f08bc8c0dfad2d..ebcb55e32a3de4bacb70e7bdbbddf380e12c8edf 100644 (file)
@@ -547,7 +547,8 @@ static void player_physics(void)
          phys->jump = 0.0f;
 
          player.jump_time = vg_time;
-
+         
+         /* TODO: Move to audio file */
          audio_lock();
          audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D );
          audio_player_set_position( &audio_player_extra, phys->rb.co );
@@ -587,6 +588,18 @@ static void player_do_motion(void)
    float horizontal = vg_get_axis("horizontal"),
          vertical = vg_get_axis("vertical");
 
+   if( (phys->rb.co[1] < 0.0f) && !player.is_dead )
+   {
+      audio_lock();
+      audio_player_set_flags( &audio_player_extra, AUDIO_FLAG_SPACIAL_3D );
+      audio_player_set_position( &audio_player_extra, phys->rb.co );
+      audio_player_set_vol( &audio_player_extra, 20.0f );
+      audio_player_playclip( &audio_player_extra, &audio_splash );
+      audio_unlock();
+
+      player_kill();
+   }
+
    if( phys->on_board )
       player_physics();
    else
@@ -659,7 +672,7 @@ static void player_do_motion(void)
          player_save_frame();
 
          audio_lock();
-         audio_play_oneshot( &audio_gate_lap, 1.0f );
+         audio_play_oneshot( &audio_gate_pass, 1.0f );
          audio_unlock();
          break;
       }