[A83] Collision Routine


[Prev][Next][Index][Thread]

[A83] Collision Routine



Hey everyone, I need to write a collision routine!!!

Heres the deal:
I have 6 items that can colide with 12 items.

If you've ever played crackpot you'll know what I am talking about.

I have 6 flowers that fall in a vertical column.  Each one consists of three 
bytes.  yes I know this wastes mem, but it is good for speed.

Byte 1: Is it Moving? 1 or 0
Byte 2: Current Y Value
Byte 3: Current X Value <--- this never changes but helped with speed

I then have 12 ants that are possibly on the screen, here is their structure:
Byte 1: Is it visible? 1 or 0
Byte 2: Current X Value
Byte 3: Destination X Value
Byte 4: Current Y Value

I need to check if any flower is touching an ant.  And if it is, call a 
routine, if not, keep going.  It is possible for more than one collision per 
frame [or set of checks, you know what I mean.]  

So if anyone wants to help write this routine, please do!!!  I suggest 
starting with the ants... if the first byte is 0, skip the entire ant, else 
check all 6 flowers.  This saves the possible number of checks.

Thanks for your help all, if you need info, send me an email

-Joel