|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Plays a rising particle burst when a player levels up. More...
#include <LevelUpBehavior.hpp>
Inheritance diagram for LevelUpBehavior:
Collaboration diagram for LevelUpBehavior:Public Member Functions | |
| LevelUpBehavior (VisualState &visual, float server_tick_rate) | |
| void | update (float dt) override |
| bool | isDone () const override |
| Returns true when the behavior has completed and can be removed. | |
| float | getDuration () const override |
| Total duration of this behavior in seconds. | |
| float | minDuration () const override |
| Minimum duration below which this behavior is skipped entirely. | |
Public Member Functions inherited from ADrawableBehavior | |
| const std::vector< Particle > & | getParticles () const |
| const std::vector< LineSegment > & | getLines () const |
Public Member Functions inherited from IBehavior | |
| virtual | ~IBehavior ()=default |
Private Member Functions | |
| void | _spawnParticles () |
Private Attributes | |
| VisualState & | _visual |
| float | _duration |
| float | _elapsed = 0.0f |
| bool | _spawned = false |
Additional Inherited Members | |
Protected Attributes inherited from ADrawableBehavior | |
| std::vector< Particle > | _particles |
| std::vector< LineSegment > | _lines |
Plays a rising particle burst when a player levels up.
Definition at line 9 of file LevelUpBehavior.hpp.
| LevelUpBehavior::LevelUpBehavior | ( | VisualState & | visual, |
| float | server_tick_rate | ||
| ) |
Definition at line 8 of file LevelUpBehavior.cpp.
|
private |
Definition at line 13 of file LevelUpBehavior.cpp.
References _duration, ADrawableBehavior::_particles, _visual, Particle::active, Particle::alpha, Particle::color, Particle::delay, PARTICLE_COUNT, Particle::pos, VisualState::pos, Particle::size, and Particle::vel.
Referenced by update().
Here is the caller graph for this function:
|
inlineoverridevirtual |
Total duration of this behavior in seconds.
Implements IBehavior.
Definition at line 15 of file LevelUpBehavior.hpp.
References _duration.
|
overridevirtual |
Returns true when the behavior has completed and can be removed.
Implements IBehavior.
Definition at line 71 of file LevelUpBehavior.cpp.
References _duration, _elapsed, and ADrawableBehavior::_particles.
|
inlineoverridevirtual |
Minimum duration below which this behavior is skipped entirely.
Implements IBehavior.
Definition at line 16 of file LevelUpBehavior.hpp.
|
overridevirtual |
Implements IBehavior.
Definition at line 44 of file LevelUpBehavior.cpp.
References _duration, _elapsed, ADrawableBehavior::_particles, _spawned, _spawnParticles(), _visual, and VisualState::pos.
Here is the call graph for this function:
|
private |
Definition at line 22 of file LevelUpBehavior.hpp.
Referenced by _spawnParticles(), getDuration(), isDone(), and update().
|
private |
Definition at line 23 of file LevelUpBehavior.hpp.
|
private |
Definition at line 24 of file LevelUpBehavior.hpp.
Referenced by update().
|
private |
Definition at line 21 of file LevelUpBehavior.hpp.
Referenced by _spawnParticles(), and update().