summaryrefslogtreecommitdiff
path: root/src/game.h
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2021-12-28 12:39:47 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2021-12-28 12:40:09 +0100
commit1d6a7bb467d28898da5eb1270a6e8dabf958fa42 (patch)
treef4ff1dfebf6fe6e747181b5fcdebede2b9bd9302 /src/game.h
parenta7f23865ff7ffb57d35505bc0cf67507f1751ff2 (diff)
Huge rewrite, this is not how I'm supposed to use git but whatever
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/game.h b/src/game.h
index 118d642..8965010 100644
--- a/src/game.h
+++ b/src/game.h
@@ -1,19 +1,59 @@
#ifndef GAME_H
#define GAME_H
+#include "renderer.h"
+#include "piece.h"
+#include "point.h"
+#include "texture.h"
class GameState{
private:
bool closed_;
bool paused_;
+ int timeAdvance_;
+ int timeCounterAdvance_;
+ int timeLevelUp_;
+ int timeCounterLevelUp_;
+
+ Renderer* renderer_;
+
+ enum class Direction{
+ NONE,
+ LEFT,
+ RIGHT
+ };
+ Direction xdirection_;
+ int yspeed_;
+
+ static const int SQUARE_SIZE = 16;
+ static const int GRID_WIDTH = 16;
+ static const int GRID_HEIGHT = 32;
+
+
+ int grid [GRID_HEIGHT][GRID_WIDTH];
+ Piece piece_;
+
+ float scale_;
+
+ Texture blockTexture_;
public:
- GameState();
+ GameState(Renderer* renderer, float scale);
void close();
void resume();
void pause();
bool isClosed();
bool isPaused();
+ void update(unsigned int dt);
+ void render();
+
+ void pressRotate();
+ void pressDown();
+ void releaseDown();
+ void pressLeft();
+ void releaseLeft();
+ void pressRight();
+ void releaseRight();
};
#endif