one should be in the correct folder when initializing the git project...

This commit is contained in:
Rene Kievits
2024-10-14 04:28:43 +02:00
commit 730df043f7
20 changed files with 799 additions and 0 deletions

51
src/Tetromino.hpp Normal file
View File

@@ -0,0 +1,51 @@
#pragma once
extern "C" {
#include <SDL2/SDL.h>
}
#include <vector>
#include <string>
#include <random>
using namespace std;
enum class TetrominoShape {
L,
I,
O,
S,
Z,
J,
COUNT //Used to know the ammount of shapes
};
class GameBoard;
class Tetromino {
private:
void initializeShape(TetrominoShape shape);
vector<vector<int>> shape;
int x, y;
int currentRotationState;
TetrominoShape textureShape;
SDL_Color color;
public:
Tetromino(TetrominoShape shape);
void rotate(GameBoard& gameBoard);
void move(int dx, int dy);
double getRotationAngle( ) const;
const vector<vector<int>>& getShape( ) const;
int getX( ) const;
int getY( ) const;
void setTexture(const TetrominoShape textureName);
const TetrominoShape getTexture( ) const;
SDL_Color getColor( ) const;
};