local buttonPouse = widget.newButton({
with = 50,
height = 50,
defaultFile = “buttons/pause.png”,
overFile = “buttons/pause1.png”,
onEvent= onEventListenerPouse
})
buttonPouse.x = 900
buttonPouse.y = 60
sceneGroup:insert (buttonPouse)
local secondsLeft = 3 * 60
local clockText = display.newText(“3:00”, display.contentCenterX, 30, “BrainFlowerEuro.ttf”, 40)
clockText:setFillColor( 0.7, 0.7, 1 )
local function updateTime()
secondsLeft = secondsLeft - 1
local minutes = math.floor( secondsLeft / 60 )
local seconds = secondsLeft % 60
local timeDisplay = string.format( “%02d:%02d”, minutes, seconds )
clockText.text = timeDisplay
end
local countDownTimer = timer.performWithDelay( 1000, updateTime, secondsLeft )
sceneGroup:insert(clockText)
end