mobone Posted June 19, 2009 Share Posted June 19, 2009 For my game I have a javascriipt battle scripts with setTimeouts to call when the next turn (attack) can happen. The setTimeout calls the attack function and the attack happens at a specific and changing attack rate. Is there a way that you can think of that I could do this with php. I can't use sleep because its two timers at once. I could find the difference between the two timers and set the sleeps accordingly, but is there an easier way? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 19, 2009 Share Posted June 19, 2009 You don't want to delay PHP, it's not going to do what you're expecting. If you want PHP to run at certain times you'll need to use Javascript to send an ajax request to a PHP script. Link to comment Share on other sites More sharing options...
Ingolme Posted June 20, 2009 Share Posted June 20, 2009 PHP is not an "active" language. It executes the code and sends the result to the client and then stops executing. It's a Hypertext Preprocessor. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.