Racing

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Matt9537
Posts: 8
Joined: Tue Oct 02, 2007 4:41 pm

Racing

Post by Matt9537 » Tue Dec 09, 2008 11:26 am

Okay, I want two images to race along the screen via two separate polygons. The problem I have is that when I run the script they don't go at the same time. e.g. Image "B" goes first and then Image "A" goes after the first has completed this action.

Code: Select all

move image "B" to the points of graphic "Polygon" in  movementspeed seconds
move image "A" to the points of graphic "Polygon2" in 2.3 seconds
Here is a piece of the code. (Note: movementspeed is a variable set by the user).

Is there a way for both pieces of code to start at the same time? Or is there another way around this?

Thanks in advance

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Tue Dec 09, 2008 11:46 am

Try

Code: Select all

lock moves 
before and

Code: Select all

unlock moves 
after your move commands.

If you need more control about movement, you might want to look at animationEngine.

Cheers,

Malte

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Post by bn » Tue Dec 09, 2008 11:46 am

Hi Mat9537,

try

Code: Select all

lock moves
move image "B" to the points of graphic "Polygon" in  movementspeed seconds without waiting
move image "A" to the points of graphic "Polygon2" in 2.3 seconds without waiting
unlock moves
lock moves and without waiting are the magic commands
are you in any way related to Matt9536 :)
regards
bernd

Matt9537
Posts: 8
Joined: Tue Oct 02, 2007 4:41 pm

Post by Matt9537 » Tue Dec 09, 2008 12:27 pm

bn wrote:Hi Mat9537,

try

Code: Select all

lock moves
move image "B" to the points of graphic "Polygon" in  movementspeed seconds without waiting
move image "A" to the points of graphic "Polygon2" in 2.3 seconds without waiting
unlock moves
lock moves and without waiting are the magic commands
are you in any way related to Matt9536 :)
regards
bernd
Nope, I haven't heart of Matt9536... :?

Altough I'm not currently at a system I can try this on - it all sounds good! Seems like all I really needed was the 'without waiting'....

Thanks for the help

Post Reply