Converge
Converge.png
A weapon firing 5 projectiles that come together
playerAddSubWeapon("NameMe","fireE")
fire5Count=5

function fireE1_OnStart()
setPower(0.45)
end
function fireE1_OnStep()
end
function fireE1_OnVanish(cause)
fire5Count=fire5Count+1
end
function fireE_OnStart(level)
if fire5Count<5 then
release()
else
local tbl = LinearBullet(-33,getAngle(),2.0,0,getX(iSelf()),getY(iSelf()),12,5,"fireE1")
for index, uID in tbl do
addMoverTo(uID,60,0,MOVER_VANISH)
addMoverTo(uID,0,1,MOVER_SETANGLE,getAngle()-index)
addMoverTo(uID,15,16,MOVER_SETANGLE,getAngle()-index/4)
end
fire5Count=fire5Count-5
fire_interval=0
setv(0,0)
playSound(1)
end
end
function fireE_OnStep()
local cnt = getv(0)
if cnt > 5 then
release()
end
setv(0,cnt+1)
end
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.