How to change speed of moving object?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ahmedinvent24BUSGdU9
Posts: 43
Joined: Mon Oct 15, 2012 6:44 pm

How to change speed of moving object?

Post by ahmedinvent24BUSGdU9 » Tue Jan 29, 2013 5:33 pm

How to change speed of moving object while its moving?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to change speed of moving object?

Post by jmburnod » Tue Jan 29, 2013 6:15 pm

Hi Ahmed,

You can do that by different ways

You can define the during of the move like that:

Code: Select all

move NyControl  to tLoc in 2 seconds
or set the moveSpeed property:

Code: Select all

set the moveSpeed to 300 --  (pixelsPerSecond, 200 by default)
or building a list of points between the startloc and endloc and move the control in a loop

Best regards
Jean-Marc
https://alternatic.ch

ahmedinvent24BUSGdU9
Posts: 43
Joined: Mon Oct 15, 2012 6:44 pm

Re: How to change speed of moving object?

Post by ahmedinvent24BUSGdU9 » Tue Jan 29, 2013 6:45 pm

Thanks Jean-Marc
these code works :)
Thank You

Regards
Ahmed F.

Post Reply