简体   繁体   中英

Multipeer Connectivity with SpriteKit

I am familiar with using multipeer connectivity on single view applications. I am trying to make a game in SpriteKit currently and I'm not sure how to implement multipeer connectivity.

class GameplayScene: SKScene, MCSessionDelegate, MCBrowserViewControllerDelagate {

I got two errors on this which I assume has to do with GamplayScene being a scene and not a view controller. I was wondering if someone could explain how I can approach multiplier connectivity through an SKScene. I know SpriteKit uses view controllers so do I implement multiplier connectivity in that view controller? If so how could I communicate through that so I could potentially send information in my scene? I don't know if multiplier connectivity is even compatible with SpriteKit.

You can definitely use Multipeer Connectivity along with SpriteKit. You might want to consider separating your SpriteKit code from the code that handles the MPC data. Just make sure you update from the main thread rather than a background thread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM