diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:07:16 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:07:16 +0100 |
commit | 4dd7ac29fe0132b9f5896a84ccfe8d05363dfa74 (patch) | |
tree | 4abbd9e3aa4403020d7ece46dc4736f67730e2eb /src/game/effects.cpp | |
parent | cd9b7052f07291e3975bad5dcfe9ad0338c17e74 (diff) |
Add the blood effect (not yet finished).
Diffstat (limited to 'src/game/effects.cpp')
-rw-r--r-- | src/game/effects.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/effects.cpp b/src/game/effects.cpp index 99c8be8..e80623e 100644 --- a/src/game/effects.cpp +++ b/src/game/effects.cpp @@ -17,6 +17,8 @@ fx_tracer_t::fx_tracer_t(state_t *game_, v2f_t x0_, v2f_t x1_) : effect_t(game_) render_bounds[0] = x0; render_bounds[1] = x1; render_bounds = render_bounds.norm(); + cmodel.bounds = render_bounds; + cmodel.cflags = 0; } void fx_tracer_t::render_to(render::state_t *render) @@ -34,4 +36,22 @@ void fx_tracer_t::render_to(render::state_t *render) render->render_line(x0l, x1l, sf::Color::Yellow); } +fx_blood_t::fx_blood_t(state_t *game_, v2f_t x_, bool alien_) : effect_t(game_) +{ + ttl = game->now + 1.0f; + + x = x_; + alien = alien_; + + render_bounds[0] = x - v2f_t(0.2, 0.2); + render_bounds[1] = x + v2f_t(0.2, 0.2); + cmodel.bounds = render_bounds; + cmodel.cflags = 0; +} + +void fx_blood_t::render_to(render::state_t *render) +{ + render->render(&assets::fx.blood, render_bounds); +} + } // namespace game |