This was a test run that I may include later on.
It failed.
ball = display.newCircle(60,60,60,60)
square = display.newRect(300,300,100,100)
group = display.newGroup()
group:insert(ball)
group:insert(square)
function moveball(event)
print("touched")
transition.to( ball, { time=1500, x=event.x, y=event.y} )
end
function check()
if (ball.x \>= 300) then
print("over 300")
transition.to( group, { time=1500, x=ball.x-300} )
end
end
Runtime:addEventListener("touch", moveball)
Runtime:addEventListener("enterFrame", check)
What is wrong with that?
(using “transition.to( ball, { time=1500, x=ball.x-300} )” would work so the code is fine) [import]uid: 79135 topic_id: 14325 reply_id: 314325[/import]

