Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bg = display.newRect (100,100, 300, 300)
- local countdown
- local function listener (event)
- local r = math.random (1,255)
- bg:setFillColor (r,r,r)
- countdown = nil
- end
- local function tl (event)
- if event.phase == "ended" then
- if countdown then
- timer.cancel (countdown)
- countdown = nil
- end
- countdown = timer.performWithDelay(500, listener)
- end
- end
- bg:addEventListener ("touch", tl)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement