A83: Re: Sprite Collisions


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

A83: Re: Sprite Collisions




Make an invisible box around two sprites. Lets say you have 2 8*8 sprites at
0,0 and 10,10. Since the sprites are 8*8 their x range is: 0-7 and 10 - 17.
So check to see if the seconds sprites original x coordinate (10) is within
the range of the first sprites (Check if 10 is within 0 and 7). If it would
be then do the same for the y coordinates. If both are within the range then
you have a collision. If not then continue you program.

P.S. - If the x is not within the range (no x collision) you dont have to
check for y. I think you know why.

From: Chris (Man in the Moon)
mecad@scv.net