Jump to content
  • Advertisement
Sign in to follow this  
flounder

looping javascript functions

This topic is 4415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

(i'm not sure what forum this should go in) i'm trying to make a mouse follower using javascript. I have a box that follows the mouse just fine, but it only calls the function to move the box when the mouse moves. I need to know how to call that function continuously. Anyone know?

Share this post


Link to post
Share on other sites
Advertisement
You will need to use one of the 2 timeout functions to call it every so often. setTimeout is one of the 2 functions, but I can't remember the other. Remember you're sharing the processing time with the browser, so you can't truly do anything continuously in a browser's javascript functions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!