Simultaneously executing scripts..

Apr 13, 2010 at 11:16 PM
Edited Apr 14, 2010 at 6:40 PM

What would be the best approach for using Jint to handle running scripts for multiple objects simultaneously? My current idea is to have a jint engine stored for each object. The jint engine would load that object's script and when an event has triggered, it would loop through the objects and step through their script. It would repeat this until all objects have finished executing. However, I have not been able to find much documentation on doing this kind of thing with Jint. As such, I figured I'l post here and see if anyone has any good ideas. Essentially my idea is to make a very simple game engine for a friend (tile map with scripted objects and basic collision) as he likes to tinker with scripting but isn't the type to actually make the engine. Jint seems like it could offer use most everything we'd want, however, I just could use some advice on making it efficient (aka I don't want one object's scripts to pause the execution of all the others).

Edit:  After playing with Jint a little bit, it does not seem like using step will really work in this situation.  Is there any way for me to have Jint just take a single step with the option to take another until it has finished?