Hurting (state)#

State for when an entity has been damaged, and must have a period of invulnerability and/or must have a flickering filter applied to it.

It is added to the entity in Health component when the entity takes damage (currently with a fixed cooldown of 450ms), and it is identified by the Sprite component so that a red, flickering filter is applied to the entity.

Note

Add a gif of it in effect.

struct Hurting : public Cooldown#

Public Functions

inline Hurting(Uint64 cool_down, Uint64 flicker_timer = 150, std::array<int, 3> sdl_colour_mask = {255, 0, 0}, int sdl_alpha_mask = 255)#
virtual void init() override#
virtual void custom_update() override#