Here is a complete code example:
SetVirtualResolution(500, 500)
SetWindowSize( 500, 500, 0 )
spr =CreateSprite(0)
SetSpriteSize(spr, 32, 32)
SetSpritePositionByOffset(spr, 250, 250)
SetSpritePhysicsOn(spr, 2)
SetPhysicsWallTop(0)
SetPhysicsWallBottom(0)
do
if GetSpriteYByOffset(spr) > 500
SetSpritePositionByOffset(spr, GetSpriteXByOffset(spr), 0)
endif
Sync()
loop
In that, the sprite falls due to gravity and when it reaches the bottom of the screen it is 'teleported' to the top.
It falls again because gravity continues to affect it but the momentum that it had is removed so it starts falling again from a stationary position.
What I want to do is retain the momentum that the sprite has before the telport.