Page 1 of 1

Racing

Posted: Tue Dec 09, 2008 11:26 am
by Matt9537
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

Posted: Tue Dec 09, 2008 11:46 am
by malte
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

Posted: Tue Dec 09, 2008 11:46 am
by bn
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

Posted: Tue Dec 09, 2008 12:27 pm
by Matt9537
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