8 #define BRICK_HEIGHT 25
46 void init(
int x,
int y, SDL_Renderer* ren,
int rowNumber);
52 void draw(SDL_Renderer* ren);
88 SDL_Surface* spriteSheet;
Represents Ball in the game.
Definition: Ball.h:16
Represents the a single brick.
Definition: Brick.h:20
void draw(SDL_Renderer *ren)
Method used to render ball on screen.
Definition: Brick.cpp:83
~Brick()
Destructor for Brick class.
Definition: Brick.cpp:27
bool isUpperSideOfLine(Point *, Point *, Point *)
This Method is used determie if the ball hit the upper side of the brick.
Definition: Brick.cpp:119
int getContactEdge(Ball &ball, float &dt)
This method returns which edge of the brick is hit by the ball.
Definition: Brick.cpp:123
bool getSelected()
Method used to get whether brick is selected.
Definition: Brick.cpp:115
void init(int x, int y, SDL_Renderer *ren, int rowNumber)
Method to initialize a brick by loading it's image.
Definition: Brick.cpp:37
bool hit
Variable to keep state of whether brick was hit or not Initialized to false by default.
Definition: Brick.h:37
Brick()
Constructor of the Brick Class.
Definition: Brick.cpp:17
bool CollisionWithBall(Ball &ball, float &dt)
Method used to update brick and ball after a collision.
Definition: Brick.cpp:184
void update()
Method used to update brick.
Definition: Brick.cpp:101
void setSelected()
Method used to update whether brick is selected.
Definition: Brick.cpp:108
The resource manager is responsible for handling and managing resources regarding the game.
Definition: ResourceManager.h:12
static ResourceManager & getInstance()
Method used to get instance of ResourceManager class.
Definition: ResourceManager.cpp:10
GLint GLsizei width
Definition: glad.h:1462
GLint GLsizei GLsizei height
Definition: glad.h:1462
GLint y
Definition: glad.h:1462
GLdouble x
Definition: glad.h:2344
GLuint texture
Definition: glad.h:2396
Represents a single point in the 2D plane.
Definition: Brick.h:14
float x
Definition: Brick.h:15
float y
Definition: Brick.h:15