Ok Now i’m lost.
Why do I get this error ?
Platform: iPad / x64 / 6.1 / Intel® HD Graphics 3000 / 3.1.0 - Build 9.17.10.2843
tap
falling
Runtime error
c:\corona projects\test2\main.lua:15: attempt to index global ’
timer’ (a number value)
stack traceback:
c:\corona projects\test2\main.lua:15: in function <c:\corona projectstest2\main.lua:6>
?: in function <?:218>
Code:
display.setStatusBar( display.HiddenStatusBar ) local falling = function() print ("falling callend") end local tap = function(event) if event.phase == "began" then timer = system.getTimer() elseif event.phase == "ended" then local time = system.getTimer() - timer if time \< 100 then print("tap") --move the player else print ("falling") timer.performWithDelay( 1, falling ,1) end end end local object = display.newImage( "ball.png" ) object:addEventListener("touch", tap)