From: hgn Date: Sat, 12 Aug 2023 16:44:51 +0000 (+0100) Subject: cool X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=d09933d9ff5d3b49e48bff09c67c991c11b631e6;hp=99376ce8eaf30125fb08dd5dc8b534800580fe47;p=carveJwlIkooP6JGAAIwe30JlM.git cool --- diff --git a/audio.h b/audio.h index c07f0d1..79fcc58 100644 --- a/audio.h +++ b/audio.h @@ -128,6 +128,16 @@ audio_clip audio_ui[] = { { .path = "sound/ui_ding.ogg" }, }; +audio_clip audio_challenge[] = { + { .path = "sound/objective0.ogg" }, + { .path = "sound/objective1.ogg" }, + { .path = "sound/objective_win.ogg" }, + { .path = "sound/ui_good.ogg" }, + { .path = "sound/ui_inf.ogg" }, + { .path = "sound/ui_ok.ogg" }, + { .path = "sound/objective_fail.ogg" } +}; + VG_STATIC void audio_init(void) { audio_clip_loadn( audio_board, vg_list_size(audio_board), NULL ); @@ -150,6 +160,7 @@ VG_STATIC void audio_init(void) vg_list_size(audio_footsteps_wood), NULL ); audio_clip_loadn( audio_rewind, vg_list_size(audio_rewind), NULL ); audio_clip_loadn( audio_ui, vg_list_size(audio_ui), NULL ); + audio_clip_loadn( audio_challenge, vg_list_size(audio_challenge), NULL ); audio_lock(); audio_set_lfo_wave( 0, k_lfo_polynomial_bipolar, 80.0f ); diff --git a/ent_challenge.c b/ent_challenge.c index bed8587..73476c7 100644 --- a/ent_challenge.c +++ b/ent_challenge.c @@ -4,6 +4,7 @@ #include "entity.h" #include "input.h" #include "gui.h" +#include "audio.h" VG_STATIC void ent_challenge_call( world_instance *world, ent_call *call ){ u32 index = mdl_entity_id_id( call->id ); @@ -77,6 +78,7 @@ VG_STATIC void ent_challenge_preupdate( ent_challenge *challenge ){ next = objective->id_next; v3_fill( objective->transform.s, 1.0f ); } + audio_oneshot( &audio_challenge[5], 1.0f, 0.0f ); return; } } @@ -84,6 +86,7 @@ VG_STATIC void ent_challenge_preupdate( ent_challenge *challenge ){ if( button_down( k_srbind_mback ) ){ world_static.challenge_target = NULL; world_entity_unfocus(); + audio_oneshot( &audio_challenge[4], 1.0f, 0.0f ); return; } } diff --git a/ent_objective.c b/ent_objective.c index 68a3dd0..ee52af7 100644 --- a/ent_objective.c +++ b/ent_objective.c @@ -4,6 +4,7 @@ #include "world.h" #include "world_load.h" #include "entity.h" +#include "audio.h" VG_STATIC void ent_objective_pass( world_instance *world, ent_objective *objective ){ @@ -17,11 +18,15 @@ VG_STATIC void ent_objective_pass( world_instance *world, if( next->filter & k_ent_objective_filter_passthrough ) ent_objective_pass( world, next ); - else + else{ vg_info( "pass challenge point\n" ); + audio_oneshot_3d( &audio_challenge[0], localplayer.rb.co, + 30.0f, 1.0f ); + } } else { - vg_success( "NYU Film school graduate SUCKAH\n" ); + vg_success( "challenge win\n" ); + audio_oneshot( &audio_challenge[2], 1.0f, 0.0f ); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; @@ -82,7 +87,9 @@ VG_STATIC void ent_objective_call( world_instance *world, ent_call *call ){ ent_objective_pass( world, objective ); } else { - vg_error( "womp womp\n" ); + audio_oneshot_3d( &audio_challenge[6], localplayer.rb.co, + 30.0f, 1.0f ); + vg_error( "challenge fialed\n" ); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; } diff --git a/sound_src/objective0.ogg b/sound_src/objective0.ogg new file mode 100644 index 0000000..349b72c Binary files /dev/null and b/sound_src/objective0.ogg differ diff --git a/sound_src/objective1.ogg b/sound_src/objective1.ogg new file mode 100644 index 0000000..5cde9e3 Binary files /dev/null and b/sound_src/objective1.ogg differ diff --git a/sound_src/objective_fail.ogg b/sound_src/objective_fail.ogg new file mode 100644 index 0000000..6f60481 Binary files /dev/null and b/sound_src/objective_fail.ogg differ diff --git a/sound_src/objective_win.ogg b/sound_src/objective_win.ogg new file mode 100644 index 0000000..e5edc04 Binary files /dev/null and b/sound_src/objective_win.ogg differ diff --git a/sound_src/ui_good.ogg b/sound_src/ui_good.ogg new file mode 100644 index 0000000..35ddefc Binary files /dev/null and b/sound_src/ui_good.ogg differ diff --git a/sound_src/ui_inf.ogg b/sound_src/ui_inf.ogg new file mode 100644 index 0000000..d5c34e8 Binary files /dev/null and b/sound_src/ui_inf.ogg differ diff --git a/sound_src/ui_ok.ogg b/sound_src/ui_ok.ogg new file mode 100644 index 0000000..7d90d5f Binary files /dev/null and b/sound_src/ui_ok.ogg differ