Creates a ForceField object that inherits Entity. More...
#include <ForceField.h>
Public Member Functions | |
ForceField (JAM_Texture *sprite, float x, float y, float width, float height, float velocity, float screenWidth, float screenHeight) | |
~ForceField () | |
void | update (float dt) |
![]() | |
JAM_Entity (JAM_Texture *sprite, float x, float y, float width, float height) | |
~JAM_Entity () | |
void | draw (SDL_Renderer *renderer) |
void | setPosition (float x, float y) |
void | setPosition (JAM_Vec2 position) |
void | setX (float x) |
void | setY (float y) |
void | setDimensions (float width, float height) |
void | setDimensions (JAM_Vec2 dimensions) |
void | setWidth (float width) |
void | setHeight (float height) |
JAM_Vec2 | getPosition () |
JAM_Vec2 | getDimensions () |
Private Attributes | |
float | velocity |
float | screenWidth |
float | screenHeight |
Creates a ForceField object that inherits Entity.
ForceField::ForceField | ( | JAM_Texture * | sprite, |
float | x, | ||
float | y, | ||
float | width, | ||
float | height, | ||
float | velocity, | ||
float | screenWidth, | ||
float | screenHeight | ||
) |
Constructs the ForceField object.
sprite | A pointer to the objects Texture. |
x | The x position of the ForceField. |
y | The y position of the ForceField. |
width | The width of the ForceField. |
height | The height of the ForceField. |
velocity | The velocity of the ForceField. |
screenWidth | The width of the screen. |
screenHeight | The height of the screen. |
ForceField::~ForceField | ( | ) |
Destructs the ForceField object.
|
virtual |
A function that updates the ForceField.
dt | The delta time. |
Implements JAM_Entity.
|
private |
The height of the screen.
|
private |
The width of the screen.
|
private |
The velocity of the ForceField.