I am making a hide and seek game using Game Center. I have set up two roles: hider and seeker.
class Role
{
static let Seeker : UInt32 = 0xFFFF0000
static let Hider : UInt32 = 0xFFFF0000
}
I am setting the playerAtrributes field of my GKMatchRequest.
gkMatchRequest.playerAttributes = Role.Seeker | Role.Hider
Here is the question: How can I tell which player is which role?
Check out this excellent tutorial (Not Swift, but the concepts are the same.)
Basically what you do is the following:
Now you have a player that is set as the hider and seeker. Just save a variable saying what they are, and you are done.