[epiar-devel] Splash effects
Matthew Zweig
thezweig at gmail.com
Sun Mar 21 17:14:59 PDT 2010
That sounds good to me. I would like to see the collisions happening
'pixel perfectly' if possible.
Matt
On Mar 21, 2010, at 10:42 AM, Christopher Thielen <chris at epiar.net>
wrote:
> If nobody is willing, I can handle at least the collision detection
> improvement.
>
> 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
> RAM:
>
> 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
>> http://epiar.net/mailman/listinfo/epiar-devel
> _______________________________________________
> epiar-devel mailing list
> epiar-devel at epiar.net
> http://epiar.net/mailman/listinfo/epiar-devel
More information about the epiar-devel
mailing list