9#include <aegis2d/render/export.hpp>
68 static constexpr std::size_t max_flashes_per_second = 3;
89 bool flash(
Color color,
float seconds) noexcept;
96 bool shake(
float strength,
float seconds) noexcept;
100 void update(
float seconds) noexcept;
104 [[nodiscard]]
Color flash_color() const noexcept;
121 [[nodiscard]]
Vec2 offset() const noexcept;
125 core::Random random_;
127 std::array<
double, max_flashes_per_second> flash_starts_{};
128 std::size_t flash_count_ = 0;
130 float flash_left_ = 0.0F;
131 float flash_length_ = 0.0F;
132 float shake_strength_ = 0.0F;
133 float shake_left_ = 0.0F;
134 float shake_length_ = 0.0F;
JSON configuration file (server port, window size...) read through typed getters.
Definition config.hpp:58
Full-screen flashes and camera shake triggered by gameplay (explosions, hits).
Definition screen_effects.hpp:65
ScreenEffects(EffectSettings settings={}, std::uint64_t seed=0) noexcept
Creates the effects, with nothing showing.
EffectSettings settings() const noexcept
The player's choice.
void set_settings(EffectSettings settings) noexcept
Changes the player's choice; turning an effect off stops it at once.
RGBA color used by the renderer.
JSON configuration with dotted-path lookups, which can be changed and saved.
Vector and matrix types of the engine (GLM behind engine names).
OpenGL renderer: sprites, text and camera (client only).
Definition bitmap_font.hpp:16
aegis2d::Vec2 Vec2
2D vector of floats, in logical pixels: the engine-wide aegis2d::Vec2.
Definition renderer.hpp:17
Definition endpoint.hpp:85
Seeded random numbers that are the same on every platform.
Backend-independent renderer interface and the sprite it draws.
RGBA color with components in [0, 1].
Definition color.hpp:10
The player's choice about screen flashes and shake.
Definition screen_effects.hpp:24
void save(core::Config &settings, std::string_view section) const
Writes the choice into the player's settings.
void load(const core::Config &settings, std::string_view section)
Reads the choice written by save().
One textured quad to draw.
Definition renderer.hpp:46