0

I am programming a command line server in Swift for my game which uses physics simulation from SKScene. I've built it as an OS X application using view controller but I couldn't figure out how to port it to command line. The problem I am running into now is the rendering loop of SKScene.

When I have a SKScene and I present it in an SKView, it runs normally like expected. But when I tried creating the scene and calling update on it manually when it's not presented inside an SKView, it doesn't update the its SKPhysicsWorld. It seems like the physics simulation only updates when you have the scene presented in an SKView.

Is there a work around for this? Is physics world of SKScene strictly tied to the UI? Is created a server using Swift a bad idea in general?

  • I guess you can't. – Max Gribov Jul 24 '18 at 09:59
  • You should have SKView in which you will be able to run SKScene and accordingly can use SKPhysicsWorld... – Max Gribov Jul 24 '18 at 10:03
  • @MaxGribov I tried instantiating a SKView without presenting it on in a window and tried presenting the SKScene into it but it didn't work. The scene's functionality works but it just doesn't get updated. I am on command line so I am trying to avoid any UI. – TheProgrammer Jul 24 '18 at 19:05

0 Answers0