Sorry for the delay. I noticed that you are not clearing the Focus on the object you are dragging. You must first clear the focus of your previous touch listener in order for the code to recognize a new touch even if you removed the event listener the focus is still there:
local objectTouched --This is to get the event.target.id that you will use later assuming that your event.target.id is a number
local function dragAndDrop (e)
target = {}
distanceBetweeen = {}
objectTouched = event.target.id
for i = 1, #checkPoint do
target[i] = checkPoint[i]
end
if e.phase == "began" then
--YOUR CODE
elseif e.phase == "moved" then
--YOUR CODE
elseif e.phase == "ended" then
--YOUR CODE
elseif e.condition == "forceCancelled" then
-- ADD THIS CONDITION SO THAT THE FUNCTION WILL REMOVE -- THE FOCUSED OBJECT FIRST
display.getCurrentStage():setFocus(nil)
end
end
function timeoutGame()
--BEFORE YOU REMOVE THE EVENT LISTENER CALL THIS FIRST
ilusi[objectTouched]:dispatchEvent({name = "touch", target = ilusi[objectouched], condition = "forceCancelled"})
timeoutGroup.alpha = 1
timeoutGroup:toFront()
btnPause:removeEventListener("tap", pauseGame)
btnReload:removeEventListener("tap", goTo)
for i=1, #jawabanPasti do
ilusi[i]:removeEventListener ("touch",dragAndDrop)
end
end