group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
DamageIndicator.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "hud/HudWidget.hpp"
5
6#include <vector>
7
9{
10 float arcDistance = 80.f;
11 float arcLength = 32.f;
12 float arcThickness = 6.f;
13 float fadeTime = 0.8f;
14
16 void update(float dt, const HudGameState& state, HudTweenPool& tweens) override;
17 void draw(HudContext& ctx, float drawX, float drawY) override;
18
19private:
20 struct Arc
21 {
22 float angleDeg = 0.f;
23 float timer = 0.f;
24 };
25 std::vector<Arc> arcs_;
26};
Base struct for all HUD widgets.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:18
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Definition DamageIndicator.hpp:21
float timer
Definition DamageIndicator.hpp:23
float angleDeg
Definition DamageIndicator.hpp:22
void draw(HudContext &ctx, float drawX, float drawY) override
Emit geometry into the draw context.
Definition DamageIndicator.cpp:24
float fadeTime
Definition DamageIndicator.hpp:13
float arcDistance
Distance from center.
Definition DamageIndicator.hpp:10
DamageIndicator()
Definition DamageIndicator.cpp:9
float arcLength
Arc segment length.
Definition DamageIndicator.hpp:11
std::vector< Arc > arcs_
Definition DamageIndicator.hpp:25
void update(float dt, const HudGameState &state, HudTweenPool &tweens) override
Called each frame before draw(). Update animation, consume events.
Definition DamageIndicator.cpp:14
float arcThickness
Definition DamageIndicator.hpp:12
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:148
Base class for a retained HUD element.
Definition HudWidget.hpp:16