aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-12-09 08:21:08 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-12-09 08:21:08 -0500
commit996a2b90c40b078dabc9a435156a836b9693d0b1 (patch)
tree1e3b102a29893244114ffad85ffdb2f8be082db3 /main.cpp
parentd2aa39603eb8a26142a0230188d2572fb0398af5 (diff)
Did Shit
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 d1fd85e..e02677d 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.
@@ -401,6 +403,9 @@ int main(/*int argc, char *argv[]*/){
*/
names = fopen("assets/names_en-us", "r+");
+
+ crickets=Mix_LoadWAV("assets/sounds/crickets.wav");
+ Mix_Volume(3,25);
/*
* Create all the worlds, entities, mobs, and the player. This function is defined in
@@ -950,8 +955,10 @@ void logic(){
if(!(tickCount%DAY_CYCLE)||!tickCount){
if(weather==SUNNY){
weather=DARK;
+ Mix_PlayChannel(3,crickets,0);
}else{
weather=SUNNY;
+ Mix_Pause(3);
}
}