Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes | List of all members
EP_Player Class Reference

Contains the data and functions for the player. More...

#include <EP_Player.h>

Inheritance diagram for EP_Player:
Inheritance graph
Collaboration diagram for EP_Player:
Collaboration graph

Public Member Functions

 EP_Player (C_Texture *sprite, C_Vec2 pos, C_Vec2 dimensions, C_Texture *archerSprite, C_Vec2 archerPos, C_Vec2 archerDimensions, C_Vec2 screenDimensions, C_Texture *fireSprite, SDL_Colour minTint, SDL_Colour maxTint, float *universalSpeed)
 Constructs the Player object. More...
 
 ~EP_Player ()
 Destructs the Player object. More...
 
void update (float dt)
 A function that updates the Player. More...
 
void input (SDL_Event &incomingEvent, C_Vec2 mousePos)
 A function that handles the Player input. More...
 
void draw (SDL_Renderer *renderer)
 A function that draws the Player to the screen. More...
 
void increaseHealth ()
 A function that increases the Player health by 1. More...
 
void decreaseHealth ()
 A function that decreases the Player health by 1. More...
 
int getHealth ()
 Returns the health of the Player. More...
 
void increaseCoins ()
 A function that increases the Player coins by 1. More...
 
int getCoins ()
 Returns the number coins of the Player. More...
 
bool entityCollisionTest (C_Vec2 entityPos, C_Vec2 entityDimensions)
 A function to test if the player has collided with an Entity. More...
 
void setFireArrow (bool fireArrow)
 Sets the value of the archer fireArrow boolean. More...
 
bool getFireArrow ()
 Gets the value of the archer fireArrow boolean. More...
 
void setFiring (bool firing)
 Sets the value of the archer firing boolean. More...
 
bool getFiring ()
 Gets the value of the archer firing boolean. More...
 
void setFlaming (bool flamingPowerUp)
 Sets the value of the flamingPowerUp boolean. More...
 
bool getFlaming ()
 Gets the value of the flamingPowerUp boolean. More...
 
void setTimeSlow (bool timeSlowPowerUp)
 Sets the value of the timeSlowPowerUp boolean. More...
 
bool getTimeSlow ()
 Gets the value of the timeSlowPowerUp boolean. More...
 
void activateShield ()
 Activates the Player shield. More...
 
- Public Member Functions inherited from EB_Animated
 EB_Animated (C_Texture *sprite, C_Vec2 pos, C_Vec2 dimensions, int animationFrames, C_Vec2 spriteDimensions, float animationLength, std::string iD, float *universalSpee)
 Constructs the Animated Entity. More...
 
 ~EB_Animated ()
 Destructs the Animated Entity object. More...
 
- Public Member Functions inherited from EB_Entity
 EB_Entity (C_Texture *sprite, C_Vec2 pos, C_Vec2 dimensions, std::string iD, float *universalSpeed)
 Constructs the Entity object. More...
 
 ~EB_Entity ()
 Destructs the Entity object. More...
 
void setPosition (C_Vec2 pos)
 Sets the position of the Entity. More...
 
void setX (float x)
 Sets the x position of the Entity. More...
 
void setY (float y)
 Sets the y position of the Entity. More...
 
void setDimensions (C_Vec2 dimensions)
 Sets the dimensions of the Entity. More...
 
void setWidth (float width)
 Sets the width of the Entity. More...
 
void setHeight (float height)
 Sets the height of the Entity. More...
 
C_Vec2 getPosition ()
 Gets the position of the Entity. More...
 
C_Vec2 getDimensions ()
 Gets the dimensions of the Entity. More...
 

Private Attributes

bool pressed
 The user commands for the Player. More...
 
C_Vec2 offset
 An offset for the position of the player from the position the player was pressed. More...
 
C_Vec2 screenDimensions
 The screen Dimensions. More...
 
int health
 The health of the player. More...
 
int maxHealth
 The max health of the player. More...
 
int coins
 The current number of coins of the player. More...
 
int maxCoins
 
EP_PlayerArcherarcher
 The Player Archer. More...
 
C_Vec2 archerOffset
 An offset for the position of the player archer from the position the player. More...
 
bool flamingPowerUp
 A boolean for if the player has the flaming power up active. More...
 
C_Timer flamingPowerUpTimer
 The flamingPowerUp timer. More...
 
PS_ParticleEffectfireEffect
 The fire particle effect. More...
 
C_Vec2 fireEffectOffset
 An offset for the position of the fire effect from the position the player. More...
 
bool shield
 A bool for if the Player shield is active. More...
 
C_AudiohealthLossSounds [3]
 The array of hit audio. More...
 
C_AudioshieldLossSound
 The shield loss audio. More...
 
bool timeSlowPowerUp
 A boolean for if the player has the time slow power up active. More...
 
C_Timer timeSlowPowerUpTimer
 The timeSlowPowerUp timer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EB_Animated
virtual void animate (float dt)
 A virtual function that animates the sprite. More...
 
- Protected Attributes inherited from EB_Animated
int animationFrames
 The number of animation frames in the spritesheet. More...
 
C_Vec2 spriteDimensions
 The dimensions of the sprite in the spritesheet. More...
 
C_Vec2 spriteIndex
 The index of the current sprite in the spritesheet. More...
 
C_Timer animationTimer
 The animation timer. More...
 
- Protected Attributes inherited from EB_Entity
C_Texturesprite
 A pointer to the Entity Texture. More...
 
C_Vec2 pos
 The position of the Entity. More...
 
C_Vec2 dimensions
 The dimensions of the Entity. More...
 
std::string iD
 The ID of the type of Entity. More...
 
float * universalSpeed
 A pointer for the universal speed of the game. More...
 

Detailed Description

Contains the data and functions for the player.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

EP_Player::EP_Player ( C_Texture sprite,
C_Vec2  pos,
C_Vec2  dimensions,
C_Texture archerSprite,
C_Vec2  archerPos,
C_Vec2  archerDimensions,
C_Vec2  screenDimensions,
C_Texture fireSprite,
SDL_Colour  minTint,
SDL_Colour  maxTint,
float *  universalSpeed 
)

Constructs the Player object.

Parameters
spriteA pointer to the objects Texture.
posThe position of the Player.
dimensionsThe dimensions of the Player.
archerSpriteA pointer to the Player Archer Texture.
archerPosThe position of the Player Archer.
archerDimensionsThe dimensions of the Player Archer.
screenDimensionsThe dimensions of the screen.
fireSpriteA pointer to the particles Texture.
minTintThe minimum tint for the fire particles.
maxTintThe maximum tint for the fire particles.
universalSpeedA pointer for the universal speed of the game.

Here is the call graph for this function:

EP_Player::~EP_Player ( )

Destructs the Player object.

Member Function Documentation

void EP_Player::activateShield ( )

Activates the Player shield.

Here is the call graph for this function:

Here is the caller graph for this function:

void EP_Player::decreaseHealth ( )

A function that decreases the Player health by 1.

Here is the call graph for this function:

Here is the caller graph for this function:

void EP_Player::draw ( SDL_Renderer *  renderer)
virtual

A function that draws the Player to the screen.

Parameters
rendererA pointer to the SDL renderer.

Reimplemented from EB_Animated.

Here is the call graph for this function:

Here is the caller graph for this function:

bool EP_Player::entityCollisionTest ( C_Vec2  entityPos,
C_Vec2  entityDimensions 
)

A function to test if the player has collided with an Entity.

Parameters
entityPosThe position of the Entity.
entityDimensionsThe dimensions of the Entity.
Returns
True if there is a collision.

Here is the call graph for this function:

Here is the caller graph for this function:

int EP_Player::getCoins ( )

Returns the number coins of the Player.

Returns
The Player coins.

Here is the caller graph for this function:

bool EP_Player::getFireArrow ( )

Gets the value of the archer fireArrow boolean.

Returns
The value of fireArrow.

Here is the call graph for this function:

Here is the caller graph for this function:

bool EP_Player::getFiring ( )

Gets the value of the archer firing boolean.

Returns
The value of firing.

Here is the call graph for this function:

Here is the caller graph for this function:

bool EP_Player::getFlaming ( )

Gets the value of the flamingPowerUp boolean.

Returns
The value of flamingPowerUp.

Here is the caller graph for this function:

int EP_Player::getHealth ( )

Returns the health of the Player.

Returns
The Player health.

Here is the caller graph for this function:

bool EP_Player::getTimeSlow ( )

Gets the value of the timeSlowPowerUp boolean.

Returns
The value of timeSlowPowerUp.

Here is the caller graph for this function:

void EP_Player::increaseCoins ( )

A function that increases the Player coins by 1.

Here is the caller graph for this function:

void EP_Player::increaseHealth ( )

A function that increases the Player health by 1.

Here is the caller graph for this function:

void EP_Player::input ( SDL_Event &  incomingEvent,
C_Vec2  mousePos 
)

A function that handles the Player input.

Parameters
incomingEventA reference to the incoming SDL event.
mousePosthe position of the mouse.

Here is the call graph for this function:

Here is the caller graph for this function:

void EP_Player::setFireArrow ( bool  fireArrow)

Sets the value of the archer fireArrow boolean.

Parameters
coinSpawnThe new value of fireArrow.

Here is the call graph for this function:

Here is the caller graph for this function:

void EP_Player::setFiring ( bool  firing)

Sets the value of the archer firing boolean.

Parameters
coinSpawnThe new value of firing.

Here is the call graph for this function:

Here is the caller graph for this function:

void EP_Player::setFlaming ( bool  flamingPowerUp)

Sets the value of the flamingPowerUp boolean.

Parameters
flamingPowerUpThe new value of flamingPowerUp.

Here is the caller graph for this function:

void EP_Player::setTimeSlow ( bool  timeSlowPowerUp)

Sets the value of the timeSlowPowerUp boolean.

Parameters
flamingPowerUpThe new value of timeSlowPowerUp.

Here is the caller graph for this function:

void EP_Player::update ( float  dt)
virtual

A function that updates the Player.

Parameters
dtThe delta time.

Implements EB_Animated.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

EP_PlayerArcher* EP_Player::archer
private

The Player Archer.

C_Vec2 EP_Player::archerOffset
private

An offset for the position of the player archer from the position the player.

int EP_Player::coins
private

The current number of coins of the player.

PS_ParticleEffect* EP_Player::fireEffect
private

The fire particle effect.

C_Vec2 EP_Player::fireEffectOffset
private

An offset for the position of the fire effect from the position the player.

bool EP_Player::flamingPowerUp
private

A boolean for if the player has the flaming power up active.

C_Timer EP_Player::flamingPowerUpTimer
private

The flamingPowerUp timer.

int EP_Player::health
private

The health of the player.

C_Audio* EP_Player::healthLossSounds[3]
private

The array of hit audio.

int EP_Player::maxCoins
private

The maximum number of coins that the player can get. This is mainly to make sure that the number does not leave its boundaries on the screen

int EP_Player::maxHealth
private

The max health of the player.

C_Vec2 EP_Player::offset
private

An offset for the position of the player from the position the player was pressed.

bool EP_Player::pressed
private

The user commands for the Player.

C_Vec2 EP_Player::screenDimensions
private

The screen Dimensions.

bool EP_Player::shield
private

A bool for if the Player shield is active.

C_Audio* EP_Player::shieldLossSound
private

The shield loss audio.

bool EP_Player::timeSlowPowerUp
private

A boolean for if the player has the time slow power up active.

C_Timer EP_Player::timeSlowPowerUpTimer
private

The timeSlowPowerUp timer.


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