For the corresponding Entity variables go here
For the corresponding Entity variables go here
Talkback #1 written by Zip on 2004-07-16.
If you need the game to pause until an entity is done moving, you may find this function useful.
void WaitForEntity(int wait_entity)
// Waits until an entity has finished its movecode
{
// Just incase we get stuck somewhere, set a timeout
int timeout = timer + 1000;
// While the entity is still doing stuff
while (entity.movecode[wait_entity])
{
Render(); // Render the map
ShowPage(); // Display to screen
if (timeout < timer) // If they've got stuck
{
// Stop the entity
EntityStop(wait_entity);
// Notify you so you can fix your code
MessageBox("Timeout for entity number "+str(wait_entity));
}
}
}
Doc Nav |
Your docs |