I am using game centre for my game for the multiplayer. Player can join game in two ways
"Game creator" who put some puzzle and
"Challenge acceptor" who want to solve the puzzle.
"Game creator" will decide the winner.
But I am stuck on the issue that is can we use game centre like this
Like : I am putting my puzzle on and waiting for random players to join, but How come Game centre will decide that only "challenge acceptors" joins the game ?
If anybody knows please help me out. Thanks in Advance.
You can use player attributes. From the Game Center Programming Guide:
A player attribute allows a player to pick the role he or she wants to
play within a match. With player attributes, each player can choose a
specific role and Game Center finds a proper mix of players to ensure
that all of the roles are filled.
To use player attributes, set the playerAttributes property of the GKMatchRequest before matchmaking. The game creator could use playerAttributes 0xFFFF0000, and the challenge acceptor could use playerAttributes 0x0000FFFF. The key is that the bitwise OR of the two values be 0xFFFFFFFF:
If Game Center sees a nonzero player attribute in the match request,
it adds players to the match intelligently so that all of the players,
when combined using a logical [sic] OR operation, have a complete mask of
FFFFFFFFh.
Related
So I have seen some totorials around that tell how to make a scoreboard using the Game Center API. Don't get me wrong I love the idea of Game Center, but I dont want my users to have to fuddle with logging in and I dont want to use their way of displaying scores because it does not match the style of the game.
Does anyone know of a better way to do this so I can decide how to display the scoreboard? All I want to do is tell the user his numerical rank like "rank: 1054", and then display the top 100 users (each user has their best score up). And then if I could just have an array with a string for their name, and numbers for their score. I am fine using the Game Center API as long as I dont have to use it for displaying it.
Also is their a way I could make like an "int" that is stored on Game Center that keeps track of how many times the play button has been pressed for all users? Thanks much!
I am in the process of creating an iOS multiplayer game and I want each player's screen to look EXACTLY like their opponents. For example, lets say I have 9 squares on the screen each with a number inside of them. I want each square on both screens to have exactly the same number. How can I do this through GameCenter? I understand how to send and receive data from player from player but I need a mechanism that sends the same number to both players in the game without each player generating their own random number.
Any help would be greatly appreciated!
My best answer would be to pull the data from a source online etc.
Have one device as the designated 'randomness' maker, and have that device send that data to the other one to use. Hope that helps
I would suggest using a seeded random value.
i am developing a sport application in IOS using Game Center integration. I have already configured all Game Center functions in my app, the only thing that is driving me crazy is the fact that i cannot increase the achievement percentage.
I want to do something like this:
GKAchievement *ach1 = [[GKAchievement alloc] initWithIdentifier:
#"1"];
ach1.percentComplete=ach1.percentComplete+50;
Is there a way to increse the percentage like this? Because i have 2 achievements in Game Center that reward the player for everytime he plays the game. For instance:
Achievement one: Play 5 games
Achievement two: Play 10 games
So my main goal is to get the previous achievement percentage and increase it with a constant.
The fact is ach1.percentComplete always return 0. Is there a way to make it return the previous percentage? Thanks for answering.
Not exactly what you have asked for, but I think you need to go about this a different way.
The number of games the user has played, should be part of some user data structure that is saved on the device.. and then update the percentage complete using that data.
But to expand a bit more on getting the current progress of an achievement, you should check to see if ach1 is null or not before accessing anything off of it. If ach1 is valid, then maybe there is a problem with the writing of current progress.
If you load all achievements and iterate them using GKAchievement loadAchievementsWithCompletionHandler percentComplete will contain the current value. Check the question's code here: GameKit achievement questions
Apple makes it wonky ...
Never used Game Center before in my apps. So be nice if the question is naive. I'm not sure if this is the right place to ask either. :)
I'm currently thinking to make my app support Game Center, primarily for the purpose of promoting my app. My app actually is a puzzle like game, think of Crossword puzzles, so it's not a very much multi-player game. However, I think I can make it competitive: one makes puzzle and the other solves it; the second round, the players switch roles. Now, my question is if Game Center supports such format. For example, does Game Center allows user pass a string or other kind of objects to other player? If it does, then I can implement the puzzle (provided by one player) into a string and decode it at other players end.
This sounds like exactly what the turn based game APIs introduced in iOS 5 are for. Check the GsmeKit docs.
New to XNA. Would love to hear your input in how to set up my clases for my Domino game. So far, I have a "BonesSprite" class which has fields like first value, second value, orientation, position etc. I have code on the LoadContent method which creates a List for each bone as shown in the code below.
Background = Game.Content.Load<Texture2D>(#"Images\Wood");
//Load several different automated sprites into the list
fichasList.Add(new Ficha(Game.Content.Load<Texture2D>(#"Images/46"),
10, Vector2.Zero, new Vector2(150, 150), 0, 0, true, true));
This is what i have so far: http://i129.photobucket.com/albums/p239/itsshortforleo/Untitled-1copy.jpg
I still can't come up with:
How to deal 7 bones to each player (I have an empty Player class that i don't know how to fill yet)
How to place the 7 bonesprites on the board so that only player 1 can see his bones and not the other players'
How to click on one bone to play it on the board on the exact position right next to the other bone and in the correct orientation
How can I highlight a bone when i have the mouse over it
The game seemed so simple to me until I started designing the classes. Appreciate your help.
Just a few ideas for your consideration:
You can deal with (1) and (2) simply. Make a Player and Bone class. Add to the Bone a field "owner" so that you can assign a Player to it. You did not write whether it is going to be turn-based "hot seats" or network game, nevertheless you'll get the correct bones to display just by checking their correcponding "owners" in a loop.
These are basics of the object oriented programming, I suggest you to read more about these concepts before starting a game. It won't take much time but it will make your life easier.
(4) First think how to get a correct bone recognized when clicking.
As others suggested you should also split your questions, (1) and (2) can go together, others not.