Here are a few that might help get you started:
rem moves a sprite to the right when not rotated using a positive value
function moveSprite(spriteID, amount#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+cos(a#)*amount#,y#+sin(a#)*amount#*aspect#)
endfunction
rem moves a sprite up when not rotated using a positive value
function moveSpriteUp(spriteID, amount#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+sin(a#)*amount#,y#-cos(a#)*amount#*aspect#)
endfunction
rem turns a sprite by a set angle in relation to it's current angle
function turnSprite(spriteID,degrees#)
setSpriteAngle(spriteID,getSpriteAngle(spriteID)+degrees#)
endfunction
rem points a sprite at a particular point in space
function pointSprite(spriteID,x#,y#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
dx# = x#-getSpriteXbyOffset(spriteID)
dy# = y#-getSpriteYbyOffset(spriteID)
setSpriteAngle(spriteID,atanfull(dx#,dy#/aspect#))
endfunction
rem turns a sprite towards a particular point in space by a fraction higher than 0 and up to 1.0
function turnSpriteTo(spriteID,x#,y#,value#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
dx# = x#-getSpriteX(spriteID)
dy# = y#-getSpriteY(spriteID)
ang# = getSpriteAngle(spriteID)
targ# = atanfull(dx#,dy#/aspect#)-90
diff# = targ#-ang#
while diff#>=180
diff# = diff#-360
endwhile
while diff#<=-180
diff# = diff#+360
endwhile
new# = ang# + diff# * value#
setSpriteAngle(spriteID,new#)
endfunction