Let say if i have variable food = 100 , I want to decrease it -1/sec. So it will empty in 1 minutes 40 sec.
What I think is code like this :
function init(self)
food = 100
end
function update(self, dt)
food = food - 1 -- I know this code is wrong
if (food == 0) then
print("i'm die")
end
end
How to implement that?