
Added ragdoll ants, persistent goo and power-ups to my Phaser 3 roguelite – frame spikes went from 13.5 ms to 7.4 ms after fixing the first version
Thanks again for all the feedback on my last post about ANT HUNTER (gecko knight raids an ant colony). The game felt too calm, so this week was all about action:
- Killed ants get flung with a bit of fake 3D physics (height, gravity, bounce, wall reflection) instead of just fading out
- Goo stays on the floor: one RenderTexture at half resolution, blobs get queued and drawn in a single beginDraw / batchDraw / endDraw per frame
- Power-ups for 6 seconds: flame cone, chain lightning, exploding kills
- Kill streaks with callouts, and a "perfect dodge" that slows the world to 25 % while the gecko keeps full speed
The first version stuttered badly when 30+ ants died at once. What fixed it:
Batch all goo stamps per frame instead of drawing each one separately
Pool the flying goo bits (pre-warmed, max 120)
Update the kill-streak DOM element once per frame, not on every kill
Limit sounds to 40 voices per 60 ms (hordes were clipping the audio)
Happy to go into detail on any of it. Is anyone doing something smarter for persistent decals in Phaser?