Saturday, November 26, 2022
HomeiOS Developmentswift - The best way to hold iOS SpriteKit GameScene (physics, and...

swift – The best way to hold iOS SpriteKit GameScene (physics, and so forth) working within the background (a minimum of for one minute)

For iOS multiplayer recreation utilizing GameCenter API, one of many gadget could be used as server and all the opposite participant units as ‘shopper’. Nonetheless, when anybody change the sport to background, all of the physics, motion, animations stops for that gadget. That is tremendous fragile significantly for the ‘server’ participant since he can cheat (e.g. rapidly change to background to keep away from dying within the subsequent second).

So how can I forestall the sport from pausing instantly when switching to background? I do know iOS has a restrict on how lengthy the app can run however even when an additional minute could be sufficient for the app to detect this occasion and change a server and transmit all obligatory information earlier than that.

Nonetheless, now matter what I attempted (e.g. add the background course of functionality for this app). As soon as I change the app to background, I observed all of the physics within the SKScene pause instantly, there isn’t a delay that I can course of this state.

Any concept?



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments