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.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game.h b/src/game.h index 2fd0f05..c91a001 100644 --- a/src/game.h +++ b/src/game.h
@@ -9,6 +9,7 @@
9#include "muxer.h" 9#include "muxer.h"
10#include "timer.h" 10#include "timer.h"
11#include "animation.h" 11#include "animation.h"
12#include "interpolation.h"
12 13
13const int GAME_WIDTH = 640*2; 14const int GAME_WIDTH = 640*2;
14const int GAME_HEIGHT = 480*2; 15const int GAME_HEIGHT = 480*2;
@@ -19,6 +20,10 @@ const int ZOOM_X_FACTOR = 8;
19const int ZOOM_Y_FACTOR = 6; 20const int ZOOM_Y_FACTOR = 6;
20const int RADIUS = 8; 21const int RADIUS = 8;
21 22
23constexpr int TilesetIndex(int x, int y) {
24 return x + y * 24;
25}
26
22enum class Tile { 27enum class Tile {
23 Floor, 28 Floor,
24 Wall, 29 Wall,
@@ -75,6 +80,8 @@ struct MapData {
75 Source lightType = Source::None; 80 Source lightType = Source::None;
76 int lightRadius = 0; 81 int lightRadius = 0;
77 std::set<coord> litTiles; 82 std::set<coord> litTiles;
83 int renderId = -1;
84 bool dirtyRender = true;
78}; 85};
79 86
80class Game { 87class Game {
@@ -97,11 +104,14 @@ public:
97 std::list<Kickup> kickups; 104 std::list<Kickup> kickups;
98 int litSpots = 0; 105 int litSpots = 0;
99 bool dirtyLighting = true; 106 bool dirtyLighting = true;
107 bool dirtyRender = true;
100 size_t numLamps = 0; 108 size_t numLamps = 0;
101 size_t numDust = 0; 109 size_t numDust = 0;
102 110
103 int player_x = 0; 111 int player_x = 0;
104 int player_y = 0; 112 int player_y = 0;
113 int player_oldx = 0;
114 int player_oldy = 0;
105 bool renderPlayer = true; 115 bool renderPlayer = true;
106 Animation playerAnim {"../res/player_anim.txt"}; 116 Animation playerAnim {"../res/player_anim.txt"};
107 117
@@ -123,6 +133,9 @@ public:
123 Input lastInput; 133 Input lastInput;
124 bool alreadyBumped = false; 134 bool alreadyBumped = false;
125 Timer bumpCooldown = {500}; 135 Timer bumpCooldown = {500};
136 Interpolation moveProgress;
137 bool moving = false;
138 bool queueDash = false;
126 139
127}; 140};
128 141