BASICALLY,,, I've made a VERY simple 2d demo thingy, just to test out physics. Though i cant get it working.
It draws a red box slightly lowerd, and a couple of lines at either ends. A sprite is then loaded (2 images) and placed in a black area at the top right. Using some point and array commands, i wanted it to check the area infront and beneath it to get the red value, and if its all black then move one pixel. But ti dont work

it al lchecks out saying that the RGBR value = 0. something must be wrong with my logic. Any one care to help?
` Trans
` Initial
Sync On : Sync Rate 0
Set Display mode 800,600,32
` IMAGES
Load Image "ba.bmp",1
Load Image "bb.bmp",2
Sprite 1,500,0,1
Dim SAX#(Sprite Width(1)+2)
Dim SAY#(Sprite Height(1)+2)
Ink RGB(255,0,0),1
Box 50,50,550,550
Line 50,50,50,0
Line 51,50,51,0
Line 52,50,52,0
Line 548,50,548,0
Line 549,50,549,0
Line 550,50,550,0
XB# = 550
YB# = 550
Size# = 10
Ink RGB(0,0,0),1
Do
Gosub AI:
Sync
Gosub Mousey:
Sync
Gosub Cont:
Sync
Sync
Loop
` *-*-*-*-*-*-*-*-*-*
AI:
IF IM# = 1
IM# = 2
Else
IM# = 1
Endif
SH# = Sprite Height(1)
SW# = Sprite Width(1)
SY# = Sprite Y(1)
SX# = Sprite X(1)
` Array
For A = 1 to Sprite Height(1)
CV# = Point(SX#-1,SY#+A)
SAY#(A) = CV#
Next A
For A = 1 to Sprite Width(1)
CV# = Point((SX#-2)+A,(SY#+SW#)+1)
SAX#(a) = CV#
Next A
` Left 2 Right?
For A = 1 to Sprite Height(1)
If RGBR(SAY#(A)) = 0 then LtR# = 1 Else LtR# = 0
Next A
` Up 2 Down
For A = 1 to Sprite Width(1)
If RGBR(SAX#(A)) = 255 then UtD# = 0 Else LtR# = 1
Next A
If LtR = 0
SX# = SX#
Else
DEC SX#
Endif
IF UtD = 0
SY# = SY#
Else
DEC SY#
Endif
Sprite 1,SX#,SY#,IM#
Return
Mousey:
posx# = mousex()
posy# = mousey()
If posx# > XB#
posx# = XB#
If Posy# > YB#
posy# = YB#
EndIf
Endif
Return
Cont:
` 1 pressed
If inkey$() = "1"
Size# = 10
Endif
` 2 Pressed
If Inkey$() = "2"
Size# = 20
Endif
` MouseClick
If Mouseclick()=1
Wait 10
For A = 1 to Size#
Circle posx#,posy#,A
Next A
EndIf
Return
Function Trans(MX#, MY#, SI#)
EndFunction
Use any old 32x32 images as sprites, even a yellow n blue box will do. Cheers in advance