Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
BroadcastBehavior.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7
13 public:
14 static constexpr int RING_POINTS = 64;
15
16 BroadcastBehavior(VisualState& visual, float server_tick_rate, float maxRadius, float mapWidth,
17 float mapHeight);
18
19 void update(float dt) override;
20 bool isDone() const override;
21 float getDuration() const override { return _duration; }
22 float minDuration() const override { return 0.0f; }
23
24 private:
25 struct ScatterSeed {
29 float sizeScale;
30 Color color;
31 };
32
34 float _duration; // in seconds, 7 ticks / server_tick_rate
35 float _elapsed = 0.0f;
37 float _halfW;
38 float _halfH;
39 std::vector<ScatterSeed> _seeds;
40
41 static constexpr int SCATTER_COUNT = 30;
42};
Base class for behaviors that produce visual drawables: sphere particles and line segments....
Expanding ring wave emitted from a broadcasting player, implemented as a circle of particles.
void update(float dt) override
float minDuration() const override
Minimum duration below which this behavior is skipped entirely.
static constexpr int RING_POINTS
static constexpr int SCATTER_COUNT
bool isDone() const override
Returns true when the behavior has completed and can be removed.
std::vector< ScatterSeed > _seeds
float getDuration() const override
Total duration of this behavior in seconds.
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...