TMC World Wrap Startup Kit

The Mojo Collective

You must be logged in to obtain assets


World Wrap Startup Kit Project with Defender Demo as example

GMS:2 Compatible

Supports horizontal, vertical or both and cornered wrapping

The project was designed to help you understand and code for games that require seamless world wrapping from left to right; also know as Defender Loop screen. Though support is there for all side wrapping.

The problems with looping the screen seamlessly is two fold:

  1. the instances that are at the room edge have to be seen from the other side of the room.
  2. your AIs need to be aware of the world wrapping and decide to give chase to the player or other object by wrapping from one side of the room to the other as the target across the room may actually be closer than something on the same side of the room.

To resolve the first problem, the API includes a drawing function which you can clone the code from to make your own world wrap compatible draw. The system also includes a world wrap move function similar to GM's native function which detects if instances are at the edge and require moving from room edge to room edge.

For the second problem, the AI world wrap awareness the API include a world wrap aware instance_nearest() and a coordinate conversion function so that you can convert any coordinates to a coordinate off screen to force the AIs to use the alternative coordinate (using standard GM functions) to aim for and move to the coordinate.

The API is minimalist in nature as it includes only the things that you will require. Anything more and you would be confounded.

The demo includes a Defender clone which shows a few things:

  1. How to Draw
  2. How to Wrap
  3. How to Aim
  4. How to Drive to the closest Wrapped Point


  1. Procedurally Generated Terrain
  2. Minimap
  3. Score and in between Level Bonus
  4. Player control
  5. Missile system with ahead targeting.

More info

End User Licence Agreement (EULA).

Age Rating: 4+


GMS1 - Version 2.0.5. Published December 23, 2015

Had to move the parent of objects up the resource tree to fix asset distribution bug

Privacy Policy
Loading, please wait

Package contents

Loading, please wait

What is the issue?

Loading, please wait