This function returns whether the given variable holds a Time Source.
If the Time Source was destroyed, this will return false, however if the Time Source was stopped or it merely expired, it will continue to exist, meaning this function returns true.
time_source_exists(id);
Argument | Type | Description |
---|---|---|
id | Time Source | The Time Source to check |
if (time_source_exists(global.spawn_time_source))
{
if (keyboard_check_pressed(vk_space))
{
time_source_destroy(global.spawn_time_source);
}
}
This code checks if a Time Source exists. If it does, it checks if the Space key was pressed.
In that case, it destroys the Time Source.