Page 1 of 1

Waiting without waiting

Posted: Tue Oct 29, 2013 3:30 pm
by Nico_C_GHS
This is probably something really stupid and extremely easily fixed, however I am stumped.

Code: Select all

 on mouseDown
   set the vis of me to false
   send "show_enemies" to me
   move me to the points of graphic "Curve"
end mouseDown
I want the image to move to the start of the "line" that has been drawn (the graphic "Curve" is the line) and wait at the start without it actually following the path.

I have included a dummy version of the original program containing just the card that I am having problems with.
The inclusion of the coordinates function is just for personal reference to see when the program has stopped running (coordinates don't update during a "wait" command, for example).

Any help would be greatly appreciated.

Re: Waiting without waiting

Posted: Tue Oct 29, 2013 6:02 pm
by Simon
Hi Nico,
Like your last question wait is blocking.
Try this:

Code: Select all

on show_enemies
   wait 2 seconds with messages
   set the vis of target to true
end show_enemies
"...with messages" is the key.

Not sure it solves your problem but at least the mouse loc is shown.

Simon

Re: Waiting without waiting

Posted: Tue Oct 29, 2013 10:00 pm
by [-hh]
..........

Re: Waiting without waiting

Posted: Wed Oct 30, 2013 1:27 am
by Newbie4
Would this be simpler or is it not the effect that you are looking for?

Code: Select all

on mouseDown
   set the vis of me to false
   send "show_enemies" to me
   move me to the points of graphic "Curve"
   hide image "Choco"
   set the loc of image "Choco" to 1,256
   show image "Choco"
   ....
end mouseDown
"move" is slower, "set loc" is fast

Re: Waiting without waiting

Posted: Thu Oct 31, 2013 2:48 pm
by Nico_C_GHS
The code works fantastically, thank you for the assistance :D You guys are lifesavers, this code has been bugging me for a while! (no pun intended)