From de7ee5ef022a8ccaece0ea5f5402adedeafe36b4 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 12 Mar 2022 09:05:21 -0500 Subject: added back bump sound (and assets for fuller music) --- src/game.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index f0385ee..c489afc 100644 --- a/src/game.h +++ b/src/game.h @@ -7,6 +7,7 @@ #include #include "map.h" #include "muxer.h" +#include "timer.h" const int GAME_WIDTH = 640*2; const int GAME_HEIGHT = 480*2; @@ -43,6 +44,14 @@ struct Input { bool right = false; bool up = false; bool down = false; + + bool operator==(const Input& rhs) const { + return std::tie(left, right, up, down) == std::tie(rhs.left, rhs.right, rhs.up, rhs.down); + } + + bool operator!=(const Input& rhs) const { + return !(*this == rhs); + } }; using coord = std::tuple; @@ -110,6 +119,8 @@ public: bool firstInput = false; Input lastInput; + bool alreadyBumped = false; + Timer bumpCooldown = {500}; }; -- cgit 1.4.1