Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
ForkBehavior.hpp
Go to the documentation of this file.
1#pragma once
2
5
10 public:
11 ForkBehavior(VisualState& visual, float server_tick_rate);
12
13 void update(float dt) override;
14 bool isDone() const override;
15 float getDuration() const override { return _duration; }
16 float minDuration() const override { return 0.0f; }
17
18 private:
19 void _spawnParticles();
20
22 float _duration; // in seconds, 10 ticks / server_tick_rate
23 float _elapsed = 0.0f;
24 bool _burstSpawned = false;
25};
Base class for behaviors that produce visual drawables: sphere particles and line segments....
Plays a scale-up animation when an egg is laid, with a particle burst at full size.
VisualState & _visual
void update(float dt) override
void _spawnParticles()
float getDuration() const override
Total duration of this behavior in seconds.
float minDuration() const override
Minimum duration below which this behavior is skipped entirely.
bool isDone() const override
Returns true when the behavior has completed and can be removed.
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...