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

Creates a Player object that inherits Creature which in turn inherits Entity. More...

#include <player.h>

Inheritance diagram for Player:
Inheritance graph
Collaboration diagram for Player:
Collaboration graph

Public Member Functions

 Player (Texture *, float, float, int, int)
 
 ~Player ()
 
void setLives (int)
 
int getLives ()
 
void setScore (int)
 
int getScore ()
 
void setGravity (bool)
 
bool getGravity ()
 
void setLanded (bool)
 
bool getLanded ()
 
void setJump (bool)
 
bool getJump ()
 
float getGravityF ()
 
void setLevelComplete (bool)
 
bool getLevelComplete ()
 
- Public Member Functions inherited from Creature
 Creature (Texture *, float, float)
 
 ~Creature ()
 
void setVelocityX (float)
 
void setVelocityY (float)
 
void updateX (float)
 
void updateY (float)
 
float getVelocityX ()
 
float getVelocityY ()
 
- 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 Creature
float velocityX
 
float velocityY
 
- 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 Player object that inherits Creature which in turn inherits Entity.

Constructor & Destructor Documentation

Player::Player ( Texture inputTexture,
float  inputX,
float  inputY,
int  spriteSheetNumberX,
int  spriteSheetNumberY 
)

Constructs a Player object Constructs the Player object.

Parameters
Texture*a pointer to a Texture loaded into memory.
floatinitial x position.
floatinitial y position.
intthe sprite sheet x number.
intthe sprite sheet y number.
Player::~Player ( )

De-constructs a Player object De-constructs the Player object

Member Function Documentation

bool Player::getGravity ( )

Getter # gravity

Returns
bool if gravity is acting.

Here is the caller graph for this function:

float Player::getGravityF ( )

Getter # gravityF

Returns
float the value of the force gravity.

Here is the caller graph for this function:

bool Player::getJump ( )

Getter # jump

Returns
bool if the Player is jumping.
bool Player::getLanded ( )

Getter # landed

Returns
bool if the Player has landed.

Here is the caller graph for this function:

bool Player::getLevelComplete ( )

Getter # level complete

Returns
bool if the Player has finished the level.

Here is the caller graph for this function:

int Player::getLives ( )

Getter # lives

Returns
int the number of lives the Player has.

Here is the caller graph for this function:

int Player::getScore ( )

Getter # score

Returns
int the score the Player has.

Here is the caller graph for this function:

void Player::setGravity ( bool  inputGravity)

Setter # gravity Sets if gravity is acting on not.

Parameters
boolif gravity is acting.

Here is the caller graph for this function:

void Player::setJump ( bool  inputJump)

Setter # jump Sets if the Player is jumping.

Parameters
boolif the Player is jumping.
void Player::setLanded ( bool  inputLanding)

Setter # landed Sets if the Player has landed.

Parameters
boolif the Player has landed.

Here is the caller graph for this function:

void Player::setLevelComplete ( bool  inputLevelComplete)

Setter # level complete Sets if the Player has finished the level.

Parameters
boolif the Player has finished the level.

Here is the caller graph for this function:

void Player::setLives ( int  inputLives)

Setter # lives Sets the number of lives of the Player object to the inputed number.

Parameters
intthe inputed number of lives

Here is the caller graph for this function:

void Player::setScore ( int  inputScore)

Setter # score Sets the score of the Player object to the inputed number.

Parameters
intthe inputed score

Here is the caller graph for this function:


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