A Particle object for use with the Particle System. More...
#include <PS_Particle.h>
Public Member Functions | |
PS_Particle (C_Texture *texture, float scaleValue, C_Vec2 direction, float moveSpeed, C_Vec2 pos) | |
Constructs the Particle Object. More... | |
PS_Particle (C_Texture *texture, float scaleValue, C_Vec2 direction, float moveSpeed, C_Vec2 pos, SDL_Colour tintColour) | |
Constructs the Particle Object. More... | |
~PS_Particle () | |
Destructs the Particle Object deleting the Particle Object from memory. More... | |
void | update (float dt) |
A function that updates the Particle. More... | |
void | draw (SDL_Renderer *renderer) |
Draw the Entity to the screen. More... | |
void | move (C_Vec2 movement) |
Move the Particle. More... | |
void | setPosition (C_Vec2 pos) |
Sets the position of the Particle. More... | |
void | setScale (float scaleValue) |
Sets the scale of the Particle. More... | |
void | setMoveSpeed (float moveSpeed) |
Sets the moveSpeed of the Particle. More... | |
void | setDirection (C_Vec2 direction) |
Sets the direction of the Particle. More... | |
float | getMoveSpeed () |
Gets the moveSpeed of the Particle. More... | |
C_Vec2 | getPosition () |
Gets the position of the Particle. More... | |
C_Vec2 | getDirection () |
Gets the direction of the Particle. More... | |
float | getScale () |
Gets the scale of the Particle. More... | |
Private Attributes | |
C_Texture * | texture |
A pointer to the Texture. More... | |
C_Vec2 | direction |
The direction of the Particle. More... | |
C_Vec2 | pos |
The Position of the Particle. More... | |
float | scaleValue |
The scale of the Particle. More... | |
float | moveSpeed |
The movement speed of the Particle. More... | |
bool | tint |
A boolean for if the Particle should be tinted. More... | |
SDL_Colour | tintColour |
The Tint colour of the Particle. More... | |
A Particle object for use with the Particle System.
PS_Particle::PS_Particle | ( | C_Texture * | texture, |
float | scaleValue, | ||
C_Vec2 | direction, | ||
float | moveSpeed, | ||
C_Vec2 | pos | ||
) |
Constructs the Particle Object.
square | A pointer to the Texture. |
scaleValue | The scale of the Particle. |
direction | The direction of the Particle. |
moveSpeed | The move speed of the Particle. |
pos | The position of the Particle. |
PS_Particle::PS_Particle | ( | C_Texture * | texture, |
float | scaleValue, | ||
C_Vec2 | direction, | ||
float | moveSpeed, | ||
C_Vec2 | pos, | ||
SDL_Colour | tintColour | ||
) |
Constructs the Particle Object.
square | A pointer to the Texture. |
scaleValue | The scale of the Particle. |
direction | The direction of the Particle. |
moveSpeed | The move speed of the Particle. |
pos | The position of the Particle. |
tintColour | The tint colour of the Particle. |
PS_Particle::~PS_Particle | ( | ) |
Destructs the Particle Object deleting the Particle Object from memory.
void PS_Particle::draw | ( | SDL_Renderer * | renderer | ) |
Draw the Entity to the screen.
renderer | A pointer to the renderer. |
C_Vec2 PS_Particle::getDirection | ( | ) |
Gets the direction of the Particle.
float PS_Particle::getMoveSpeed | ( | ) |
Gets the moveSpeed of the Particle.
C_Vec2 PS_Particle::getPosition | ( | ) |
Gets the position of the Particle.
float PS_Particle::getScale | ( | ) |
Gets the scale of the Particle.
void PS_Particle::move | ( | C_Vec2 | movement | ) |
Move the Particle.
movement | The amount to move by. |
void PS_Particle::setDirection | ( | C_Vec2 | direction | ) |
Sets the direction of the Particle.
direction | The new direction. |
void PS_Particle::setMoveSpeed | ( | float | moveSpeed | ) |
Sets the moveSpeed of the Particle.
moveSpeed | The new moveSpeed. |
void PS_Particle::setPosition | ( | C_Vec2 | pos | ) |
Sets the position of the Particle.
pos | The new position. |
void PS_Particle::setScale | ( | float | scaleValue | ) |
Sets the scale of the Particle.
scaleValue | The new scale. |
void PS_Particle::update | ( | float | dt | ) |
A function that updates the Particle.
dt | The delta time. |
|
private |
The direction of the Particle.
|
private |
The movement speed of the Particle.
|
private |
The Position of the Particle.
|
private |
The scale of the Particle.
|
private |
A pointer to the Texture.
|
private |
A boolean for if the Particle should be tinted.
|
private |
The Tint colour of the Particle.