76
Technical forum / Re: Is there have timer in the WME?
« on: April 08, 2008, 09:28:21 AM »
Timer:
You can have a script attached to your main script with something like this:
while(true)
{
// code doing whatever you want
Sleep(3000);
}
This will execute your code each 3000 milliseconds (3 seconds)
To attach a script to your main game script use this --> Game.AttachScript(script_file_name);

Thread:
Each script is executed in a separated thread. So you only have to define the code you want in a separated script and attach it to your Scene or globally to your game's main script
You can have a script attached to your main script with something like this:
while(true)
{
// code doing whatever you want
Sleep(3000);
}
This will execute your code each 3000 milliseconds (3 seconds)
To attach a script to your main game script use this --> Game.AttachScript(script_file_name);

Thread:
Each script is executed in a separated thread. So you only have to define the code you want in a separated script and attach it to your Scene or globally to your game's main script