maybe I am not using category bits correctly but, collision is still detected even though sprites are set to different category bits.
setdisplayaspect (640.0/480.0)
setvirtualresolution(640,480)
setbordercolor(0xFF,0xAA,0x33)
setclearcolor(0xaa,0xAA,0x00)
screen_w = getvirtualwidth()
screen_h = getvirtualheight()
rem ******************************************
rem ************creating bees*****************
bee1 = createsprite(loadimage("beeo.png",0))
setspritecategorybits(bee1,%0000000000000001)
SetSpriteCollideBits(bee1,%0000000000000001)
bee2 = clonesprite(bee1)
setspritecategorybits(bee2,%1000000000000000)
SetSpriteCollideBits(bee2,%1000000000000000)
setspritecolor(bee2,255,120,25,255)
bee1_w = getspritewidth(bee1) : bee1_h = getspriteheight(bee1)
bee2_w = getspritewidth(bee2) : bee2_h = getspriteheight(bee2)
bee1_fliph = 0 : setspriteflip(bee2,bee1_fliph,0)
bee2_fliph = 1 : setspriteflip(bee2,bee2_fliph,0)
explosion = createsprite(loadimage("exp16.png",0))
setspriteanimation(explosion,768/6.0,640/5.0,30)
setspritedepth(explosion,10000)
setspritevisible(explosion,0)
do
angle# = angle# + .5 : if angle# = 360 then angle# = 0
if angle# = 0 or angle# = 180
bee1_fliph = ABS(bee1_fliph - 1) : setspriteflip(bee1,bee1_fliph,0)
bee2_fliph = ABS(bee2_fliph - 1) : setspriteflip(bee2,bee2_fliph,0)
endif
setspritepositionbyoffset(bee1,screen_w/2.0+(screen_w-bee1_w)/2.0*sin(angle#-90),screen_h/2.0-50 )
setspritepositionbyoffset(bee2,screen_w/2.0-(screen_w-bee2_w)/2.0*sin(angle#-90),screen_h/2.0-50 )
rem create explosion when the bees hit with each other.
if getspritecollision(bee1,bee2)
setspritepositionbyoffset(explosion,screen_w/2.0,screen_h/2.0-50)
playsprite(explosion,10,0)
show_explosion = 1
else
if not getspriteplaying(explosion) then show_explosion = 0
endif
setspritevisible(explosion,show_explosion)
sync()
loop
end
as well two mentioned commands don't seem to be documented.
Quote: "
SetSpriteCollideBit
SetSpritePhysicsCollideBits
"