Here's an easy to use function that you can plug right in and it'll work with any sprite.
// ScreenWrap - Percentage System Version
Function screenwrap( sprite , physics , vx , vy )
If GetSpriteXByOffset( sprite ) < ( 0 - ( GetSpriteWidth( sprite) / 2 ) )
SetSpritePositionByOffset( sprite , GetSpriteXByOffset( sprite ) + 100 + GetSpriteWidth( sprite ) , GetSpriteYByOffset( sprite ) )
If physics = 1 Then SetSpritePhysicsVelocity( sprite , vx , vy )
Endif
If GetSpriteXByOffset( sprite ) > ( 100 + ( GetSpriteWidth( sprite) / 2 ) )
SetSpritePositionByOffset( sprite , GetSpriteXByOffset( sprite ) - ( 100 + GetSpriteWidth( sprite ) ) , GetSpriteYByOffset( sprite ) )
If physics = 1 Then SetSpritePhysicsVelocity( sprite , vx , vy )
Endif
If GetSpriteYByOffset( sprite ) < ( 0 - ( GetSpriteHeight( sprite ) / 2 ) )
SetSpritePositionByOffset( sprite , GetSpriteXByOffset( sprite ) , GetSpriteYByOffset( sprite ) + 100 + GetSpriteHeight( sprite ) )
If physics = 1 then SetSpritePhysicsVelocity( sprite , vx , vy )
Endif
If GetSpriteYByOffset( sprite ) > ( 100 + ( GetSpriteHeight( sprite ) / 2 ) )
SetSpritePositionByOffset( sprite , GetSpriteXByOffset( sprite ) , GetSpriteYByOffset( sprite ) - ( 100 + GetSpriteHeight( sprite ) ) )
If physics = 1 then SetSpritePhysicsVelocity( sprite , vx , vy )
Endif
EndFunction
It's easy to use.
Sprite - the sprite you want to wrap around the screen
Physics - 1 = sprite has physics / 2 = sprite doesn't have physics
vx - Sprite's velocity x ( only used if physics = 1 )
vy - Sprite's velocity y ( only used if physics = 1 )