#ifndef GRID_H #define GRID_H #include "block.h" #include #include /* The grid is the play field of the game. It is 10 block lengths wide and 20 heigh. It's status is stored in a 20x10 array of ints which indicate whether a block is currently in each spot (1) or not (0). */ class Grid { public: Grid(std::string back, std::string block, int w, int l); ~Grid(); void process(); void draw(SDL_Surface *screen); bool checkBlock(Block *block); bool gameOver(); private: int checkRow(int row); void addBlock(Block *block, int row, int col); void moveRows(int row); int grid[20][10]; SDL_Surface *bgImg; SDL_Surface *blockImg; static const int SIZE; }; #endif