Hi Guys,
My small code part is below.
I want to move the second rectangle_ which is called as a[2] _after 1 second later but both are moving simultaneously.
How can I do that?
Thanks in advance.
[lua]
local a = {}
a[1] = display.newRect(100,200, 20,20)
a[2] = display.newRect(100,100, 20,20)
local function move()
for i = 1, 2 , 1 do
if i == 2 then
timer.performWithDelay( 2000, a[i]:translate( 1, 0 ) )
else
timer.performWithDelay( 0, a[i]:translate( 1, 0 ) )
end
end
end
Runtime:addEventListener( “enterFrame”, move )
[/lua]