Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
Public Member Functions | List of all members
Background Class Reference

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>

Inheritance diagram for Background:
Inheritance graph
Collaboration diagram for Background:
Collaboration graph

Public Member Functions

 Background (Texture *, int)
 
 ~Background ()
 
void setVelocity (float)
 
void updateX (float)
 
int getType ()
 
bool getMoveable ()
 
bool getRightMoveable ()
 
bool getLeftMoveable ()
 
- Public Member Functions inherited from Entity
 Entity (Texture *, float, float, int, int)
 
 ~Entity ()
 
void display (SDL_Renderer *)
 
void setX (float)
 
void setY (float)
 
float getX ()
 
float getY ()
 
void setSrcX (float)
 
void setSrcY (float)
 
int getSrcX ()
 
int getSrcY ()
 

Additional Inherited Members

- Protected Attributes inherited from Entity
Texturetexture
 
int srcWidth
 
int srcHeight
 
int srcX
 
int srcY
 
int width
 
int height
 
float x
 
float y
 

Detailed Description

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.

Constructor & Destructor Documentation

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.
intan number between 0 an 2 that sets which of the 3 backgrounds is loaded from the texture.
Background::~Background ( )

De-constructs a Background object De-constructs the Background object

Member Function Documentation

bool Background::getLeftMoveable ( )

Getter # moveable left

Returns
bool if the Background can move left.

Here is the caller graph for this function:

bool Background::getMoveable ( )

Getter # moveable

Returns
bool if the Background can move.

Here is the caller graph for this function:

bool Background::getRightMoveable ( )

Getter # moveable right

Returns
bool if the Background can move right.

Here is the caller graph for this function:

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
floatthe inputed velocity

Here is the caller graph for this function:

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
floatthe inputed deltaTime

Here is the caller graph for this function:


The documentation for this class was generated from the following files: