A simple example of CollideRect
Also check out this tutorial
http://www.2dgamecreators.com/tutorials/gameprogramming/collision/T1%20Collision2.html
Strict Local x:Int Local y:Int Graphics 640,480 ResetCollisions() 'SetColor 0,0,0 <--------------uncomment this out and see what happens DrawRect 300,300,100,100 CollideRect 300,300,100,100,0,1 '<---comment this out to see what happens Repeat x = MouseX() y = MouseY() 'check collision b/w a 10x10 rect against rect above If CollideRect(x ,y , 10 , 10 , 1 , 0) SetColor 255,0,0 DrawRect x , y , 5 , 5 '--note that collision is not against this SetColor 255,255,255 EndIf Flip Until KeyHit(KEY_ESCAPE) Or AppTerminate()
Also check out this tutorial
http://www.2dgamecreators.com/tutorials/gameprogramming/collision/T1%20Collision2.html