Graphics 800,600,0,1 SetBuffer BackBuffer() block = CreateImage(64,64) SetBuffer ImageBuffer(block) Rect 0,0,63,63 SetBuffer BackBuffer() player =CreateImage(32,32) SetBuffer ImageBuffer(player) Color 0,255,0 Rect 0,0,31,31 SetBuffer BackBuffer() frame = 0 x# = 0 y# = 0 xv# = 5 yv# = 1 bx = 128 by = 0 While Not KeyHit(1) Cls ClsColor 100,100,100 DrawImage block,bx,by If KeyDown(205) If ( ImagesOverlap( player , x# + xv# , y# , block , bx , by ) ) = False x# = x# + xv# EndIf ElseIf KeyDown(203) If ( ImagesOverlap( player , x# + xv# , y# , block , bx , by ) ) = False x# = x# + -xv# EndIf EndIf If x# < 0 x# = 0 ElseIf x# > GraphicsWidth() - ImageWidth(player) x# = GraphicsWidth() - ImageWidth(player) EndIf If y# < 0 y# = 0 ElseIf y# > GraphicsHeight() - ImageHeight(player) y# = GraphicsHeight() - ImageHeight(player) EndIf DrawImage player,x#,y# Flip Wend End
can someone tell me why the collisions on this thing don't work.