diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-12 09:05:21 -0500 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-12 09:05:21 -0500 |
| commit | de7ee5ef022a8ccaece0ea5f5402adedeafe36b4 (patch) | |
| tree | c51e6d7c71f1e0fb13cbccf05895b7950750a09b /src/game.h | |
| parent | 6cfc54f019ea793c75c012af9c8249eac936cfac (diff) | |
| download | ether-de7ee5ef022a8ccaece0ea5f5402adedeafe36b4.tar.gz ether-de7ee5ef022a8ccaece0ea5f5402adedeafe36b4.tar.bz2 ether-de7ee5ef022a8ccaece0ea5f5402adedeafe36b4.zip | |
added back bump sound (and assets for fuller music)
Diffstat (limited to 'src/game.h')
| -rw-r--r-- | src/game.h | 11 |
1 files changed, 11 insertions, 0 deletions
| 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 @@ | |||
| 7 | #include <list> | 7 | #include <list> |
| 8 | #include "map.h" | 8 | #include "map.h" |
| 9 | #include "muxer.h" | 9 | #include "muxer.h" |
| 10 | #include "timer.h" | ||
| 10 | 11 | ||
| 11 | const int GAME_WIDTH = 640*2; | 12 | const int GAME_WIDTH = 640*2; |
| 12 | const int GAME_HEIGHT = 480*2; | 13 | const int GAME_HEIGHT = 480*2; |
| @@ -43,6 +44,14 @@ struct Input { | |||
| 43 | bool right = false; | 44 | bool right = false; |
| 44 | bool up = false; | 45 | bool up = false; |
| 45 | bool down = false; | 46 | bool down = false; |
| 47 | |||
| 48 | bool operator==(const Input& rhs) const { | ||
| 49 | return std::tie(left, right, up, down) == std::tie(rhs.left, rhs.right, rhs.up, rhs.down); | ||
| 50 | } | ||
| 51 | |||
| 52 | bool operator!=(const Input& rhs) const { | ||
| 53 | return !(*this == rhs); | ||
| 54 | } | ||
| 46 | }; | 55 | }; |
| 47 | 56 | ||
| 48 | using coord = std::tuple<int, int>; | 57 | using coord = std::tuple<int, int>; |
| @@ -110,6 +119,8 @@ public: | |||
| 110 | 119 | ||
| 111 | bool firstInput = false; | 120 | bool firstInput = false; |
| 112 | Input lastInput; | 121 | Input lastInput; |
| 122 | bool alreadyBumped = false; | ||
| 123 | Timer bumpCooldown = {500}; | ||
| 113 | 124 | ||
| 114 | }; | 125 | }; |
| 115 | 126 | ||
