Zappy GUI
C++ graphic client: renderer, camera, network
Loading...
Searching...
No Matches
DeathBehavior.hpp
Go to the documentation of this file.
1#pragma once
2
5
10 public:
11 DeathBehavior(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 _spawned = false;
25};
Base class for behaviors that produce visual drawables: sphere particles and line segments....
Handles the death animation for a player.
bool isDone() const override
Returns true when the behavior has completed and can be removed.
float minDuration() const override
Minimum duration below which this behavior is skipped entirely.
float getDuration() const override
Total duration of this behavior in seconds.
void update(float dt) override
VisualState & _visual
Visual-only state for an entity, driven by behaviors each frame. Logical state (x,...