Using the API is rather simple. To get started, simply download the API to your computer, put it in your level folder, and include the API in your lunadll.lua file with this line of code placed at the head of the file:
Code: Select all
local snifit = API.load("snifit");
Out of the box, the API adds in two new behaviours for snifits (these affect the red snifits by default). You can implement these into your snifits by putting them in different layers. Naming a layer "Jump" or "Jump3" will cause all snifits within that layer to have their behavior modified according to the layer.
"Okay, that's great and all," you may say, "but what about other snifits?" To answer your question, there is a function included within the API that goes as so:
Code: Select all
snifit.configureSnifits{snifitType, projectile};
snifitType can be modified to affect which snifits are affected by this behavior: 1 corresponds to red snifits, 2 corresponds to blue ones, and 3 is for grays. In addition, you can set projectile to an ID of any NPC in the game, from 1-up mushrooms to more snifits to banzai bills (At the moment, the API does not compensate for NPC width and set the X position accordingly, so large projectiles will most likely end up being behind snifits. This may be fixed in time.)
That's all there is to it! Sorry if it looks intimidating, my explanations can be rather wordy at times.