SPRCOLL does not work on PocketPC

Previous topic - Next topic

AndyH

Hi, SPRCOLL does not work on Pocket PC.  Not been able to test with any other platform (eg: Mac, GP2X, Linux etc) but the following code works in Windows, but not on the Pocket PC:

Code (glbasic) Select
SETSCREEN 320,240,0
LIMITFPS 60

GLOBAL mx,my,ma,mb

BLACKSCREEN
DRAWRECT 0,0,16,16, RGB(255,255,255)

GRABSPRITE 0,0,0,16,16
GRABSPRITE 1,0,0,8,8

WHILE TRUE

MOUSESTATE mx,my,ma,mb

DRAWSPRITE 0, 160,120
DRAWSPRITE 1, mx,my

IF SPRCOLL( 0,160,120, 1,mx,my )
PRINT "COLLISION!!!",0,0
ELSE
PRINT "OK",0,0
ENDIF

SHOWSCREEN
WEND
Move the mouse to position the smaller square (used squares just for this example, in my code I have also tried LOADSPRITE with same results).  On Windows when any part of a pixel in sprite 1 and 2 overlap, the COLLISSION!!! message appears, otherwise OK.  On the Pocket PC COLLISION!!! will never appear.

Kitty Hello


Kitty Hello

It was a problem with transparency. You image was fully non-transparent. Then the colorkey color was plain white. Since your image was white only, you got no hit.
Make it green to work ;)
Fixed in next update.

AndyH

Thanks Gernot.  BTW - the mask I'd used in the PNG of my game was white too - DOH!  Good to know it will work in the next update though so I won't change to green for now.  Also, once the ANIMCOLL type command is available I won't need to use generic masks anyway :)