Hello,
i have two joystick buttons to move object on screen, it works like that
[lua]local function go_left(event)
if event.phase == “began” then
left = 1
else left = 0
end
return true
end
local function go_right(event)
if event.phase == “began” then
right = 1
else right = 0
end
return true
end
joystickLeft:addEventListener(“touch”, go_left)
joystickRight:addEventListener(“touch”, go_right)
local function going()
if left == 1 then
player.x = player.x - 3
end
if right == 1 then
player.x = player.x + 3
end
end
Runtime:addEventListener(“enterFrame”, going)[/lua]
and on first glance its ok, but it bugs sometime when i clicked joystick and then moved cursor(finger) away
how can i make button respond only on continuous touch? [import]uid: 16142 topic_id: 16869 reply_id: 316869[/import]