engine-c: bigger impact/explosion blooms
This commit is contained in:
parent
d1da64d84b
commit
6ac07fe3a6
5 changed files with 67 additions and 48 deletions
|
|
@ -533,14 +533,18 @@ void render_particles(Game *g) {
|
|||
Uint8 a = (Uint8)(255 * life_a);
|
||||
Uint8 rr = (Uint8)(p->r * life_a), gg = (Uint8)(p->g * life_a),
|
||||
bb = (Uint8)(p->b * life_a);
|
||||
int sz = (p->kind == 1) ? 9 : (p->kind == 3) ? 5 : (p->kind == 0) ? 7 : 4;
|
||||
/* larger bloom discs — fire/smoke read as KKND2 explosion cores */
|
||||
int sz = (p->kind == 1) ? 14 : (p->kind == 3) ? 7 : (p->kind == 0) ? 11 : 5;
|
||||
if (p->kind == 0 || p->kind == 1) {
|
||||
draw_particle_disc(g->ren, sx, sy, sz + 2, (Uint8)(rr / 2), (Uint8)(gg / 2),
|
||||
(Uint8)(bb / 2), (Uint8)(a * 0.55f));
|
||||
draw_particle_disc(g->ren, sx, sy, sz + 3, (Uint8)(rr / 2), (Uint8)(gg / 2),
|
||||
(Uint8)(bb / 2), (Uint8)(a * 0.50f));
|
||||
draw_particle_disc(g->ren, sx, sy, sz + 1, rr, gg, bb, a);
|
||||
if (p->kind == 1 && life_a > 0.45f)
|
||||
draw_particle_disc(g->ren, sx, sy - 1, sz / 2 + 1, 255,
|
||||
(Uint8)(220 * life_a), 80, a);
|
||||
if (p->kind == 1 && life_a > 0.40f)
|
||||
draw_particle_disc(g->ren, sx, sy - 2, sz / 2 + 2, 255,
|
||||
(Uint8)(230 * life_a), 90, a);
|
||||
if (p->kind == 1 && life_a > 0.65f)
|
||||
draw_particle_disc(g->ren, sx + 1, sy - 3, sz / 3 + 1, 255,
|
||||
255, 180, a);
|
||||
} else {
|
||||
SDL_SetRenderDrawColor(g->ren, rr, gg, bb, a);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx - sz/2, sy - sz/2, sz + 1, sz + 1 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue