Hi,
I am currently making a game on corona using lua. I am trying to change a variable in an infinite loop. The problem that I have is that as it is in an infinite loop, the variable is being changed constantly instead of just once.
For example;
function startGameLoop()
if startGame == 0 then
coins = 0
end
if died == 1 then
coins = coins + score (I would like this to only change once when the died variable is changed to 1)
end
Thank you so much if anyone replies.
Have a great rest of your day!