i would first compare yx coordinates from start position and end posi to determnine 
witch way to go, It doesn't matter if its a ramdom function.
then in case left to right add locv +1 if not bigger same for locH.
if you play with increase you'll speed up process.
you also can devide the distance bij just def posi - actual posi then move using a 
percent value of this distance, do this on both axis.
you get then a smooth effect. or from slow to speedy or speedy to stop at end posi...

be sure if you for example use mouse posi (witch is often moving!!) to refresh the 
script in order to recalculate trajectory.

Fabrice

"[EMAIL PROTECTED]" wrote:

> Hi list
> I am trying to move one sprite from one point1 of the screen (this is a
> random point) to one specific point2 ....
>
> Does someone know how can I prompt this sprite to move from this point1 to
> that point2 in the shortest and more straight path possible?
>
> I am sure that this is a very easy code, but I am new using lingo ....
>
> Thanks a lot
>
> Alvaro
>
> [To remove yourself from this list, or to change to digest mode, go to 
>http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
>[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
>learning and helping with programming Lingo.  Thanks!]

--
Zuidzijde reclamebureau
http://www.zuidzijde.nl

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to