Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EB_Animated Class Referenceabstract

An Entity that uses a spritesheet for animation. More...

#include <EB_Animated.h>

Inheritance diagram for EB_Animated:
Inheritance graph
Collaboration diagram for EB_Animated:
Collaboration graph

Public Member Functions

 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...
 
virtual void update (float dt)=0
 A pure virtual function that updates the Entity. More...
 
void draw (SDL_Renderer *renderer)
 Draws the StormCloud to the screen. 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...
 

Protected Member Functions

virtual void animate (float dt)
 A virtual function that animates the sprite. More...
 

Protected Attributes

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

An Entity that uses a spritesheet for animation.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

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.

Parameters
spriteA pointer to the objects Texture.
posThe position of the Entity.
dimensionsThe dimensions of the Entity.
animationFramesThe number of animation frames in the spritesheet.
spriteDimensionsThe dimensions of the sprite.
animationLengthThe length of each animation frame.
iDThe ID of the Entity type.
universalSpeedA pointer for the universal speed of the game.
EB_Animated::~EB_Animated ( )

Destructs the Animated Entity object.

Member Function Documentation

void EB_Animated::animate ( float  dt)
protectedvirtual

A virtual function that animates the sprite.

Parameters
dtThe delta time.

Reimplemented in EE_Archer, EE_StormCloud, and EP_PlayerArcher.

Here is the call graph for this function:

Here is the caller graph for this function:

void EB_Animated::draw ( SDL_Renderer *  renderer)
virtual

Draws the StormCloud to the screen.

Parameters
rendererA pointer to the SDL renderer.

Reimplemented from EB_Entity.

Reimplemented in EP_Player.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void EB_Animated::update ( float  dt)
pure virtual

A pure virtual function that updates the Entity.

Parameters
dtThe delta time.

Implements EB_Entity.

Implemented in EP_Player, EB_VelocityAnimated, EE_Archer, EE_StormCloud, and EP_PlayerArcher.

Member Data Documentation

int EB_Animated::animationFrames
protected

The number of animation frames in the spritesheet.

C_Timer EB_Animated::animationTimer
protected

The animation timer.

C_Vec2 EB_Animated::spriteDimensions
protected

The dimensions of the sprite in the spritesheet.

C_Vec2 EB_Animated::spriteIndex
protected

The index of the current sprite in the spritesheet.


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