|
Breakout
|
Represents the a single brick. More...
#include <Brick.h>
Public Member Functions | |
| Brick () | |
| Constructor of the Brick Class. More... | |
| ~Brick () | |
| Destructor for Brick class. More... | |
| void | init (int x, int y, SDL_Renderer *ren, int rowNumber) |
| Method to initialize a brick by loading it's image. More... | |
| void | draw (SDL_Renderer *ren) |
| Method used to render ball on screen. More... | |
| void | update () |
| Method used to update brick. More... | |
| void | setSelected () |
| Method used to update whether brick is selected. More... | |
| bool | getSelected () |
| Method used to get whether brick is selected. More... | |
| bool | CollisionWithBall (Ball &ball, float &dt) |
| Method used to update brick and ball after a collision. More... | |
| int | getContactEdge (Ball &ball, float &dt) |
| This method returns which edge of the brick is hit by the ball. More... | |
| bool | isUpperSideOfLine (Point *, Point *, Point *) |
| This Method is used determie if the ball hit the upper side of the brick. More... | |
Public Attributes | |
| bool | hit = false |
| Variable to keep state of whether brick was hit or not Initialized to false by default. More... | |
Represents the a single brick.
| Brick::Brick | ( | ) |
| Brick::~Brick | ( | ) |
Destructor for Brick class.
| bool Brick::CollisionWithBall | ( | Ball & | ball, |
| float & | dt | ||
| ) |
Method used to update brick and ball after a collision.
| void Brick::draw | ( | SDL_Renderer * | ren | ) |
Method used to render ball on screen.
| ren | object of SDL_Renderer, used to render brick on screen |
| int Brick::getContactEdge | ( | Ball & | ball, |
| float & | dt | ||
| ) |
This method returns which edge of the brick is hit by the ball.
| bool Brick::getSelected | ( | ) |
Method used to get whether brick is selected.
| void Brick::init | ( | int | xpo, |
| int | ypo, | ||
| SDL_Renderer * | ren, | ||
| int | rowNumber | ||
| ) |
Method to initialize a brick by loading it's image.
| x | x-coordinate of top left most corner of the brick |
| y | y-coordinate of top left most corner of the brick |
| ren | object of SDL_Renderer, used to render brick on screen |
| rowNumber | The current row number to be rendered, helps in sorting out color |
| xpo | x-coordinate of top left most corner of the brick |
| ypo | y-coordinate of top left most corner of the brick |
| ren | object of SDL_Renderer, used to render brick on screen |
This Method is used determie if the ball hit the upper side of the brick.
| void Brick::setSelected | ( | ) |
Method used to update whether brick is selected.
| void Brick::update | ( | ) |
Method used to update brick.
| bool Brick::hit = false |
Variable to keep state of whether brick was hit or not Initialized to false by default.