The code for the movement is below
function moveInDirection(a# as float,spriteID as integer,amount# as float)
state=1
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
//a# = getSpriteAngle(SpriteIDangle)
x# = getSpriteXbyOffset(SpriteID)
y# = getSpriteYbyOffset(SpriteID)
x=x#+sin(a#)*amount#
y=y#-cos(a#)*amount#*aspect#
SetSpritePositionByOffset(SpriteID,x,y)
if getSpriteY(spriteID) > 640 //GetVirtualHeight()
SetSpritePosition (spriteID, getSpriteX(spriteID) , GetSpriteY (spriteID)-1408)
endif
if getSpriteY(spriteID)<-(128+64)
SetSpritePosition (spriteID, GetSpriteX (spriteID) , GetSpriteY (spriteID)+1408)
endif
if getSpriteX(spriteID) > 640 //GetVirtualHeight()
SetSpritePosition (spriteID, getSpriteX(spriteID)-1408, GetSpriteY (spriteID))
endif
if getSpriteX(spriteID)<-(128+64)
SetSpritePosition (spriteID, GetSpriteX (spriteID) + 1408, GetSpriteY (spriteID))
endif
//462,634
endfunction state
the main code is like this
speed#=0
do
//speed#=10
if GetRawKeyState(37) //left arrow pressed
TurnSprite(taxi,-speed#)
endif
if GetRawKeyState(39) //right arrow pressed
TurnSprite(taxi,speed#)
endif
if GetRawKeyState(38) //up arrow key pressed
if speed#<10 then inc speed#
endif
if GetRawKeyState(40) //Down arrow pressed
dec speed#
if speed#<0 then speed# =0
endif
for y = 1 to 11
for x = 1 to 11
moveInDirection(getSpriteAngle(taxi),block[x,y],-speed#)
next x
next y
print(pickColor(GetSpriteX(taxi),GetSpriteY(taxi)))
Sync ()
loop
there is 11 by 11 background tiles
fubar