Hi, Ian (or anybody..) I have finally got around to using your sprite (alpha) collision function code, however I do not know exactly how to set it up and use it, for example, I think I have used it right, but don't know how to show this in my code, e.g. message popping up stating the sprites have collided, or the background changing a colour, anything just to show the sprites have colided..
in the code tag is Ian's code, and in the source button is my code, if you could just alter my code, or show me an example that performs the aforementioned then I would be most grateful.
Thanks in advance Ian/People.
-Nilrem
function SpriteCollisionAlpha(s1, s2)
result = 0
` rule out any chance that we're not colliding. if we are colliding
` (even at a non-alpha level) then proceed and test further
if sprite collision (s1, s2) > 0
` determine the leftmost sprite/image
if (sprite x(s1) 0
v=*Addr2
if (v && 0xff000000) 0
result = 1
j=width1
i=height1
endif
endif
inc Addr1,4
inc Addr2,4
next j
next i
` clean up after ourselves
delete memblock 256 : delete memblock 255
endif
endfunction result
P.S.
The images can be found at:
http://www.grinders.withernsea.com/ar/spaceship1.bmp
and
http://www.grinders.withernsea.com/ar/bullet_50x50.bmp
I hear and I forget. I see and I remember. I do and I understand.