There is no API for asynchronous Clock.tick() in pygame, how could I implement something like this? (This could be useful for things like pygbag that require async main loop.)
I don't think I can add more on an actual use case than what I've already said in the question without repeating myself, but I can try: making asynchronous version of pygame API would allow running games/projects in pygame concurrently. Where this could be useful? I can think of a few examples: gluing multiple programs (like launcher, etc...) without spawning a new process and limitations of communication that comes with it), debuggers (halting execution on pygame API calls and maybe logging it or adding debug information), running pygame projects in the frameworks that require asynchronicity
Right. In an async main loop, you might want to skip tick() altogether and instead just compute the time it took for execution to get back to you, and use that as your delta time value.
@AKX True, didn't think about this option. In that case, I probably would have to implement my own tick() method, that would inform the wrapper that the frame is finished. I wonder if it would be useful to asyncify some of the pygame API, like load calls.
tick()altogether and instead just compute the time it took for execution to get back to you, and use that as your delta time value.tick()method, that would inform the wrapper that the frame is finished. I wonder if it would be useful to asyncify some of the pygame API, like load calls.