Orbits.lua

orbits.lua allows the creation of various NPC circles. Originally intended for coin circles (as can be seen in NSMBWii) but as can be seen in the list of args below, any ID can be used. At this time it is suggested that you only create coin/Rupee circles, Boo circles, and firebar circles. There is no guaranteed support for all NPCs but feel free to do what you wish with this API.

Download Latest Version

For an example, see the level included which has fully documented code.

Installation
Place the file orbits.lua into the LuaScriptsLib folder.

Documentation
To enable the orbits library for a specific level, add this line to lunadll.lua: This will load the orbits API.

The Creator Function
This function creates an orbit. Only create orbits onStart; they SHOULD NOT be created in onTick, onDraw, etc. (though some exceptions may apply).

The following are named arguments usable to create an orbit:

Arg: attachToNPC
Can be used to attach an orbit to any NPC in the level. The following are options for attaching an orbit to an NPC:

This is best when the NPC has been placed in the editor. The arguments of the attachToNPC table are as follows:

This is best during runtime, especially for LunaLua-spawned NPCs are unique NPCs (such as bosses) that there are only one of as it is more condensed. The only argument is an NPC object.

Other Functions
The following functions are also available for use via this library:

Note
For Double-Sided NPCs that will always face right side.