aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-12-09 08:30:10 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-12-09 08:30:10 -0500
commit0f6da32aa634cf4a89dbd205d8b0dd68d401aaec (patch)
tree37aa748a5be2908c73bbb12ac5c5d3a5ac661b6d /src
parent1d3ba18c99850996f0ba85d99e269270d42056bf (diff)
parent4e3ceb550b26e3b7810b4493943db98918d7bef1 (diff)
Merge branch 'master' of http://github.com/tcsullivan/gamedev
Diffstat (limited to 'src')
-rw-r--r--src/entities.cpp4
-rw-r--r--src/gameplay.cpp1
-rw-r--r--src/ui.cpp5
-rw-r--r--src/world.cpp6
4 files changed, 13 insertions, 3 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index f2d7270..08af0a9 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -313,6 +313,10 @@ void NPC::interact(){ //have the npc's interact back to the player
if(aiFunc.size()){
func=aiFunc.front();
canMove=false;
+
+ left = (player->loc.x < loc.x);
+ right = !left;
+
if(!func(this)){
if(aiFunc.size())aiFunc.erase(aiFunc.begin());
}
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 9eacf2a..fbcc782 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -52,6 +52,7 @@ void CUTSCENEEE2(Mob *callee){
void story(Mob *callee){
player->vel.x = 0;
+ Mix_FadeOutMusic(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.");
diff --git a/src/ui.cpp b/src/ui.cpp
index d13b2e8..9ab8141 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -50,8 +50,6 @@ static float dialogOptLoc[4][3];
static unsigned char dialogOptCount = 0;
static bool typeOutDone = true;
-static bool dialogImportant = false;
-
Mix_Chunk *dialogClick;
extern void mainLoop(void);
@@ -91,7 +89,8 @@ namespace ui {
* Dialog stuff that needs to be 'public'.
*/
- bool dialogBoxExists=false;
+ bool dialogBoxExists = false;
+ bool dialogImportant = false;
unsigned char dialogOptChosen = 0;
/*
diff --git a/src/world.cpp b/src/world.cpp
index cb5f3ec..2fd3591 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -285,6 +285,12 @@ void World::update(Player *p,unsigned int delta){
else if(e->vel.x > 0)e->left = false;
}
}
+
+ if(ui::dialogImportant){
+ Mix_FadeOutMusic(2000);
+ }else if(!Mix_PlayingMusic()){
+ Mix_FadeInMusic(bgmObj,-1,2000);
+ }
}
void World::setBGM(const char *path){