summaryrefslogtreecommitdiff
path: root/src/game/effects.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-15 18:13:28 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-15 18:13:28 +0100
commit6c5bb0dbe21cd173c86ff4264646566da95832bc (patch)
tree153714c861dff32d4badf65ad63e3a9f68f7a9fa /src/game/effects.cpp
parentd1ea04251bf5f77a0eeda2ce1247a17c19556a6c (diff)
Color modulation for animated textures.
Diffstat (limited to 'src/game/effects.cpp')
-rw-r--r--src/game/effects.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/game/effects.cpp b/src/game/effects.cpp
index 306405f..d9215e3 100644
--- a/src/game/effects.cpp
+++ b/src/game/effects.cpp
@@ -38,7 +38,7 @@ void fx_tracer_t::render_to(render::state_t *render)
fx_blood_t::fx_blood_t(state_t *game_, v2f_t x_, bool alien_) : effect_t(game_)
{
- ttl = game->now + 1.0f;
+ ttl = game->now + 0.3f;
x = x_;
alien = alien_;
@@ -52,9 +52,16 @@ fx_blood_t::fx_blood_t(state_t *game_, v2f_t x_, bool alien_) : effect_t(game_)
void fx_blood_t::render_to(render::state_t *render)
{
double phase;
+ sf::Color color;
- phase = (game->now - ttl) + 1;
- render->render(phase, &assets::fx.blood, render_bounds);
+ phase = (game->now - ttl) / 0.3 + 1;
+
+ if (alien)
+ color = sf::Color::Green;
+ else
+ color = sf::Color::Red;
+
+ render->render(phase, &assets::fx.blood, render_bounds, color);
}
} // namespace game