There's no code snippet board for AppGameKit, so I'll put it here. This has been duplicated in the Useful Community Functions project, but it's a great example of mathematics producing interesting animations for newcomers.
It's medialess so you can just copy, paste and compile.
SetVirtualResolution( 480, 854 )
SetSyncRate( 60, 0 )
sprite = createsprite(0)
SetSpriteSize( sprite, 10, 10 )
SetSpriteColor( sprite, 0, 255, 0, 255)
xy1sprite = createsprite(0)
SetSpriteSize( xy1sprite, 10, 10 )
SetSpriteColor( xy1sprite, 255, 255, 255, 255)
xy2sprite = createsprite(0)
SetSpriteSize( xy2sprite, 10, 10 )
SetSpriteColor( xy2sprite, 255, 255, 255, 255)
x1# = 100.0
x2# = 430.0
speed# = 1.0
y1# = 400.0
y2# = 554.0
SetSpritePosition( xy1sprite, x1#, y1# )
SetSpritePosition( xy2sprite, x2#, y2# )
x# = x1#
do
x# = AnimateSpriteWithHermite( Sprite, x1#, x2#, y1#, y2#, speed#, x# )
Sync()
loop
Function AnimateSpriteWithHermite( spr, x1#, x2#, y1#, y2#, speed#, x# )
yx# = 1 / (x2# - x1#)
x# = x# + speed#
if x# > x2# then x# = x1#
SetSpriteX ( spr, x# )
y# = Hermite ( y1#, y2#, yx# * (x# - x1#) )
SetSpriteY ( spr, y# )
EndFunction x#
function Hermite( startValue as float, endValue as float, value as float)
result# = Lerp(startValue, endValue, value * value * (3.0 - 2.0 * value))
endfunction result#
function Lerp( startValue as float, endValue as float , value as float )
result# = ((1.0 - value) * startValue) + (value * endValue)
endfunction result#