]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
music updates
authorClyne Sullivan <tullivan99@gmail.com>
Wed, 16 Dec 2015 02:20:01 +0000 (21:20 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Wed, 16 Dec 2015 02:20:01 +0000 (21:20 -0500)
assets/music/ozone.wav [new file with mode: 0644]
assets/music/theme.wav [new file with mode: 0644]
assets/music/theme_jazz.wav [new file with mode: 0644]
src/gameplay.cpp
src/world.cpp

diff --git a/assets/music/ozone.wav b/assets/music/ozone.wav
new file mode 100644 (file)
index 0000000..6cc2416
Binary files /dev/null and b/assets/music/ozone.wav differ
diff --git a/assets/music/theme.wav b/assets/music/theme.wav
new file mode 100644 (file)
index 0000000..8b4ea47
Binary files /dev/null and b/assets/music/theme.wav differ
diff --git a/assets/music/theme_jazz.wav b/assets/music/theme_jazz.wav
new file mode 100644 (file)
index 0000000..1c62bbc
Binary files /dev/null and b/assets/music/theme_jazz.wav differ
index 69ae2cc5aac02aaf152d2e7b0ad9d0aac77db88e..0ee6055f3a97574877fd25d182d86ee4c19d2727 100644 (file)
@@ -109,7 +109,7 @@ void initEverything(void){
        worldSpawnHill2 = new World();
        worldSpawnHill2->generate(700);
        worldSpawnHill2->setBackground(BG_FOREST);
-       worldSpawnHill2->setBGM("assets/music/embark.wav");
+       worldSpawnHill2->setBGM("assets/music/ozone.wav");
        worldSpawnHill2->addMob(MS_TRIGGER,-400,0,worldSpawnHill2_infoSprint);
 
        worldSpawnHill3 = new World();
index 1b460a2d9adc4add08b82db71e48cac9dc9c6752..b964c9a54ba1b2c66a6d11e822034c4c6d56073b 100644 (file)
@@ -344,13 +344,12 @@ void World::setBGM(const char *path){
        }
 }
 
-void World::bgmPlay(World *prev){      
-       if(!prev || strcmp(bgm,prev->bgm)){
+void World::bgmPlay(World *prev){
+       if(prev && strcmp(bgm,prev->bgm)){
+               Mix_FadeOutMusic(800);
                Mix_VolumeMusic(50);
                Mix_PlayMusic(bgmObj,-1);       // Loop infinitely
-       }/*else{
-               Mix_FadeOutMusic(800);
-       }*/
+       }
 }
 
 int worldShade = 0;