diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-14 08:25:15 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-12-14 08:25:15 -0500 |
commit | c5050b17d16670c6151d5c135c3b01d66b7530f9 (patch) | |
tree | d8cffed7b2a576023e013b2133504d273e85b652 /src/inventory.cpp | |
parent | b477db406b9d7aa4f62a750c9ae3c3cedc533b3b (diff) |
Added particles
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 585af47..5ae97b4 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -26,7 +26,7 @@ void initInventorySprites(void){ } swordSwing = Mix_LoadWAV("assets/sounds/shortSwing.wav"); - Mix_Volume(2,75); + Mix_Volume(2,100); } char *getItemTexturePath(ITEM_ID id){ @@ -317,10 +317,14 @@ int Inventory::useItem(void){ case SWORD: if(swing){ if(!player->left){ - /*if(hangle==-15){up=true;Mix_PlayChannel(2,swordSwing,0);} + if(hangle==-15){up=true;Mix_PlayChannel(2,swordSwing,0);} if(up)hangle-=.75*deltaTime; - if(hangle<=-90)hangle=-14;*/ + if(hangle<=-90)hangle=-14; }else{ + if(hangle==15){up=true;Mix_PlayChannel(2,swordSwing,0);} + if(up)hangle+=.75*deltaTime; + if(hangle>=90)hangle=14; + /* if(hangle<90&&!up)hangle+=.75*deltaTime; if(hangle>=90&&!up)up=true; if(up)hangle-=.75*deltaTime; @@ -329,7 +333,7 @@ int Inventory::useItem(void){ swing=false; hangle=15; return 0; - } + }*/ } }else if(!swing){ swing=true; |