Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
EB_Animated.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "EB_Entity.h"
4 #include "../../Core/C_Vec2.h"
5 #include "../../Core/C_Timer.h"
6 
11 class EB_Animated : public EB_Entity
12 {
13 public:
26  C_Vec2 spriteDimensions, float animationLength, std::string iD, float* universalSpee);
27 
31  ~EB_Animated();
32 
37  virtual void update(float dt) = 0;
38 
43  void draw(SDL_Renderer* renderer);
44 
45 protected:
54 
59  virtual void animate(float dt);
60 };
C_Vec2 spriteIndex
The index of the current sprite in the spritesheet.
Definition: EB_Animated.h:51
C_Vec2 spriteDimensions
The dimensions of the sprite in the spritesheet.
Definition: EB_Animated.h:49
virtual void animate(float dt)
A virtual function that animates the sprite.
Definition: EB_Animated.cpp:19
C_Vec2 dimensions
The dimensions of the Entity.
Definition: EB_Entity.h:94
Contains variables and functions to be inherited by classes that are about Entities.
Definition: EB_Entity.h:10
virtual void update(float dt)=0
A pure virtual function that updates the Entity.
~EB_Animated()
Destructs the Animated Entity object.
Definition: EB_Animated.cpp:10
Contains the Vec2 structure with functions and overloaded operators.
Definition: C_Vec2.h:7
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.
Definition: EB_Animated.cpp:3
C_Vec2 pos
The position of the Entity.
Definition: EB_Entity.h:92
C_Texture * sprite
A pointer to the Entity Texture.
Definition: EB_Entity.h:90
C_Timer animationTimer
The animation timer.
Definition: EB_Animated.h:53
void draw(SDL_Renderer *renderer)
Draws the StormCloud to the screen.
Definition: EB_Animated.cpp:14
Handles timer functions.
Definition: C_Timer.h:7
An Entity that uses a spritesheet for animation.
Definition: EB_Animated.h:11
std::string iD
The ID of the type of Entity.
Definition: EB_Entity.h:96
Creates a Texture for use with a renderer.
Definition: C_Texture.h:13
int animationFrames
The number of animation frames in the spritesheet.
Definition: EB_Animated.h:47