diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-12 17:29:53 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-12 17:29:53 -0400 |
commit | 93f5ef70fd3395b843adf59b5be4c34a26a78a4f (patch) | |
tree | a3fdd5937c1b5adc76a71e2709413e6c909a2e47 | |
parent | 4c0869841d9ee6f8cc567b3e9eb2249193fc9f83 (diff) | |
download | therapy-93f5ef70fd3395b843adf59b5be4c34a26a78a4f.tar.gz therapy-93f5ef70fd3395b843adf59b5be4c34a26a78a4f.tar.bz2 therapy-93f5ef70fd3395b843adf59b5be4c34a26a78a4f.zip |
Added death sound effect
-rw-r--r-- | res/Hit_Hurt5.wav | bin | 0 -> 18866 bytes | |||
-rw-r--r-- | src/components.cpp | 2 | ||||
-rw-r--r-- | src/game.h | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/res/Hit_Hurt5.wav b/res/Hit_Hurt5.wav new file mode 100644 index 0000000..8442fec --- /dev/null +++ b/res/Hit_Hurt5.wav | |||
Binary files differ | |||
diff --git a/src/components.cpp b/src/components.cpp index 941d02e..9f37771 100644 --- a/src/components.cpp +++ b/src/components.cpp | |||
@@ -573,6 +573,8 @@ bool MapCollisionComponent::processCollision(Game& game, Entity& collider, Colli | |||
573 | Message msg(Message::Type::die); | 573 | Message msg(Message::Type::die); |
574 | collider.send(game, msg); | 574 | collider.send(game, msg); |
575 | 575 | ||
576 | playSound("../res/Hit_Hurt5.wav"); | ||
577 | |||
576 | game.schedule(FRAMES_PER_SECOND * 0.75, [&] () { | 578 | game.schedule(FRAMES_PER_SECOND * 0.75, [&] () { |
577 | game.loadGame(map); | 579 | game.loadGame(map); |
578 | }); | 580 | }); |
diff --git a/src/game.h b/src/game.h index cea154a..ca6c00b 100644 --- a/src/game.h +++ b/src/game.h | |||
@@ -33,7 +33,6 @@ class Game { | |||
33 | void loadGame(const Map& curMap); | 33 | void loadGame(const Map& curMap); |
34 | void schedule(int frames, std::function<void ()>&& callback); | 34 | void schedule(int frames, std::function<void ()>&& callback); |
35 | 35 | ||
36 | bool shouldQuit = false; | ||
37 | private: | 36 | private: |
38 | friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); | 37 | friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); |
39 | 38 | ||
@@ -45,6 +44,7 @@ class Game { | |||
45 | Map m2{"../maps/second.txt"}; | 44 | Map m2{"../maps/second.txt"}; |
46 | Savefile save; | 45 | Savefile save; |
47 | std::list<std::pair<int, std::function<void ()>>> scheduled; | 46 | std::list<std::pair<int, std::function<void ()>>> scheduled; |
47 | bool shouldQuit = false; | ||
48 | }; | 48 | }; |
49 | 49 | ||
50 | #endif | 50 | #endif |