Clone
3
Timeouts
Brosef edited this page 2025-06-22 17:07:48 +00:00

Timeouts

The timeout function is built into gameUtils.Game and is therefor accessible just by calling the following within your game:

self.timeout(timeoutID, delay)

To use the events:

# The onEvent function in your Game object
def onEvent(self, event):
    if event.type == gameUtils.Timeout:
        print(f'Timeout {event.timeoutID} just fired.')

To see if there's a timeout on the stack:

if self.awaitingTimeout(timeoutID):
    ...