Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Attributes | List of all members
JAM_Particle Class Reference

Creates a Particle object. More...

#include <Particle.h>

Collaboration diagram for JAM_Particle:
Collaboration graph

Public Member Functions

 JAM_Particle (JAM_Texture *texture, float scaleValue, JAM_Vec2 direction, float moveSpeed, JAM_Vec2 position)
 
 ~JAM_Particle ()
 
void update (float dt)
 
void draw (SDL_Renderer *renderer)
 
void setPosition (JAM_Vec2 position)
 
void setPosition (float x, float y)
 
void setScale (float scaleValue)
 
void move (JAM_Vec2 movement)
 
void moveX (float movement)
 
void moveY (float movement)
 
void setMoveSpeed (float moveSpeed)
 
void setDirection (JAM_Vec2 direction)
 
float getMoveSpeed ()
 
JAM_Vec2 getPosition ()
 
JAM_Vec2 getDirection ()
 
float getScale ()
 

Private Attributes

JAM_Texturetexture
 
JAM_Vec2 direction
 
JAM_Vec2 position
 
float scaleValue
 
float moveSpeed
 

Detailed Description

Creates a Particle object.

Author
Jamie Slowgrove Reference ~ This is a modified version of my PGG Assignment 2 Particle class.

Constructor & Destructor Documentation

JAM_Particle::JAM_Particle ( JAM_Texture texture,
float  scaleValue,
JAM_Vec2  direction,
float  moveSpeed,
JAM_Vec2  position 
)

Constructs the Particle Object.

Parameters
squareA pointer to the Texture.
scaleValueThe scale of the Particle.
directionThe direction of the Particle.
moveSpeedThe move speed of the Particle.
positionThe position of the Particle.
JAM_Particle::~JAM_Particle ( )

Destructs the Particle Object deleting the Particle Object from memory.

Member Function Documentation

void JAM_Particle::draw ( SDL_Renderer *  renderer)

Draw the Entity to the screen.

Parameters
rendererA pointer to the renderer.

Here is the call graph for this function:

JAM_Vec2 JAM_Particle::getDirection ( )

Getter # Gets the direction of the Particle.

Returns
The direction of the Particle.
float JAM_Particle::getMoveSpeed ( )

Getter # Gets the moveSpeed of the Particle.

Returns
The moveSpeed.
JAM_Vec2 JAM_Particle::getPosition ( )

Getter # Gets the position of the Particle.

Returns
The position of the Particle.
float JAM_Particle::getScale ( )

Getter # Gets the scale of the Particle.

Returns
The scale of the Particle.
void JAM_Particle::move ( JAM_Vec2  movement)

Move the Particle.

Parameters
movementThe amount to move by.

Here is the caller graph for this function:

void JAM_Particle::moveX ( float  movement)

Move the Particle along the X axis.

Parameters
movementThe amount to move by.
void JAM_Particle::moveY ( float  movement)

Move the Particle along the Y axis.

Parameters
movementThe amount to move by.
void JAM_Particle::setDirection ( JAM_Vec2  direction)

Setter # Sets the direction of the Particle.

Parameters
directionThe new direction.
void JAM_Particle::setMoveSpeed ( float  moveSpeed)

Setter # Sets the moveSpeed of the Particle.

Parameters
moveSpeedThe new moveSpeed.
void JAM_Particle::setPosition ( JAM_Vec2  position)

Setter # Sets the position of the Particle.

Parameters
positionThe new position.
void JAM_Particle::setPosition ( float  x,
float  y 
)

Setter # Sets the position of the Particle.

Parameters
xThe X position.
yThe Y position.
void JAM_Particle::setScale ( float  scaleValue)

Setter # Sets the scale of the Particle.

Parameters
scaleValueThe new scale.
void JAM_Particle::update ( float  dt)

A function that updates the Particle.

Parameters
dtThe delta time.

Here is the call graph for this function:

Member Data Documentation

JAM_Vec2 JAM_Particle::direction
private

The direction of the Particle.

float JAM_Particle::moveSpeed
private

The movement speed of the Particle.

JAM_Vec2 JAM_Particle::position
private

The Position of the Particle.

float JAM_Particle::scaleValue
private

The scale of the Particle.

JAM_Texture* JAM_Particle::texture
private

A pointer to the Texture.


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