Speed based on how fast user taps screen?

Hey all!

I was curious if anyone has come up with an easy way to implement a way for an object to move up the screen with a speed based on how fast the user keeps tapping the screen.  Physics or no physics - it really doesn’t matter to me…  If the user stops tapping, I would like the object to slow to a stop as well…  Any ideas or suggestions?  Thanks all!

local speed = 0 local speedbike = display.newRect(display.contentWidth\*.5,display.contentHeight-96,24,64) local go = function ( event ) speed = speed + 10 end Runtime:addEventListener("tap",go) local stop = function () if speed \> 0 then speed = speed - 2 elseif speed \<= 0 then speed = 0 end speedbike.y = speedbike.y - speed end Runtime:addEventListener("enterFrame",stop)
local speed = 0 local speedbike = display.newRect(display.contentWidth\*.5,display.contentHeight-96,24,64) local go = function ( event ) speed = speed + 10 end Runtime:addEventListener("tap",go) local stop = function () if speed \> 0 then speed = speed - 2 elseif speed \<= 0 then speed = 0 end speedbike.y = speedbike.y - speed end Runtime:addEventListener("enterFrame",stop)