aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-12-09 07:47:00 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-12-09 07:47:00 -0500
commitd2aa39603eb8a26142a0230188d2572fb0398af5 (patch)
tree776019932f6d8a9c902deb4c542dae56261c549f
parent23e8deda4bb0ea5a6962a1cfbfd35bc46a8c8b8d (diff)
dialog clicks
-rw-r--r--assets/click.wavbin0 -> 17684 bytes
-rw-r--r--src/gameplay.cpp14
-rw-r--r--src/ui.cpp9
-rw-r--r--src/world.cpp2
4 files changed, 23 insertions, 2 deletions
diff --git a/assets/click.wav b/assets/click.wav
new file mode 100644
index 0000000..976fb42
--- /dev/null
+++ b/assets/click.wav
Binary files differ
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 856b397..f665b38 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -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;
}
diff --git a/src/ui.cpp b/src/ui.cpp
index 6fa2770..f843e7d 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -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 = {
diff --git a/src/world.cpp b/src/world.cpp
index 2bceba5..f751287 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -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;
}