diff options
author | rodri <rgl@antares-labs.eu> | 2023-05-22 09:00:42 +0000 |
---|---|---|
committer | rodri <rgl@antares-labs.eu> | 2023-05-22 09:00:42 +0000 |
commit | e095f65376894dcdef067b63103f2e17e55a1f14 (patch) | |
tree | a941d8ed6b6c6149aa1eee503b11a955fdcf7213 /universe.c | |
parent | 1baca76aaf266a2d071af4a173aee5b85efeffd6 (diff) | |
download | musw-e095f65376894dcdef067b63103f2e17e55a1f14.tar.gz musw-e095f65376894dcdef067b63103f2e17e55a1f14.tar.bz2 musw-e095f65376894dcdef067b63103f2e17e55a1f14.zip |
improvements to show a bullet's explosion upon ttl consumption.
implemented a vfx subsystem to handle localized, async animations.
Diffstat (limited to 'universe.c')
-rw-r--r-- | universe.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -103,12 +103,15 @@ universe_collide(Universe *u) Bullet *b; for(s = u->ships; s < u->ships+nelem(u->ships); s++){ - for(b = s->rounds; b < s->rounds+nelem(s->rounds); b++){ - if(b->fired && b->ttl <= 0) - b->fired = 0; - if(b->fired) + for(b = s->rounds; b < s->rounds+nelem(s->rounds); b++) + if(b->fired){ + if(b->ttl <= 0){ + b->fired = 0; + continue; + } warp(b); - } + + } warp(s); } } @@ -152,11 +155,9 @@ inituniverse(Universe *u) } u->ships[0].mass = 10e3; /* 10 tons */ - u->ships[0].kind = NEEDLE; u->ships[0].fuel = 100; u->ships[1].mass = 40e3; /* 40 tons */ - u->ships[1].kind = WEDGE; u->ships[1].fuel = 200; u->ships[0].forward = u->ships[1].forward = ship_forward; |