Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vibhubhola
Created May 7, 2014 07:22
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save vibhubhola/1f6a76dbcb3b22b741f3 to your computer and use it in GitHub Desktop.
Save vibhubhola/1f6a76dbcb3b22b741f3 to your computer and use it in GitHub Desktop.
local function fire()
local beam = {}
for i = 1, 20 do
--Have used circle, but if you use a blurry yellow glow, it would look more like a fire
beam[i] = display.newCircle(0,0,3.5) --display.newImage("glow4.png")--
beam[i].x, beam[i].y = math.random(100,200) , 500
beam[i].alpha = 0.5
beam[i].trans = transition.to(beam[i], { x = math.random(100,200), y = math.random (300, 400), alpha = 0.1, time = math.random(1000, 1200), delay = 100, onComplete = function() if beam[i] then beam[i]:removeSelf() end end })
end
end
timer.performWithDelay(200, fire, -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment