[epiar-devel] Splash effects
chris at epiar.net
Sun Mar 21 10:42:07 PDT 2010
If nobody is willing, I can handle at least the collision detection
I offer this because I've done so before in the last generation
codebase. The following works very well and takes very little CPU and
1. Generate alpha masks for all sprite images. As far as I know, we'll
have to do this on the SDL surface before destroying it (before it
'turns into' an OGL texture).
2. Do basic bounding box collision.
3. If 2 is a match, do bitmask collision. Using AND operations on
strips of the bitmask as strings makes this incredibly cheap. As the
bitmasks can all be 1-bit values, even the sane programmer who rounds
them up to 8-bit will not be using much space.
So, if nobody minds, I'd like to port my bitmask code and accompanying
shield effect code that uses it for 0.4.0. Objections?
Sent from my iPhone
On Mar 21, 2010, at 8:31 AM, Maoserr <maoserr at gmail.com> wrote:
> Regarding the splash on weapon hit. I think for the short term it's
> probably best to just have the splash effect occur in the center of
> the sprite (with a minor deviation around it depending on the size
> of the ship).
> For a completely accurate effect, it's probably necessary to figure
> out a way to retrieve the alpha mask of the image, do some vector
> math to see where it hits, and draw it from there, but this might
> not be what we want. Oriented rectangular collision detection or
> maybe polygon could be faster.
> epiar-devel mailing list
> epiar-devel at epiar.net
More information about the epiar-devel