]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Did Shit
authordrumsetmonkey <abelleisle@roadrunner.com>
Wed, 9 Dec 2015 13:21:08 +0000 (08:21 -0500)
committerdrumsetmonkey <abelleisle@roadrunner.com>
Wed, 9 Dec 2015 13:21:08 +0000 (08:21 -0500)
assets/sounds/cricket.wav [new file with mode: 0644]
assets/sounds/longSwing.mp3 [new file with mode: 0644]
assets/sounds/longSwing.wav [new file with mode: 0644]
assets/sounds/shortSwing.wav [new file with mode: 0644]
main.cpp
src/gameplay.cpp
src/inventory.cpp
src/ui.cpp

diff --git a/assets/sounds/cricket.wav b/assets/sounds/cricket.wav
new file mode 100644 (file)
index 0000000..70be7e5
Binary files /dev/null and b/assets/sounds/cricket.wav differ
diff --git a/assets/sounds/longSwing.mp3 b/assets/sounds/longSwing.mp3
new file mode 100644 (file)
index 0000000..cb6dced
Binary files /dev/null and b/assets/sounds/longSwing.mp3 differ
diff --git a/assets/sounds/longSwing.wav b/assets/sounds/longSwing.wav
new file mode 100644 (file)
index 0000000..e9b60f2
Binary files /dev/null and b/assets/sounds/longSwing.wav differ
diff --git a/assets/sounds/shortSwing.wav b/assets/sounds/shortSwing.wav
new file mode 100644 (file)
index 0000000..bd42737
Binary files /dev/null and b/assets/sounds/shortSwing.wav differ
index d1fd85e96d173a0fd3c241231361c89404cabd2c..e02677d2ec4369dc4c290f808b4c72edf5f01670 100644 (file)
--- 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);
                }
        }
 
index f665b38322225b434b4548af79d1ce36a3fbfae4..9eacf2a97e3369a7155912b2ca3f6b69a64becc1 100644 (file)
@@ -64,7 +64,7 @@ void story(Mob *callee){
        ui::waitForDialog();
        ui::importantText("times.");
        ui::waitForDialog();
-       ui::importantText("Clyne is quite satisfied.");
+       ui::importantText("Clyne is a faggot.");
        ui::waitForDialog();
        callee->alive = false;
 }
index c1595e843f50d55affd62872b37d924a086f70cb..8d8f958e0dd45ea225bad9cbbce11b9d4a8c7434 100644 (file)
@@ -10,6 +10,7 @@ static float hangle = 0.0f;
 static bool up = true;
 static float xc,yc;
 static vec2 itemLoc;
+Mix_Chunk* swordSwing;
 
 static const Item item[ITEM_COUNT]= {
        #include "../config/items.h"
@@ -23,6 +24,9 @@ void initInventorySprites(void){
        for(i = 0;i < ITEM_COUNT;i++){
                itemtex[i] = Texture::loadTexture(getItemTexturePath((ITEM_ID)i));
        }
+
+       swordSwing = Mix_LoadWAV("assets/sounds/shortSwing.wav");
+       Mix_Volume(2,75);
 }
 
 char *getItemTexturePath(ITEM_ID id){
@@ -311,11 +315,11 @@ int Inventory::useItem(void){
                switch(type){
                case SWORD:
                if(!player->left){
-                       if(hangle==-15)up=true;
+                       if(hangle==-15){up=true;Mix_PlayChannel(2,swordSwing,0);}
                        if(up)hangle-=15;
                        if(hangle<=-90)hangle=-14;
                }else{
-                       if(hangle==15)up=true;
+                       if(hangle==15){up=true;Mix_PlayChannel(2,swordSwing,0);}
                        if(up)hangle+=15;
                        if(hangle>=90)hangle=14;
                }
index f843e7dfb2124d8844150978d6840946717f949e..b0ed64c8d816befb6966c993c3b8843868af4706 100644 (file)
@@ -525,8 +525,7 @@ namespace ui {
                                Mix_PlayChannel(1,dialogClick,0);
                        }
                        
-               }else if(!dialogImportant){
-               
+               }else if(!dialogImportant && !fadeIntensity){
                        vec2 hub = {
                                (SCREEN_WIDTH/2+offset.x)-fontSize*10,
                                (offset.y+SCREEN_HEIGHT/2)-fontSize