summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h11
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
11const int GAME_WIDTH = 640*2; 12const int GAME_WIDTH = 640*2;
12const int GAME_HEIGHT = 480*2; 13const 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
48using coord = std::tuple<int, int>; 57using 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