The img is only to help me explain a bit better what i'm trying to do. So, the img on the background as the points (A and B) are static images, but i want to make the line to move from point A to B, as in GPS.
I'm trying to make the "endLocation " img moving, but i can´t, and at this point i dont know what i'm doing xD, ahaha. Can you please show me how? I already try PVectors but still failed. I want to believe it is because i never used lerp() or PVectors, but at this point i have no idea
Answers
Yes.
look at lerp() to make this
draw a line from A to the lerp() point and increase amt in draw()
No for-loop
It's a direct line without the Z
I'm going to try it then. Thank you
this is what i got. i wonder if, instead of doing with a line i could put the "endLocation " img moving. is that possible?
Yes
I'm trying to make the "endLocation " img moving, but i can´t, and at this point i dont know what i'm doing xD, ahaha. Can you please show me how? I already try PVectors but still failed. I want to believe it is because i never used lerp() or PVectors, but at this point i have no idea
First, you lerp x
but you forgot to lerp y as well
Then just say
image(endLocation, x, y );
also you need to increase the amt value :
amt += .05;
and use it in both lerp()-lines
Remark:
to do this properly I suggest better names
That lets you have control and a good over view over your own code.
e.g. you use numbers in line or lerp - very confusing
Better use variables throughout
Like startX, startY
endX, endY (all four are fixed)
then currentX , currentY = they come from the lerp()-lines