How to set the path of the object coordinates?

How to set the path of the object coordinates

table of coordinates

local tableP = { 100, 100, 150, 200, 180, 250, 200, 300}

object

local dot = display.newImage(“monkey.png”)

dot.x, dot.y  = 100, 100

it is necessary that the object was consistent across all four points

100, 100

150, 200

180, 250

200, 300

tell me the example of how to do it?

when I do so

local tableP = { 100, 100, 150, 200, 180, 250, 200, 300} local dot = display.newImage("monkey.png") dot.x, dot.y &nbsp;= 100, 100 &nbsp; i=1 &nbsp; b=1 &nbsp; while i \<= 4 do&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; onestep1 = table.concat (tableP, ", ", b, b ) &nbsp; &nbsp; &nbsp; onestep2 = table.concat (tableP, ", ", b+1, b+1 ) &nbsp; &nbsp; &nbsp; transition.to( dot, { time=1000, delay=1000 , alpha=1, x = onestep1, y= onestep2} ) &nbsp; &nbsp; &nbsp; b = i + ( i + 1 ) &nbsp; &nbsp; &nbsp; i = i+1 end &nbsp;

the object is passed directly to the point of 100,100 to point 200,300

and I need that he has passed on all four points

100, 100 to point 150, 200 to point 180, 250 to point 200, 300

Please help ???

I’d try this:

local tableP = { {100, 100}, {150, 200}, {180, 250}, {200, 300} } local dot = display.newImage("monkey.png") dot.x, dot.y = 100, 100 for i =1, 4 do transition.to( dot, { time=1000, delay=1000 , alpha=1, x = tableP[i][1], y= tableP[i][2]} ) end

not work ! :frowning:

plz help

Oops, my mistake.  Try the above code again, it’s been edited.

I’d try this:

local tableP = { {100, 100}, {150, 200}, {180, 250}, {200, 300} } local dot = display.newImage("monkey.png") dot.x, dot.y = 100, 100 for i =1, 4 do transition.to( dot, { time=1000, delay=1000 , alpha=1, x = tableP[i][1], y= tableP[i][2]} ) end

not work ! :frowning:

plz help

Oops, my mistake.  Try the above code again, it’s been edited.