How do I make a while loop that runs in the background?

instead of running several time it just plays its ones

I’m not entirely sure what this means, but I think you’re saying that the game loop exits after one iteration. If so, it’s hard to say what’s going on without seeing the logic that updates isGameStarted. My recommendation is that you step through the code to see when isGameStarted changes.

btw Earlier I recommended not to use Dispatch for your game loop, but instead use a thread. There’s a snippet showing this in the other post I referenced.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple