Here is my code
[lua]local w = display.contentWidth
local h = display.contentHeight
local Player = display.newRect (15, 15, 15, 15)
Player.x = w * 0.5
Player.y = h * 0.5
local Leftbtn = display.newRect (35, 35, 35, 35)
Left.x = w * 0.1
Left.y = h * 1
function moveLeft (event)
if Player.x > w * 0.3 then
Player.x = Player.x - 10
end
end
Leftbtn:addEventListener (“touch”, moveLeft)
[/lua]
My question is
How to move my Player continuously when i press and hold the leftbtn.
Because when i hold the leftbtn now, it only move once and need me to press again to move.
What should I change if i want my Player move smoothly like someone walking.