engine-c: denser mid-fight fire/smoke/muzzle/impact for KKND2 combat read
This commit is contained in:
parent
72b2c0dc0a
commit
01c7ab8b76
5 changed files with 112 additions and 57 deletions
|
|
@ -398,8 +398,8 @@ void render_bullets(Game *g) {
|
|||
float d = sqrtf(dx * dx + dy * dy);
|
||||
if (d > 1.0f) {
|
||||
float ux = dx / d, uy = dy / d;
|
||||
int len = (b->kind == 2) ? 24 : (b->kind == 3) ? 18
|
||||
: (b->kind == 1) ? 14 : 10;
|
||||
int len = (b->kind == 2) ? 32 : (b->kind == 3) ? 24
|
||||
: (b->kind == 1) ? 20 : 14;
|
||||
for (int t = 1; t <= len; t++) {
|
||||
int tx = sx - (int)(ux * (float)t * 0.75f);
|
||||
int ty = sy - (int)(uy * (float)t * 0.75f);
|
||||
|
|
@ -421,7 +421,7 @@ void render_bullets(Game *g) {
|
|||
}
|
||||
}
|
||||
}
|
||||
int rad = (b->kind == 1 || b->kind == 3) ? 6 : 4;
|
||||
int rad = (b->kind == 1 || b->kind == 3) ? 8 : 5;
|
||||
SDL_SetRenderDrawColor(g->ren, 255, 160, 40, 255);
|
||||
SDL_RenderFillRect(g->ren, &(SDL_Rect){ sx - rad - 1, sy - rad - 1,
|
||||
(rad + 1) * 2, (rad + 1) * 2 });
|
||||
|
|
@ -467,9 +467,14 @@ 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) ? 5 : (p->kind == 3) ? 3 : (p->kind == 0) ? 4 : 3;
|
||||
int sz = (p->kind == 1) ? 9 : (p->kind == 3) ? 5 : (p->kind == 0) ? 7 : 4;
|
||||
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 + 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);
|
||||
} 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