I think there is an error in the doc. ..or I misunderstand something (or I am unable to detect my mistakes...)
In the documentation you can read SpriteCollision() shows a collision of the sprites that OVERLAP.
This seems to be wrong. Just check my little Bomberman "pre"-code.
SpriteCollision() alerts a collision even if the sprites are "in touch", they dont overlap.
my ressource site:
de.geocities.com/mfurt2002
its german, but you see the blue player does not "overlap" the wall. in the left upper corner, anyhow you see a collision alerted by SpriteCollision()
(the current code available for download shows also the x and y coordinates of the Wall in question)
Code: Select all
If KeyboardPushed(#PB_Key_s) ;move player 1 pixel down
  ResetList(Walls())
  While NextElement(Walls())   ; check all walls
    If Walls.Object()\Type=0  ; 0 are solid (brown) walls, 1= Grass
  If SpriteCollision(30,PlayerAx,PlayerAy,Walls.Object()\bitmap, Walls.Object()\ObjectX, Walls.Object()\ObjectY)
   StartDrawing(ScreenOutput())
    DrawText("KollisionDown "+Str(Walls.Object()\ObjectX)+Str(Walls.Object()\ObjectY))
    StopDrawing()
    MoveA=1
  Â
   EndIf
  EndIf
  Â
Wend
  If MoveA=0
   PlayerAy+1
   EndIf
  MoveA=0
 Â
  EndIf
I dont overlap with one of the walls.
Walls and Players size is 50x50 pixels. If one wall is at x0:y50, it ends at the right side at x=49. Players position starts at 50:50... so it should not collide. but for any reason it does.. strange..
can you let me know if the dok or I am/is wrong?