Added figure colour to shader and health component

Former-commit-id: e2c23e5132991cc436a678af43782e31ffc55516
This commit is contained in:
Joshua Barretto 2019-05-13 14:58:01 +01:00
parent ef8daef828
commit 6f984ca181

View File

@ -396,6 +396,16 @@ impl FigureMgr {
.map(|(change_by, change_time)| Rgba::new(1.0, 0.7, 0.7, 1.0)) .map(|(change_by, change_time)| Rgba::new(1.0, 0.7, 0.7, 1.0))
.unwrap_or(Rgba::broadcast(1.0)); .unwrap_or(Rgba::broadcast(1.0));
// Change in health as color!
let col = stats
.and_then(|stats| stats.hp.last_change)
.map(|(change_by, change_time)| {
Rgba::new(1.0, 0.7, 0.7, 1.0)
})
.unwrap_or(Rgba::broadcast(1.0));
state.update(renderer, pos.0, dir.0, col);
state.update(renderer, pos.0, dir.0, col); state.update(renderer, pos.0, dir.0, col);
} }
}, },