Need help
Number of rounds of bullets are firing after all bullets deleted I am calling to update wave
bullet.script
function final(self)
-- data.shots = table with all instance of fired bullets
if table.maxn(data.shots) == 0 then
-- update wave
msg.post('level1:/common/controller', "update_waves")
end
end
Now, their is a button clicking on it it will delete all bullets and and update wave
funtion to remove bullets in controller.script
function removeBullets()
-- TASK 1
for i, v in pairs(data.shots) do
go.delete(v)
end
data.shots = {}
end
Here, I am making data.shots empty after loop but still condition inside final funtion in bullet.script executing several times
I wanted to update wave only once when all instance of fired bullets deleted by clicking button or by bullets destroyed by walls