Figen Güngör
Figen Güngör

Reputation: 12559

What to use in order to count down in seconds from a fixed minute in Lua?

I am trying to make a countdown from a fixed minute like 1:00 to 0:00 in Lua.

How can I do that?

Upvotes: 1

Views: 3073

Answers (1)

SatheeshJM
SatheeshJM

Reputation: 3633

I assume you are using Corona SDK.

Corona provides a simple way

local time = 60
local function decreaseTime()
   time = time-1
   print(time)
end

timer.performWithDelay(1000,decreaseTime,60)

have a read here http://developer.anscamobile.com/reference/index/timerperformwithdelay

Upvotes: 4

Related Questions