[Javascript] causing script to pause before moving to next command

David Merchant merchant at LATECH.EDU
Fri May 3 15:29:08 CDT 2002


I need to have a Javascript pause after a user makes an input before the 
computer makes its move (this is a javascript for Battleship which I'm 
tweaking to add sound effects in). I need the computer to wait a second for 
the sound effect from the player's move to finish before it makes a move 
(that will have a sound effect as well).

I'm doing a brain fart, and can't seem to get it to work, all attempts have 
failed to pause the script.

if (player[sy][sx][0] < 100) {
/* Hit something */
/* need to have set timeout here to delay setting image and playing sound */
setImage(sy,sx,103,false);
playSound(0);


TTFN,
David

Systems Librarian, Louisiana Tech University
merchant at latech.edu
JavaScript List Administrator (www.mountaindragon.com/javascript/)
Webmaster, HTML Encyclopedia (www.mountaindragon.com/html/)
Webmaster, Memorial Day Page (www.usmemorialday.org/)
Webmaster, Midori Ito Site (www.mountaindragon.com/midori/)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020503/33f7c981/attachment.htm>


More information about the Javascript mailing list