summaryrefslogtreecommitdiff
path: root/src/game.h
diff options
context:
space:
mode:
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