Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/funkyvisions/DDGameKitHelper
A simpler GameKitHelper inspired by Steffen Itterheim's version. This version takes a different approach by synchronizing a local cache with game center and visa versa. It uses Benjamin Borowski's GKAchievementNotification class to display achievements and highscore banners.
https://github.com/funkyvisions/DDGameKitHelper
Last synced: 2 months ago
JSON representation
A simpler GameKitHelper inspired by Steffen Itterheim's version. This version takes a different approach by synchronizing a local cache with game center and visa versa. It uses Benjamin Borowski's GKAchievementNotification class to display achievements and highscore banners.
- Host: GitHub
- URL: https://github.com/funkyvisions/DDGameKitHelper
- Owner: funkyvisions
- License: mit
- Created: 2011-12-16T22:07:02.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-04-30T03:22:20.000Z (over 11 years ago)
- Last Synced: 2023-03-16T01:46:36.236Z (almost 2 years ago)
- Language: Objective-C
- Homepage: www.funkyvisions.com
- Size: 191 KB
- Stars: 88
- Watchers: 4
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
- awesome - DDGameKitHelper - A simpler GameKitHelper inspired by Steffen Itterheim's version. This version takes a different approach by synchronizing a local cache with game center and visa versa. It uses Benjamin Borowski's GKAchievementNotification class to display achievements and highscore banners. (etc)
- awesome - DDGameKitHelper - A simpler GameKitHelper inspired by Steffen Itterheim's version. This version takes a different approach by synchronizing a local cache with game center and visa versa. It uses Benjamin Borowski's GKAchievementNotification class to display achievements and highscore banners. (etc)
README
A simpler GameKitHelper inspired by Steffen Itterheim's version
(http://www.learn-cocos2d.com). This version takes a different approach
by synchronizing a local cache with game center and visa versa.I was having a lot of troubles getting Steffen's library to work nicely
on iOS 4.2 devices. For one it was trying to write to the root bundle
directory. I've switch it to write to /Library.I was also having trouble with achievements not always getting reported
successfully. I think this has to do with Game Center not being
consistent with callback errors on 4.x devices. Now everything is kept
cached locally and each time game center comes back online it synchs
both ways. So if an achievement is reported on game center but not
locally, we re-cache it. If it's local but not in game center, we
report it. This allows a fresh install of the app to automatically get
all achievements and scores the first time it starts up.Steffen's GameKitHelper also did not cache scores. DDGameKitHelper
keeps track of the high score in each category. So even though it
reports the score each time (so that daily and weekly comparisons work),
it's only cached locally if the high score has been beat. It also
displays a message banner.DDGameKitHelper only deals with achievements and scores. Since none of
my games use multiplayer I didn't try to tackle an api for that. I also
have not tackled someone else signing in to game center. Right now I
think everything locally would synch with the new account, which really
isn't what you want neccessarily. So I will be working on a cache per
user. (UPDATE: I've implemented this)The DDGameKitHelperDelegate class is dependent on Benjamin Borowski's
GKAchievementNotification class.https://github.com/typeoneerror/GKAchievementNotification
It does an excellent job of display a slide down notification that fits in
seamlessly with game center. The only thing I needed to add to it was an
adjustFrame method to compensate for the iPad.USING IT
Authenticating a player
-----------------------[[DDGameKitHelper sharedGameKitHelper] authenticateLocalPlayer];
Checking authentication
-----------------------[[DDGameKitHelper sharedGameKitHelper] isLocalPlayerAuthenticated];
Unlocking an achievement
------------------------[[DDGameKitHelper sharedGameKitHelper] reportAchievement:@"1"
percentComplete:100];Reporting a score
-----------------[[DDGameKitHelper sharedGameKitHelper] submitScore:newscore
category:@"1"];Showing achievements
--------------------[[DDGameKitHelper sharedGameKitHelper] showAchievements];
Showing scores
--------------[[DDGameKitHelper sharedGameKitHelper] showLeaderboard];
[[DDGameKitHelper sharedGameKitHelper] showLeaderboardwithCategory:@"LeaderboardID" timeScope:GKLeaderboardTimeScopeAllTime];
where GKLeaderboardTimeScopeAllTime is also available in GKLeaderboardTimeScopeToday and GKLeaderboardTimeScopeWeekResetting achievements
----------------------[[DDGameKitHelper sharedGameKitHelper] resetAchievements];
SUMMARY
I know all of this functionality is available in iOS 5.x, but I want to
still support my 4.x users. This library plays nicely with iOS 4.x and
5.x.Doug Davies
Owner, Funky Visions
www.funkyvisions.com