Pipecannon.lua
A library which lets you create pipe cannons.
Documentation
This API stores all warps in your level in a table and lets you customise them using the fields below:
| pipecannon.exitspeed | Table of values corresponding to warp IDs. Sets speed at which the player will get launched. When set to 0, the warp behaves like normal. |
|---|---|
| pipecannon.angle | Table of values corresponding to warp IDs. Defines the angle of deviation in which the player should be shot, clockwise from perpendicular. Must be between -90 and 90. See visual aids below. |
| pipecannon.SFX | Set sound effect for exiting the warp. Default value is 22 (bill blaster). |
| pipecannon.effect | Set visual effect for exiting the warp. |
The fields angle and exitspeed can also be defined for each warp individually.
Example
pipeAPI = loadAPI("pipecannon")
-- You can set exit speeds for every warp
pipeAPI.exitspeed = {10,20,30,10,20,15,25,10,20,50,10,30,0,40}
-- Speeds set for doors/instant warps are ignored
-- Firing angles, clockwise from perpendicular
pipeAPI.angle = {}
pipeAPI.angle[12] = 45 -- Also can set individually
pipeAPI.angle[14] = -10
-- Sound effect for firing
pipeAPI.SFX = 22 -- default value (bullet bill sfx), set to 0 for silent
-- Visual effect for firing
pipeAPI.effect = 63 -- set to 0 for none