X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_physics.h;h=f71568bb0fa242848fa3348f755beb21e9e1ac5f;hb=d00b1df8f80e4714dc2f9aa2189d242bb4d09a2f;hp=f9584a2cd3fb916d4e7c1b8305f08bc8c0dfad2d;hpb=86dbcd5796ed674ca9433cce1ace8bef322cd121;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_physics.h b/player_physics.h index f9584a2..f71568b 100644 --- a/player_physics.h +++ b/player_physics.h @@ -1,11 +1,5 @@ /* - * Copyright 2021-2022 (C) Mount0 Software, Harry Godden - All Rights Reserved - * ----------------------------------------------------------------------------- - * - * Player physics and control submodule - * contains main physics models, input, and player control. - * - * ----------------------------------------------------------------------------- + * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved */ #ifndef PLAYER_PHYSICS_H @@ -547,7 +541,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 +582,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 +666,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; }