#ifndef BLOCK_H #define BLOCK_H #include #include /* The game will contain one "block" which represents the currently falling object. A block is stored as a 3x3 int array. Each element of the array will indicate whether that area is filled in (1) or not (0). When it is time to display a different block, or when it rotates, the elements will be changed. See block.cpp for details on the shapes. */ class Block { public: Block(std::string filename); ~Block(); void rotate(); void move(int dx, int dy); void draw(SDL_Surface *screen); void newBlock(); int getGrid(int r, int c); int getX(); int getY(); private: int x, y, type; int grid[3][3]; SDL_Surface *blockImg; static const int line[3][3]; static const int l[3][3]; static const int square[3][3]; static const int evil[3][3]; static const int SIZE, LINE, L, SQUARE, EVIL; }; #endif