Greetings!
I’ve been searching Lua and Defold manuals and have tried experimenting, but I haven’t found a solution to my problem. Here’s what I’m trying to do: I’ve created a loop that skips a few calls so that I’m not running a function and checking it every billionth of a millisecond. With this loop I’ve added an argument so that I can call whatever function is in that argument every time the loop succeeds. The problem I’m having is that I’m trying to run a function from a variable, and every time I do that the engine asks me to give that variable a value or that I need to name the function I’m trying to call (On the different experiments I made).
function init(self)
fire = printme()
function printme()
if printme >= 1200 then
loop("end")
else
printOne = printOne + 1
print(printOne)
end
end
function loop(fire)
for i=100,0,-1 do
if i == 0 and fire ~= "end" then
function(fire)
loop()
elseif i % 10 == 0 and fire ~= "end" then
function(fire)
else print ("loop closed")
end
end
end