move_wrap(hor,vert,margin)

Drag & Drop equivalent : wrapicon

 

hor = True / False.

vert = True / False.

margin = How far outside the view before the object wraps.

 

Example

move_wrap(true,false,5)

 

This function allows an object to 'wrap' from one side of the screen to the other, like in the game Asteroids.  Depending on whether you use true or false, the object will wrap in the desired direction, use true for both if you want the object to wrap around in all directions.

 

margin indicates how many pixels outside the view / room the object (sprite) can go before wrapping around, in the above example, the object will go out of the room 5 pixels before wrapping to the other side. If you want the object to completely go outside the room before wrapping, you need to put the sprite width / height for the margin:

 

move_wrap(true,false,sprite_width)

 

Note: This function is usually placed in the Outside Event.

 

Revision #1