summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--res/Hit_Hurt5.wavbin0 -> 18866 bytes
-rw-r--r--src/components.cpp2
-rw-r--r--src/game.h2
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