Generate this kind of 2d burst or pulse algorithm? I'm currently trying to develop a game using Cocos2d-x using C++.
I really need to generate this burst or (donut-shaped) pulse.
I'm having a difficult time how to generate such shape.

At first, I was thinking of scaling the image but that didn't work out because the line or "diameter" of the donut shape gets bigger accordingly.
Any experienced coders who can provide an equation of this thing? or maybe "mathematics" is more exact.



https://www.youtube.com/watch?v=ewnEE5mt1ZM
Rather than using an image, I would suggest doing this kind of effect using a shader. I'm not familiar with Cocos2d-x, but some quick googling suggests that it can work with shaders. You'd use a pixel shader that calculates the distance of each pixel to the center of the pulse effect, then applies a function based on that distance to define the shape and appearance of the pulse.

I made a quick shadertoy as a proof of concept and example.