0

Is it possible to implement a "collection" kind of achievement in Game Center achievements?

Let's say you design a game with a lot of gems that the player picks up. The gems come in ten different types, and some gems are rarer than other. Only when you have picked up at least one gem of all ten types, the "Collector" achievement will be 100% completed/unlocked.

Jonny
  • 15,955
  • 18
  • 111
  • 232
  • Yes - it should be possible. I'm not a GameCentre expert but, from memory, it's up to you (the developer) to keep track of users' activities and award the achievements when completed. – Robotic Cat Apr 08 '13 at 10:39

2 Answers2

0

Yes it's possible. You can use percentComplete property of GKAchievement object. Store your users collected items somewhere (i.e. NSUserDefaults) and report the percentage accordingly.

Adam
  • 26,549
  • 8
  • 62
  • 79
  • The problem is if the user uses several devices. You have no way of tracking general progress because the type information is stored on a single device. I'd have to store that information in game center and it seems that it's not designed to do that (unless maybe doing some workarounds, like using some of the bits in percentComplete to store the type information and others to store pct complete. However the % display in game center would be messed up). It seems GC is just designed for stuff like "collect 10 stars". I'd guess using iCloud could pull this off, but I'm not going there this time. – Jonny Apr 09 '13 at 02:29
  • When working with leaderboards, the GKScore object does have a context member for arbitrary data related to the score. A similar feature would be handy for achievements... – Jonny Apr 09 '13 at 02:36
  • Thats true, you will not be able to tell which items have been collected. You can use iCloud or create separate achievements for each item. – Adam Apr 09 '13 at 10:37
0

There is no such feature to Game Center achievements (at this point, who knows about future).

Jonny
  • 15,955
  • 18
  • 111
  • 232