[A83] Re: Collision Routine


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

[A83] Re: Collision Routine




Uhm... seems not too hard, although it still might be slow...

For anyone to try it you should specify the size of the sprites... although 
I assume standar 8x8 :) or are the ants less (can't remember from the demo 
you sent me...


>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
>
>
>




Signed by...
_______  .__             .__
\      \ |__| ____  ____ |  | _____    ______
/   |   \|  |/ ___\/  _ \|  | \__  \  /  ___/
/    |    \  \  \__(  <_> )  |__/ __ \_\___ \
\____|__  /__|\___  >____/|____(____  /____  >
        \/        \/                \/     \/


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com