It’s the weekend, so rather than working on gamey stuff I’m making the battles look better :D. I’ve been improving the way the big ships explode so the drifting hulks fade in better, and the subsidiary explosions now blast in various directions. Turrets now smoothly track their targets, and there are various other small tweaks like highlight flares when bullet weapons fire.
My last niggly annoyance of the day is bullets, by which I mean laser pulses.
I draw all the bullets in one go, to make it extra fast, which is fine, but to do this I have to draw them AFTER I’ve drawn all the ships.
The thing is, the bullets are quite big, and when they ’emerge’ from a gun turret, they obscure it for the first frame. Ideally, I’d draw the bullet above the ship but below the turret so it would emerge naturally.
I think I’ll code a real horrid hack, which is to mark bullets as ‘n00bs’ for the first few pixels of their existence, and draw the n00bs separate from the main bullets.
That way I keep generally drawing them fast, but I also don’t get any anomalies when you hit pause and catch that 1 in sixty-off chance of seeing the frame where it looks wrong…
This is why game code looks like spaghetti. All those hacks are there for a reason I tell you!