i using this code (maybe have differents, because my project in working computer):
[lua]local char – here newImageSheet or etc…
local trans
local function moveChar( event )
local function listener (event)
Runtime:addEventListener(“touch”, moveChar)
end
x = event.x
y = event.y
trans = transition.to( char, { time=1500,x = x, y = y, onComplete = listener1 } ) – maybe differents, but – logic saved
Runtime:removeEventListener(“touch”, moveChar)
end
Runtime:addEventListener(“touch”, moveChar)
function char:postCollision( event )
print( “detect collision”)
transition.cancel(trans)
end
char:addEventListener( “postCollision” )[/lua]
And in console (debug) i have 5-10 logs “Detection collision” and not working moveChar.
Lol, i writed this “test code” and found problem, because not using “listener1”, but problem this:
first char in dynamic physics very small knocks down the second char, small 1-2px, but knocks down, what wrong?
I tryed using postCollision and preCollision, but knocks down have.
Sorry for my bad english! [import]uid: 211767 topic_id: 35432 reply_id: 140805[/import]