From 1d6a7bb467d28898da5eb1270a6e8dabf958fa42 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Tue, 28 Dec 2021 12:39:47 +0100 Subject: Huge rewrite, this is not how I'm supposed to use git but whatever --- src/game.h | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'src/game.h') 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 -- cgit v1.2.3