Waiting without waiting

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nico_C_GHS
Posts: 44
Joined: Wed Jun 12, 2013 2:36 pm

Waiting without waiting

Post 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.
Attachments
Choco.livecode.zip
LC 6.0.1
(25.87 KiB) Downloaded 450 times
Nico Colarusso | Gracemount High School
Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Waiting without waiting

Post 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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Waiting without waiting

Post by [-hh] »

..........
Last edited by [-hh] on Wed Aug 13, 2014 12:08 pm, edited 1 time in total.
shiftLock happens
Newbie4
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 332
Joined: Sun Apr 15, 2012 1:17 am
Contact:

Re: Waiting without waiting

Post 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
Cyril Pruszko
https://sites.google.com/a/pgcps.org/livecode/
https://sites.google.com/a/setonhs.org/app-and-game-workshop/home
https://learntolivecode.com/
Nico_C_GHS
Posts: 44
Joined: Wed Jun 12, 2013 2:36 pm

Re: Waiting without waiting

Post 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)
Nico Colarusso | Gracemount High School
Post Reply