I need to create objects that move from one part of the screen to another (up/down, left/right) then stop and move to previous position. I want object repeat it infinite times.
Thanks a lot.
P.S. Sorry for my English. [import]uid: 115740 topic_id: 21371 reply_id: 321371[/import]
You could use transition.to() with an onComplete listener for another transition.to() to loop the movement.
See here; http://developer.anscamobile.com/reference/index/transitionto
If you struggle let me know, I can try to write you a little example 
Peach [import]uid: 52491 topic_id: 21371 reply_id: 84616[/import]
Write an example please 
Thanks [import]uid: 115740 topic_id: 21371 reply_id: 84723[/import]
OK, this could be optimized and shortened down but should work well and be very easy to follow.
[lua]display.setStatusBar (display.HiddenStatusBar)
local trans1
local trans2
local trans3
local trans4
local box = display.newRect( 50, 50, 40, 40 )
trans1 = function()
transition.to(box, {time=1000, x=270, onComplete=trans2})
end
trans2 = function()
transition.to(box, {time=2000, y=430, onComplete=trans3})
end
trans3 = function()
transition.to(box, {time=1000, x=50, onComplete=trans4})
end
trans4 = function()
transition.to(box, {time=2000, y=50, onComplete=trans1})
end
trans1()[/lua]
Peach
[import]uid: 52491 topic_id: 21371 reply_id: 84732[/import]
It works! :))) Thank you very much!!! [import]uid: 115740 topic_id: 21371 reply_id: 84751[/import]
You’re very welcome
[import]uid: 52491 topic_id: 21371 reply_id: 84880[/import]