I want to know if there is an easy way to test if an object is touching a color (black) for colision detecting.
Thanks
Thanks
function checkforblack(x1,y1,x2,y2) ;checks the perimeter for any non-black pixels local tempa local tempb local rgb lockbuffer(imagebuffer(backgroundimage)) setbuffer(imagebuffer(backgroundimage)) for tempa=x1 to x2 for tempb=0 to 1 rgb=readpixelfast(tempa,tempb*y2+y1) if GetRed(rgb)<>0 or GetGreen(rgb)<>0 or GetBlue(rgb)<>0 unlockbuffer(imagebuffer(backgroundimage)):return 0 ;the function returns a zero and exits else if tempa=x2 and tempb=1 then unlockbuffer(imagebuffer(backgroundimage)):return 1 ;the function returns a one and exits endif next next end function Function GetRed(rgb) Return rgb Shr 16 And %11111111 End Function Function GetGreen(rgb) Return rgb Shr 8 And %11111111 End Function Function GetBlue(rgb) Return rgb And %11111111 End Function