diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -116,6 +116,8 @@ unsigned int deltaTime = 0; GLuint fragShader; GLuint shaderProgram; +Mix_Chunk *crickets; + /* * names is used to open a file containing all possible NPC names. It is externally * referenced in src/entities.cpp for getting random names. @@ -403,6 +405,9 @@ int main(/*int argc, char *argv[]*/){ */ names = fopen("assets/names_en-us", "r+"); + + crickets=Mix_LoadWAV("assets/sounds/crickets.wav"); + //Mix_Volume(2,25); /* * Create all the worlds, entities, mobs, and the player. This function is defined in @@ -955,8 +960,10 @@ void logic(){ if(!(tickCount%DAY_CYCLE)||!tickCount){ if(weather==SUNNY){ weather=DARK; + Mix_PlayChannel(2,crickets,0); }else{ weather=SUNNY; + Mix_Pause(2); } } |