Lightning effect trouble

Hi guys! :slight_smile:

I am trying to implement fllowing lightning effect in Corona Simulator.
But memory keeps increasing.
How can I group and delete all these lines?

local util = require(“util”)

_W = display.contentWidth
_H = display.contentHeight

gameStates = { menu = 0, pause = 1, gameOver = 2, levelSelection = 3, lightning = 4, inGame = 5};
currentState = gameStates[“menu”];

function onTouch(event)
if (event.phase == “began”) then
print(“creating lightning…”)
util.newLightning(_W/2,_H/2,event.x,event.y)
_G.currentState = gameStates[“lightning”]
end
end

Runtime:addEventListener(“touch”, onTouch)

You can find complete code here:https://github.com/astk/Corona-lua-lightning/blob/master/main.lua

Tnx! :slight_smile:

Did you add the plugin in the build.settings?

-SonicX278

Tnx Sonic, but there is no plugin mentioned anywhere (that is required for this).
What plugin shoud I add to build.settings?

I’m not sure… It’s just if you require something then there has to be a plugin…?

There are two plugins, and they are included in main.lua

I will play around with this… :slight_smile:

Tnx.

Did you add the plugin in the build.settings?

-SonicX278

Tnx Sonic, but there is no plugin mentioned anywhere (that is required for this).
What plugin shoud I add to build.settings?

I’m not sure… It’s just if you require something then there has to be a plugin…?

There are two plugins, and they are included in main.lua

I will play around with this… :slight_smile:

Tnx.