cool
authorhgn <hgodden00@gmail.com>
Sat, 12 Aug 2023 16:44:51 +0000 (17:44 +0100)
committerhgn <hgodden00@gmail.com>
Sat, 12 Aug 2023 16:44:51 +0000 (17:44 +0100)
audio.h
ent_challenge.c
ent_objective.c
sound_src/objective0.ogg [new file with mode: 0644]
sound_src/objective1.ogg [new file with mode: 0644]
sound_src/objective_fail.ogg [new file with mode: 0644]
sound_src/objective_win.ogg [new file with mode: 0644]
sound_src/ui_good.ogg [new file with mode: 0644]
sound_src/ui_inf.ogg [new file with mode: 0644]
sound_src/ui_ok.ogg [new file with mode: 0644]

diff --git a/audio.h b/audio.h
index c07f0d15912ace5cb90eca6bcb1a6f09c8e767b3..79fcc582d98387c9074c4753bdd54715c3fbd0d9 100644 (file)
--- 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 );
index bed85870c08d2ce0b1fa0f581bdfc85b8f6ebc36..73476c718bd6baaad23dcdc5d230fa6d6efc8765 100644 (file)
@@ -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;
    }
 }
index 68a3dd015f69882562201beadc2111940adeb19d..ee52af7518ff12062a82380925cca437e57a1bb9 100644 (file)
@@ -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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
index 0000000..7d90d5f
Binary files /dev/null and b/sound_src/ui_ok.ogg differ