]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
dialog clicks
authorClyne Sullivan <tullivan99@gmail.com>
Wed, 9 Dec 2015 12:47:00 +0000 (07:47 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Wed, 9 Dec 2015 12:47:00 +0000 (07:47 -0500)
assets/click.wav [new file with mode: 0644]
src/gameplay.cpp
src/ui.cpp
src/world.cpp

diff --git a/assets/click.wav b/assets/click.wav
new file mode 100644 (file)
index 0000000..976fb42
Binary files /dev/null and b/assets/click.wav differ
index 856b39701900883973a301d85396a85d9bdd3e97..f665b38322225b434b4548af79d1ce36a3fbfae4 100644 (file)
@@ -39,7 +39,7 @@ void CUTSCENEEE(Mob *callee){
        player->left  = false;
        player->loc.x += HLINE * 5;
        
-       callee->alive = false;
+       callee->alive = true;
 }
 
 void CUTSCENEEE2(Mob *callee){
@@ -54,6 +54,18 @@ void story(Mob *callee){
        player->vel.x = 0;
        ui::importantText("It was a dark and stormy night...");
        ui::waitForDialog();
+       ui::importantText("...and Clyne wanted to hear what the click track sounds like.");
+       ui::waitForDialog();
+       ui::importantText("So Clyne made a really long piece of dialog so that the sound");
+       ui::waitForDialog();
+       ui::importantText("plays");
+       ui::waitForDialog();
+       ui::importantText("multiple");
+       ui::waitForDialog();
+       ui::importantText("times.");
+       ui::waitForDialog();
+       ui::importantText("Clyne is quite satisfied.");
+       ui::waitForDialog();
        callee->alive = false;
 }
 
index 6fa2770a758242470ab06d2fee0c65cdc1df1ca7..f843e7dfb2124d8844150978d6840946717f949e 100644 (file)
@@ -52,6 +52,8 @@ static bool typeOutDone = true;
 
 static bool dialogImportant = false;
 
+Mix_Chunk *dialogClick;
+
 extern void mainLoop(void);
 
 /*
@@ -111,6 +113,8 @@ namespace ui {
 #ifdef DEBUG
                DEBUG_printf("Initialized FreeType2.\n",NULL);
 #endif // DEBUG
+               dialogClick = Mix_LoadWAV("assets/click.wav");
+               Mix_Volume(1,50);
        }
        
        /*
@@ -516,6 +520,11 @@ namespace ui {
                                }
                                setFontColor(255,255,255);
                        }
+                       
+                       if(strcmp(rtext,dialogBoxText)){
+                               Mix_PlayChannel(1,dialogClick,0);
+                       }
+                       
                }else if(!dialogImportant){
                
                        vec2 hub = {
index 2bceba555490274489f6809880092c710733be74..f751287f97079b41afef56a7affc418e363adbe4 100644 (file)
@@ -299,7 +299,7 @@ static Mix_Music *bgmC;
 
 void World::bgmPlay(void){
        if(bgmObj && bgmC != bgmObj){
-               Mix_VolumeMusic(15);
+               Mix_VolumeMusic(50);
                Mix_PlayMusic(bgmObj,-1);       // Loop infinitely
                bgmC = bgmObj;
        }