gamekit

Good practices for Game Center matchData

烈酒焚心 提交于 2019-12-01 07:56:55
问题 I am new to GKTurnBasedMatch and i'm trying to figure out what are good practices for the "matchData" sent between players during turns. All the tutorials i've found mainly cover sending a string of text and I would like to send a lot more than that. It would be great if someone could pint me to a more advanced tutorial. An example of what I would like to do is a battle. The two players have their avatars and they have different details (health, attack, defence, etc), how should I send this

Some startBrowsingForNearbyPlayersWithReachableHandler questions

試著忘記壹切 提交于 2019-12-01 04:18:11
问题 I'm trying to get local matchmaking working in GameKit using [[GKMatchmaker sharedMatchmaker] startBrowsingForNearbyPlayersWithReachableHandler:] . Essentially, I'm trying to implement interface-less local matches: as long as there's a player in my local vicinity, I want to connect and start a match. Importantly, I only want to do this for local players: I never want to match automatically over the internet. I've enabled Game Center for my app in iTunes connect and signed up for a different

Subclass of GKGraphNode costToNode method never getting called

别等时光非礼了梦想. 提交于 2019-11-30 21:11:26
I am trying to subclass GKGraphNode2D to also include different penalties for different terrains (in the costToNode method). When I create a new GKGraph with an array of my new subclass and call findPathFromNode on the GKGraph, it ignores my costToNode method entirely. The code looks like: public class PenaltyGraphNode: GKGraphNode2D { public let penalty: Float init(position: CGPoint, penalty: Float) { self.penalty = penalty let point = vector_float2(Float(position.x), Float(position.y)) super.init(point: point) } override public func costToNode(node: GKGraphNode) -> Float { guard let

GameKit wifi connection?

北城以北 提交于 2019-11-30 14:01:57
问题 I've read that as of iPhone OS 3.1, GameKit supports wifi connections. But the documentation states: "If your application configures the peer picker to allow Internet connections, your application must also dismiss the peer picker and present its own interface to configure an internet connection." Does this still stand? If so, how do I establish a wifi Bonjour session that can be used by GK? (I'm only interested in using the local network.) 回答1: Your GKSession object will automatically handle

iPhone p2p - Is there a way to connect to more than 1 devices?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 11:38:53
问题 Is it possible to connect to more than 1 devices using the new GameKit framework? Till now all the examples I've seen show how we can connect to 1 device. Even the default connection interface lets the user select just one connect. Thanks. 回答1: There's a fairly good overview here at the following link of how to configure and use GameKit for your App. GameKit Programming Guide: Peer-to-Peer Connectivity Unfortunately, you will not be able to use the GKPeerPickerController standard UI picker to

GameKit wifi connection?

北城以北 提交于 2019-11-30 09:31:19
I've read that as of iPhone OS 3.1, GameKit supports wifi connections. But the documentation states: "If your application configures the peer picker to allow Internet connections, your application must also dismiss the peer picker and present its own interface to configure an internet connection." Does this still stand? If so, how do I establish a wifi Bonjour session that can be used by GK? (I'm only interested in using the local network.) Your GKSession object will automatically handle the discovery of peers over WiFi or Bluetooth, and find those that are available on either protocol. The

gamekit over the internet

家住魔仙堡 提交于 2019-11-30 05:27:56
the gamekit over wifi documentation talks about local wifi and that it's built on top of bonjour. Does that mean it does not work over the Internet, locating user/players in a different subnet, different ISP ... etc If I need to connect to players/users on the Internet in general I assume I need to setup a server, right ? YES , Game Kit can be used to connect peers over Internet. BUT in this case your application must respond to peerPickerController:didSelectConnectionType: and handle all your private handshake protocol to discover peers and establish communication. A web service on your

Subclass of GKGraphNode costToNode method never getting called

99封情书 提交于 2019-11-30 04:48:04
问题 I am trying to subclass GKGraphNode2D to also include different penalties for different terrains (in the costToNode method). When I create a new GKGraph with an array of my new subclass and call findPathFromNode on the GKGraph, it ignores my costToNode method entirely. The code looks like: public class PenaltyGraphNode: GKGraphNode2D { public let penalty: Float init(position: CGPoint, penalty: Float) { self.penalty = penalty let point = vector_float2(Float(position.x), Float(position.y))

Building a SpriteKit/GameKit leaderboard within a specific scene

倖福魔咒の 提交于 2019-11-30 04:01:33
I'm pretty new to Swift and I'm having some trouble implementing a leaderboard into my game. I just watched a tutorial: 'Game Center Leaderboards! (Swift 2 in Xcode)' in which the GameCenter information all went through the one view of the app. In my game, I want the user to be able to play the game and then only when they are on a specific SKScene will they have access to GameCenter. So for example, on the GameOverScene will they be user authenticated and also will be able to upload their high score. I think I'm also missing some of the differences between the GameViewController (where all of

GameKit Bluetooth Transfer Problem

跟風遠走 提交于 2019-11-30 02:32:07
I am trying to send a file via Bluetooth using the GameKit framework. The problem I am having though is that I can only send one NSData object at a time, but I need to save it on the other end. this obviously isn't possible without knowing the filename, but i don't know how to transmit that. I've tried to convert it to a string NSData*data = [NSData dataWithContentsOfFile:urlAddress]; but i can only send one NSData object, not two. Has anyone come across this problem yet? Working with the GameKit for a while I've found that there is a limit of about 90k per 'send' so if you're file is larger