aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 4cafc24..bde880d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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);
}
}