Creates a Background object that inherits Entity. Creates a Background object with a velocity, and position check. It also has a Texture (including variables for the source and destination dimensions), position and velocity in entity.
More...
#include <background.h>
|
Texture * | texture |
|
int | srcWidth |
|
int | srcHeight |
|
int | srcX |
|
int | srcY |
|
int | width |
|
int | height |
|
float | x |
|
float | y |
|
Creates a Background object that inherits Entity. Creates a Background object with a velocity, and position check. It also has a Texture (including variables for the source and destination dimensions), position and velocity in entity.
Background::Background |
( |
Texture * |
inputTexture, |
|
|
int |
inputBackgroundType |
|
) |
| |
Constructs a Background object Constructs a Background object using the input Texture and background type. All of the other variables are automatically initialized to defaults.
- Parameters
-
Texture* | a pointer to a Texture loaded into memory. |
int | an number between 0 an 2 that sets which of the 3 backgrounds is loaded from the texture. |
Background::~Background |
( |
| ) |
|
bool Background::getLeftMoveable |
( |
| ) |
|
Getter # moveable left
- Returns
- bool if the Background can move left.
bool Background::getMoveable |
( |
| ) |
|
Getter # moveable
- Returns
- bool if the Background can move.
bool Background::getRightMoveable |
( |
| ) |
|
Getter # moveable right
- Returns
- bool if the Background can move right.
int Background::getType |
( |
| ) |
|
Getter # backgroundType
- Returns
- int the type of the Background.
void Background::setVelocity |
( |
float |
inputVelocity | ) |
|
Setter # velocity Sets the velocity of the Background to the inputed velocity.
- Parameters
-
float | the inputed velocity |
void Background::updateX |
( |
float |
dt | ) |
|
Updates the x position of the Background Performers a check on the updated position of the x to see if it within boundaries. If it is within boundaries then it updates the x position using the velocity and the inputed deltaTime. If it is not within boundaries then it resets the x position to the boundaries.
- Parameters
-
float | the inputed deltaTime |
The documentation for this class was generated from the following files:
- PGGAssignment1SDL/background.h
- PGGAssignment1SDL/background.cpp