Author Topic: SPRCOLL does not work on PocketPC  (Read 3204 times)

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
SPRCOLL does not work on PocketPC
« on: 2008-Jan-28 »
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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10851
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SPRCOLL does not work on PocketPC
« Reply #1 on: 2008-Jan-28 »
Yikes!

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10851
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
SPRCOLL does not work on PocketPC
« Reply #2 on: 2008-Jan-29 »
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.

Offline AndyH

  • Dr. Type
  • ****
  • Posts: 383
    • View Profile
    • http://www.ovine.net/
SPRCOLL does not work on PocketPC
« Reply #3 on: 2008-Jan-29 »
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 :)