TempEntity (entity)#

This class defines a temporary entity, that only last until a given animation is finished playing out. This has been created so that the Player entity could have a death animation. This was necessary because the Health component calls the Entity::destroy method directly (overridden in the player’s definition).

In hindsight, the strategy could’ve been different, especially since the addition of States <../States.html>, as the destroy method had to be overridden anyway in the end. This might thus be changed in the future, but this approach is relatively generic either way.

struct TempEntity : public Entity#
#include <TempEntity.hpp>

Temporary Entity, which is only created for an animation (for example, a death animation), and will be destroyed after the animation is complete.

Public Functions

TempEntity(Manager &man, std::string name, vec position, std::string sprite_name, std::string animation_name, float x_scale, float y_scale, SDL_RendererFlip sprite_flip)#
virtual void render() override#

Default render function: renders each component.