<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: achievements - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/achievements</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 04:24:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/achievements/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>jonn4y on "GKHelper shows Leaderboards but not Achievements view"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22824#post-126297</link>
			<pubDate>Wed, 16 Nov 2011 08:45:57 +0000</pubDate>
			<dc:creator>jonn4y</dc:creator>
			<guid isPermaLink="false">126297@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,</p>
<p>i have added GKHelper with no issues and have everything working fine (completing achievements, adding to leader boards, showing leader boards etc)<br />
i have search the forums and stack overflow but can't seem to find this issue,</p>
<p>basically this works showing the leader boards:</p>
<pre><code>GameKitHelper* gkHelper = [GameKitHelper sharedGameKitHelper];
    [gkHelper showLeaderboard];</code></pre>
<p>but this doesn't to show the achievements:</p>
<pre><code>GameKitHelper* gkHelper = [GameKitHelper sharedGameKitHelper];
    [gkHelper showAchievements];</code></pre>
<p>it works perfect in another game i wrote but won't show here, can't be anything in the rootviewcontroller because leader boards are showing right?</p>
<p>anyone have any ideas?</p>
<p>thanks very much</p>
<p>just for fun heres my GKHelper.m:</p>
<pre><code>/*
 * cocos2d-project <a href="http://www.learn-cocos2d.com" rel="nofollow">http://www.learn-cocos2d.com</a>
 *
 * Copyright (c) 2010 Steffen Itterheim
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the &#34;Software&#34;), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED &#34;AS IS&#34;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> &#34;GameKitHelper.h&#34;

static NSString* kCachedAchievementsFile = @&#34;CachedAchievements.archive&#34;;

@interface GameKitHelper (Private)
-(void) registerForLocalPlayerAuthChange;
-(void) setLastError:(NSError*)error;
-(void) initCachedAchievements;
-(void) cacheAchievement:(GKAchievement*)achievement;
-(void) uncacheAchievement:(GKAchievement*)achievement;
-(void) loadAchievements;
-(void) initMatchInvitationHandler;
-(UIViewController*) getRootViewController;
@end

@implementation GameKitHelper

static GameKitHelper *instanceOfGameKitHelper;

#pragma mark Singleton stuff
+(id) alloc
{
	@synchronized(self)
	{
		NSAssert(instanceOfGameKitHelper == nil, @&#34;Attempted to allocate a second instance of the singleton: GameKitHelper&#34;);
		instanceOfGameKitHelper = [[super alloc] retain];
		return instanceOfGameKitHelper;
	}

	// to avoid compiler warning
	return nil;
}

+(GameKitHelper*) sharedGameKitHelper
{
	@synchronized(self)
	{
		if (instanceOfGameKitHelper == nil)
		{
			[[GameKitHelper alloc] init];
		}

		return instanceOfGameKitHelper;
	}

	// to avoid compiler warning
	return nil;
}

#pragma mark Init &#38; Dealloc

@synthesize delegate;
@synthesize isGameCenterAvailable;
@synthesize lastError;
@synthesize achievements;
@synthesize currentMatch;
@synthesize matchStarted;

-(id) init
{
	if ((self = [super init]))
	{
		// Test for Game Center availability
		Class gameKitLocalPlayerClass = NSClassFromString(@&#34;GKLocalPlayer&#34;);
		bool isLocalPlayerAvailable = (gameKitLocalPlayerClass != nil);

		// Test if device is running iOS 4.1 or higher
		NSString* reqSysVer = @&#34;4.1&#34;;
		NSString* currSysVer = [[UIDevice currentDevice] systemVersion];
		bool isOSVer41 = ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending);

		isGameCenterAvailable = (isLocalPlayerAvailable &#38;&#38; isOSVer41);
		NSLog(@&#34;GameCenter available = %@&#34;, isGameCenterAvailable ? @&#34;YES&#34; : @&#34;NO&#34;);

		[self registerForLocalPlayerAuthChange];

		[self initCachedAchievements];
	}

	return self;
}

-(void) dealloc
{
	CCLOG(@&#34;dealloc %@&#34;, self);

	[instanceOfGameKitHelper release];
	instanceOfGameKitHelper = nil;

	[lastError release];

	[self saveCachedAchievements];
	[cachedAchievements release];
	[achievements release];

	[currentMatch release];

	[[NSNotificationCenter defaultCenter] removeObserver:self];

	[super dealloc];
}

#pragma mark setLastError

-(void) setLastError:(NSError*)error
{
	[lastError release];
	lastError = [error copy];

	if (lastError)
	{
		NSLog(@&#34;GameKitHelper ERROR: %@&#34;, [[lastError userInfo] description]);
	}
}

#pragma mark Player Authentication

-(void) authenticateLocalPlayer
{
	if (isGameCenterAvailable == NO)
		return;

	GKLocalPlayer* localPlayer = [GKLocalPlayer localPlayer];
	if (localPlayer.authenticated == NO)
	{
		// Authenticate player, using a block object. See Apple&#039;s Block Programming guide for more info about Block Objects:
		// <a href="http://developer.apple.com/library/mac/#" rel="nofollow">http://developer.apple.com/library/mac/#</a><a href='http://www.cocos2d-iphone.org/forum/tags/documentation'>documentation</a>/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
		[localPlayer authenticateWithCompletionHandler:^(NSError* error)
         {
             [self setLastError:error];

             if (error == nil)
             {
                 [self initMatchInvitationHandler];
                 [self reportCachedAchievements];
                 [self loadAchievements];
             }
         }];

		/*
		 // NOTE: bad example ahead!

		 // If you want to modify a local variable inside a block object, you have to prefix it with the __block keyword.
		 __block bool success = NO;

		 [localPlayer authenticateWithCompletionHandler:^(NSError* error)
		 {
         success = (error == nil);
		 }];

		 // CAUTION: success will always be NO here! The block isn&#039;t run until later, when the authentication call was
		 // confirmed by the Game Center server. Set a breakpoint inside the block to see what is happening in what order.
		 if (success)
         NSLog(@&#34;Local player logged in!&#34;);
		 else
         NSLog(@&#34;Local player NOT logged in!&#34;);
		 */
	}
}

-(void) onLocalPlayerAuthenticationChanged
{
	[delegate onLocalPlayerAuthenticationChanged];
}

-(void) registerForLocalPlayerAuthChange
{
	if (isGameCenterAvailable == NO)
		return;

	// Register to receive notifications when local player authentication status changes
	NSNotificationCenter* nc = [NSNotificationCenter defaultCenter];
	[nc addObserver:self
		   selector:@selector(onLocalPlayerAuthenticationChanged)
			   name:GKPlayerAuthenticationDidChangeNotificationName
			 object:nil];
}

#pragma mark Friends &#38; Player Info

-(void) getLocalPlayerFriends
{
	if (isGameCenterAvailable == NO)
		return;

	GKLocalPlayer* localPlayer = [GKLocalPlayer localPlayer];
	if (localPlayer.authenticated)
	{
		// First, get the list of friends (player IDs)
		[localPlayer loadFriendsWithCompletionHandler:^(NSArray* friends, NSError* error)
         {
             [self setLastError:error];
             [delegate onFriendListReceived:friends];
         }];
	}
}

-(void) getPlayerInfo:(NSArray*)playerList
{
	if (isGameCenterAvailable == NO)
		return;

	// Get detailed information about a list of players
	if ([playerList count] &#62; 0)
	{
		[GKPlayer loadPlayersForIdentifiers:playerList withCompletionHandler:^(NSArray* players, NSError* error)
         {
             [self setLastError:error];
             [delegate onPlayerInfoReceived:players];
         }];
	}
}

#pragma mark Scores &#38; Leaderboard

-(void) submitScore:(int64_t)score category:(NSString*)category
{
	if (isGameCenterAvailable == NO)
		return;

	GKScore* gkScore = [[[GKScore alloc] initWithCategory:category] autorelease];
	gkScore.value = score;

	[gkScore reportScoreWithCompletionHandler:^(NSError* error)
     {
         [self setLastError:error];

         bool success = (error == nil);
         [delegate onScoresSubmitted:success];
     }];
}

-(void) retrieveScoresForPlayers:(NSArray*)players
						category:(NSString*)category
						   range:(NSRange)range
					 playerScope:(GKLeaderboardPlayerScope)playerScope
					   timeScope:(GKLeaderboardTimeScope)timeScope
{
	if (isGameCenterAvailable == NO)
		return;

	GKLeaderboard* leaderboard = nil;
	if ([players count] &#62; 0)
	{
		leaderboard = [[[GKLeaderboard alloc] initWithPlayerIDs:players] autorelease];
	}
	else
	{
		leaderboard = [[[GKLeaderboard alloc] init] autorelease];
		leaderboard.playerScope = playerScope;
	}

	if (leaderboard != nil)
	{
		leaderboard.timeScope = timeScope;
		leaderboard.category = category;
		leaderboard.range = range;
		[leaderboard loadScoresWithCompletionHandler:^(NSArray* scores, NSError* error)
         {
             [self setLastError:error];
             [delegate onScoresReceived:scores];
         }];
	}
}

-(void) retrieveTopTenAllTimeGlobalScores
{
	[self retrieveScoresForPlayers:nil
						  category:nil
							 range:NSMakeRange(1, 10)
					   playerScope:GKLeaderboardPlayerScopeGlobal
						 timeScope:GKLeaderboardTimeScopeAllTime];
}

#pragma mark Achievements

-(void) loadAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	[GKAchievement loadAchievementsWithCompletionHandler:^(NSArray* loadedAchievements, NSError* error)
     {
         [self setLastError:error];

         if (achievements == nil)
         {
             achievements = [[NSMutableDictionary alloc] init];
         }
         else
         {
             [achievements removeAllObjects];
         }

         for (GKAchievement* achievement in loadedAchievements)
         {
             [achievements setObject:achievement forKey:achievement.identifier];
         }

         [delegate onAchievementsLoaded:achievements];
     }];
}

-(GKAchievement*) getAchievementByID:(NSString*)identifier
{
	if (isGameCenterAvailable == NO)
		return nil;

	// Try to get an existing achievement with this identifier
	GKAchievement* achievement = [achievements objectForKey:identifier];

	if (achievement == nil)
	{
		// Create a new achievement object
		achievement = [[[GKAchievement alloc] initWithIdentifier:identifier] autorelease];
		[achievements setObject:achievement forKey:achievement.identifier];
	}

	return [[achievement retain] autorelease];
}

-(void) reportAchievementWithID:(NSString*)identifier percentComplete:(float)percent
{
	if (isGameCenterAvailable == NO)
		return;

	GKAchievement* achievement = [self getAchievementByID:identifier];
	if (achievement != nil &#38;&#38; achievement.percentComplete &#60; percent)
	{
		achievement.percentComplete = percent;
		[achievement reportAchievementWithCompletionHandler:^(NSError* error)
         {
             [self setLastError:error];

             bool success = (error == nil);
             if (success == NO)
             {
                 // Keep achievement to try to submit it later
                 [self cacheAchievement:achievement];
             }

             [delegate onAchievementReported:achievement];
         }];
	}
}

-(void) resetAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	[achievements removeAllObjects];
	[cachedAchievements removeAllObjects];

	[GKAchievement resetAchievementsWithCompletionHandler:^(NSError* error)
     {
         [self setLastError:error];
         bool success = (error == nil);
         [delegate onResetAchievements:success];
     }];
}

-(void) reportCachedAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	if ([cachedAchievements count] == 0)
		return;

	for (GKAchievement* achievement in [cachedAchievements allValues])
	{
		[achievement reportAchievementWithCompletionHandler:^(NSError* error)
         {
             bool success = (error == nil);
             if (success == YES)
             {
                 [self uncacheAchievement:achievement];
             }
         }];
	}
}

-(void) initCachedAchievements
{
	NSString* file = [NSHomeDirectory() stringByAppendingPathComponent:kCachedAchievementsFile];
	id object = [NSKeyedUnarchiver unarchiveObjectWithFile:file];

	if ([object isKindOfClass:[NSMutableDictionary class]])
	{
		NSMutableDictionary* loadedAchievements = (NSMutableDictionary*)object;
		cachedAchievements = [[NSMutableDictionary alloc] initWithDictionary:loadedAchievements];
	}
	else
	{
		cachedAchievements = [[NSMutableDictionary alloc] init];
	}
}

-(void) saveCachedAchievements
{
	NSString* file = [NSHomeDirectory() stringByAppendingPathComponent:kCachedAchievementsFile];
	[NSKeyedArchiver archiveRootObject:cachedAchievements toFile:file];
}

-(void) cacheAchievement:(GKAchievement*)achievement
{
	[cachedAchievements setObject:achievement forKey:achievement.identifier];

	// Save to disk immediately, to keep achievements around even if the game crashes.
	[self saveCachedAchievements];
}

-(void) uncacheAchievement:(GKAchievement*)achievement
{
	[cachedAchievements removeObjectForKey:achievement.identifier];

	// Save to disk immediately, to keep the removed cached achievement from being loaded again
	[self saveCachedAchievements];
}

#pragma mark Matchmaking

-(void) disconnectCurrentMatch
{
	[currentMatch disconnect];
	currentMatch.delegate = nil;
	[currentMatch release];
	currentMatch = nil;
}

-(void) setCurrentMatch:(GKMatch*)match
{
	if ([currentMatch isEqual:match] == NO)
	{
		[self disconnectCurrentMatch];
		currentMatch = [match retain];
		currentMatch.delegate = self;
	}
}

-(void) initMatchInvitationHandler
{
	if (isGameCenterAvailable == NO)
		return;

	[GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite* acceptedInvite, NSArray* playersToInvite)
	{
		[self disconnectCurrentMatch];

		if (acceptedInvite)
		{
			[self showMatchmakerWithInvite:acceptedInvite];
		}
		else if (playersToInvite)
		{
			GKMatchRequest* request = [[[GKMatchRequest alloc] init] autorelease];
			request.minPlayers = 2;
			request.maxPlayers = 4;
			request.playersToInvite = playersToInvite;

			[self showMatchmakerWithRequest:request];
		}
	};
}

-(void) findMatchForRequest:(GKMatchRequest*)request
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] findMatchForRequest:request withCompletionHandler:^(GKMatch* match, NSError* error)
     {
         [self setLastError:error];

         if (match != nil)
         {
             [self setCurrentMatch:match];
             [delegate onMatchFound:match];
         }
     }];
}

-(void) addPlayersToMatch:(GKMatchRequest*)request
{
	if (isGameCenterAvailable == NO)
		return;

	if (currentMatch == nil)
		return;

	[[GKMatchmaker sharedMatchmaker] addPlayersToMatch:currentMatch matchRequest:request completionHandler:^(NSError* error)
     {
         [self setLastError:error];

         bool success = (error == nil);
         [delegate onPlayersAddedToMatch:success];
     }];
}

-(void) cancelMatchmakingRequest
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] cancel];
}

-(void) queryMatchmakingActivity
{
	if (isGameCenterAvailable == NO)
		return;

	[[GKMatchmaker sharedMatchmaker] queryActivityWithCompletionHandler:^(NSInteger activity, NSError* error)
     {
         [self setLastError:error];

         if (error == nil)
         {
             [delegate onReceivedMatchmakingActivity:activity];
         }
     }];
}

#pragma mark Match Connection

-(void) match:(GKMatch*)match player:(NSString*)playerID didChangeState:(GKPlayerConnectionState)state
{
	switch (state)
	{
		case GKPlayerStateConnected:
			[delegate onPlayerConnected:playerID];
			break;
		case GKPlayerStateDisconnected:
			[delegate onPlayerDisconnected:playerID];
			break;
	}

	if (matchStarted == NO &#38;&#38; match.expectedPlayerCount == 0)
	{
		matchStarted = YES;
		[delegate onStartMatch];
	}
}

-(void) sendDataToAllPlayers:(void*)data length:(NSUInteger)length
{
	if (isGameCenterAvailable == NO)
		return;

	NSError* error = nil;
	NSData* packet = [NSData dataWithBytes:data length:length];
	[currentMatch sendDataToAllPlayers:packet withDataMode:GKMatchSendDataUnreliable error:&#38;error];
	[self setLastError:error];
}

-(void) match:(GKMatch*)match didReceiveData:(NSData*)data fromPlayer:(NSString*)playerID
{
	[delegate onReceivedData:data fromPlayer:playerID];
}

#pragma mark Views (Leaderboard, Achievements)

// Helper methods

-(UIViewController*) getRootViewController
{
	return [UIApplication sharedApplication].keyWindow.rootViewController;
}

-(void) presentViewController:(UIViewController*)vc
{
	UIViewController* rootVC = [self getRootViewController];
	[rootVC presentModalViewController:vc animated:YES];
}

-(void) dismissModalViewController
{
	UIViewController* rootVC = [self getRootViewController];
	[rootVC dismissModalViewControllerAnimated:YES];
}

// Leaderboards

-(void) showLeaderboard
{
	if (isGameCenterAvailable == NO)
		return;

	GKLeaderboardViewController* leaderboardVC = [[[GKLeaderboardViewController alloc] init] autorelease];
	if (leaderboardVC != nil)
	{
		leaderboardVC.leaderboardDelegate = self;
		[self presentViewController:leaderboardVC];
	}
}

-(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController*)viewController
{
	[self dismissModalViewController];
	//[delegate onLeaderboardViewDismissed]; //Loads Acheivements after ???
}

// Achievements

-(void) showAchievements
{
	if (isGameCenterAvailable == NO)
		return;

	GKAchievementViewController* achievementsVC = [[[GKAchievementViewController alloc] init] autorelease];
	if (achievementsVC != nil)
	{
		achievementsVC.achievementDelegate = self;
		[self presentViewController:achievementsVC];
	}
}

-(void) achievementViewControllerDidFinish:(GKAchievementViewController*)viewController
{
	[self dismissModalViewController];
	//[delegate onAchievementsViewDismissed];
}

// Matchmaking

-(void) showMatchmakerWithInvite:(GKInvite*)invite
{
	GKMatchmakerViewController* inviteVC = [[[GKMatchmakerViewController alloc] initWithInvite:invite] autorelease];
	if (inviteVC != nil)
	{
		inviteVC.matchmakerDelegate = self;
		[self presentViewController:inviteVC];
	}
}

-(void) showMatchmakerWithRequest:(GKMatchRequest*)request
{
	GKMatchmakerViewController* hostVC = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
	if (hostVC != nil)
	{
		hostVC.matchmakerDelegate = self;
		[self presentViewController:hostVC];
	}
}

-(void) matchmakerViewControllerWasCancelled:(GKMatchmakerViewController*)viewController
{
	[self dismissModalViewController];
	[delegate onMatchmakingViewDismissed];
}

-(void) matchmakerViewController:(GKMatchmakerViewController*)viewController didFailWithError:(NSError*)error
{
	[self dismissModalViewController];
	[self setLastError:error];
	[delegate onMatchmakingViewError];
}

-(void) matchmakerViewController:(GKMatchmakerViewController*)viewController didFindMatch:(GKMatch*)match
{
	[self dismissModalViewController];
	[self setCurrentMatch:match];
	[delegate onMatchFound:match];
}

@end</code></pre></description>
		</item>
		<item>
			<title>wilczarz on "5 Game Center general questions"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28470#post-140133</link>
			<pubDate>Wed, 18 Jan 2012 23:57:25 +0000</pubDate>
			<dc:creator>wilczarz</dc:creator>
			<guid isPermaLink="false">140133@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys, I am starting with GC and I need some advice:<br />
1) I have levels organized in level packs. Is it a good idea to have one leaderboard per pack, or rather one global leaderboard with total score?<br />
2) My "score" will be the number of levels completed. Should I care that many people can have the same score? Can you think of a reasonable formula to respect total game time?<br />
3) Achievements have "points". Are these respected in any way when calculating, um, anything?<br />
4) Player is not always authenticated in GC. When should scores &#38; achievements be submitted? After authentication (all leaderboards/achievments) or on level completition (only current leaderb/ achv) ?<br />
5) I store game progress in a plist. Should I store separate score for every GC user? </p>
<p>Sorry for the long list but I haven't found Apple docs particularly helpful with these questions. Thanks for any help!
</p></description>
		</item>
		<item>
			<title>callispo on "OpenFeint achievements"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23784#post-128550</link>
			<pubDate>Thu, 24 Nov 2011 15:04:02 +0000</pubDate>
			<dc:creator>callispo</dc:creator>
			<guid isPermaLink="false">128550@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello there, I've been trying to integrate OpenFeint Achievements in my game for a while now. The achievements are being unlocked, as shown in user's OpenFeint profile but there is no notification bar showing up. I am posting the code below, please tell me what am I doing wrong.</p>
<p>Initialization Code:<br />
---------------</p>
<pre><code>NSDictionary* settings = [NSDictionary dictionaryWithObjectsAndKeys:
							  [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight],
							  OpenFeintSettingDashboardOrientation,
							  [NSNumber numberWithBool:NO],
							  OpenFeintSettingDisableUserGeneratedContent,
#ifdef DEBUG
							  [NSNumber numberWithInt:OFDevelopmentMode_DEVELOPMENT],
							  OpenFeintSettingDevelopmentMode,
#else
							  [NSNumber numberWithInt:OFDevelopmentMode_RELEASE],
							  OpenFeintSettingDevelopmentMode,
#endif
							  nil];

#ifdef DEBUG
	CCLOG(@&#34;Debug mode set&#34;);
#else
	CCLOG(@&#34;Not-Debug mode&#34;);
#endif

	if ([Globals sharedInstance].ofDelegates == NULL)
	{
		[Globals sharedInstance].ofDelegates = [[CFOFDelegates alloc] init];
		ofNotificationDelegate = [CFOFNotificationDelegate new];

		OFDelegatesContainer* delegates = [OFDelegatesContainer containerWithOpenFeintDelegate:[Globals sharedInstance].ofDelegates];
		delegates.notificationDelegate = ofNotificationDelegate;

		[OpenFeint initializeWithProductKey:@&#34;XXXXX&#34;
								  andSecret:@&#34;XXXXX&#34;
							 andDisplayName:@&#34;XXXXX&#34;
								andSettings:settings // see OpenFeintSettings.h
							   andDelegates:delegates]; // see OFDelegatesContainer.h
	}</code></pre>
<p>Achievement's Unlocking Code:<br />
--------------------------</p>
<p>[[OFAchievement achievement: ACHIEVEMENT_1] unlock];
</p></description>
		</item>
		<item>
			<title>par02 on "Game Center Achievements - Utilize library w/out forcing user to log in?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/22072#post-122678</link>
			<pubDate>Sun, 23 Oct 2011 21:23:31 +0000</pubDate>
			<dc:creator>par02</dc:creator>
			<guid isPermaLink="false">122678@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So, I have integrated Game Center into my game and have both leaderboards and achievements.  </p>
<p>My problem is simple, I am using achievements as gameplay mechanics meaning, when the player gets a certain achievement they unlock another part of the game.</p>
<p>The problem, if the player does NOT want to use Game Center, can I still use Game Center's ability to log into my game on iTunes connect and grab the achievements?  I *am* storing achievements locally in case of no connection but I am wondering if I need to actually build an entire Achievements UI for this possibility?</p>
<p>Thanks!</p>
<p>PAR
</p></description>
		</item>
		<item>
			<title>airic081 on "Game Center Achievements Changing in iTunes Connect Later"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12381#post-69685</link>
			<pubDate>Thu, 06 Jan 2011 03:33:55 +0000</pubDate>
			<dc:creator>airic081</dc:creator>
			<guid isPermaLink="false">69685@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>I was wondering if anyone had experience with submitting an App and changing around the Game Center achievement images or descriptions after accepted or during the waiting for review period. The reason I ask is I don't want to spend time right now making pictures for my achievements I'd rather do that while I'm waiting for my app to be submitted.</p>
<p>Initial Thanks,<br />
Eric
</p></description>
		</item>
		<item>
			<title>thaeez on "How do you guys manage achievements?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20489#post-113932</link>
			<pubDate>Thu, 01 Sep 2011 21:24:16 +0000</pubDate>
			<dc:creator>thaeez</dc:creator>
			<guid isPermaLink="false">113932@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,</p>
<p>I'm working on adding GameCenter/OpenFeint support for my game and currently have OpenFeint working well with custom notifications. Now, I want to create a few achievements but I can't wrap my head around what the best way of tracking events in the game might be, and before I jump in and do a lot of coding, I'd like to ask for some opinions...</p>
<p>If I have an achievement that gets unlocked when someone kills 500 baddies, it seems like I'll need some sort 'achievement manager' class that can be called every time a baddie gets killed to keep a running kill count - once it reaches 500, it will post the achievement. Simple enough, or so I thought, but it appears the devil is in the details. I think this means that in addition to maintaining a list of achievements on GC and OF, I'll need to keep a local copy around as well. Does anyone have a workaround for this? Also, how do you guys save achievement progress, unlocked items, etc. in a somewhat secure manner as to prevent someone on a jailbroken device from simply changing keys in your plist/xml/sql? I know there is no REALLY secure solution, but I would like to prevent non-techies from making simple changes to unlock stuff.</p>
<p>Is this how you guys are keeping track of achievement progress, or is there a better way that I'm just not seeing?</p>
<p>Thanks in advance.</p>
<p>Mike
</p></description>
		</item>
		<item>
			<title>Daniel López on "Achievements repeating and repeating and repeating..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18806#post-105511</link>
			<pubDate>Sun, 17 Jul 2011 23:50:17 +0000</pubDate>
			<dc:creator>Daniel López</dc:creator>
			<guid isPermaLink="false">105511@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am doing game center integration for achievements, and I'd like to ask... Using a sandbox account will ALWAYS report again and again the achievements, even if they are already completed?</p>
<p>For example, I have and achievement that when I begin the first level, it reports an achievement "The adventure begin". But every time I play the first level, the banner always appear! And I want to know, if it's my fault doing something wrong, or it happens because it's and "Sandbox" account.</p>
<p>Regards!
</p></description>
		</item>
		<item>
			<title>kickflip720 on "Useful Game Center resources"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16712#post-94129</link>
			<pubDate>Wed, 18 May 2011 18:48:43 +0000</pubDate>
			<dc:creator>kickflip720</dc:creator>
			<guid isPermaLink="false">94129@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>While integrating Game Center into my game I found a couple of useful resources that I thought I'd share with the community.</p>
<p>Anton Nikan's Game Center Cache: <a href="https://github.com/anton-nikan/iOS-Game-Center-Cache">https://github.com/anton-nikan/iOS-Game-Center-Cache</a><br />
Excellent scoring/achievement solution that works offline and online with multiple user profiles.</p>
<p>Typeoneerror's Game Center Achievement Notification: <a href="http://www.typeoneerror.com/articles/post/game-center-achievement-notification">http://www.typeoneerror.com/articles/post/game-center-achievement-notification</a><br />
Adds a slide down window similar to the initial game center notification</p>
<p>Many thanks to both for sharing the source. It made integration very simple, but oh so much testing ...
</p></description>
		</item>
		<item>
			<title>toadkick on "Game Center/Achievements and memory fragmentation"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15994#post-90179</link>
			<pubDate>Wed, 27 Apr 2011 01:39:27 +0000</pubDate>
			<dc:creator>toadkick</dc:creator>
			<guid isPermaLink="false">90179@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>We have finally finished adding achievements to Cow Trouble and are having memory issues. I've plugged all of our memory leaks, but after continuous play we still get memory warnings of increasing severity, until eventually after about an hour the game crashes.</p>
<p>At this point I am almost positive that the culprit is memory fragmentation, and I'm pretty sure that it's the achievements that are causing it. I think that because they are unlocked during game play (when all of the textures and game data are loaded) and persist across level loads/unloads until the app terminates, it's likely that they are being allocated into an area of memory that eventually blocks larger objects (such as large textures) from successfully being allocated.</p>
<p>Has anyone else run into issues like this with Objective-C/iOS? In the past when I've had fragmentation issues a good solution has been to implement a small block allocator so that small allocations such as achievements/strings/whatever are placed into a different pool of memory. In this case however I'm not sure how to do this considering that the achievements use NSStrings, and as AFAIK it's not possible to make Apple's library code use custom allocators.</p>
<p>I hope I'm wrong and the issue is not fragmentation, but at this point I'm almost positive it is, and if it's not them I'm really stumped, because I'm positive I've taken care of all of the leaks. I've been banging my head against this for several days now and I am at a loss as to how to fix the issue :(  Any helpful advice would be greatly appreciated.
</p></description>
		</item>
		<item>
			<title>irvaz on "Help structuring and organising my game"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15161#post-86052</link>
			<pubDate>Fri, 01 Apr 2011 20:27:34 +0000</pubDate>
			<dc:creator>irvaz</dc:creator>
			<guid isPermaLink="false">86052@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi I am looking for some advice and guidance about how to structure my first game. I have been following Ray Wenderlichs simple iphone game tutorial and am using this as a base.</p>
<p>I am deciding how to structure the game in the sense of what happens when you leave the game and come back to it and also what happens when you complete it for the first time.</p>
<p>so for example when you first start the game would there just be a main menu with a new game button. If they reach level 4 and leave the game what would show on the main menu when they return, new game and a continue?  what about the end of the game, once the user completes the game would it give them an option to return to main menu? would main menu still show new game and continue? </p>
<p>I would also like to use open faint for some in game achievements, so once the game is completed and if they returned to main menu and selected new game would the achievements be saved?</p>
<p>I understand I am the only person that can decide all of this but would love some insight into what you guys think and just some general opinions and help with how all of this works.</p>
<p>Thank you.
</p></description>
		</item>
		<item>
			<title>RelicaGames on "[Game] Hydron Flux - Space Shooter with Level Editor!!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/11971#post-67530</link>
			<pubDate>Sat, 18 Dec 2010 15:02:34 +0000</pubDate>
			<dc:creator>RelicaGames</dc:creator>
			<guid isPermaLink="false">67530@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi everyone, I'd like to announce my recently released game, Hydron Flux! It's a top down space shooter, with 30 main levels, 3 defense levels (different gameplay) and an inbuilt level editor! So for the main part of this game, you take control of a new fighter class ship, and for each mission, you have to destroy all the enemies. This can be done in any order you like, as you can go where you want to within the game world!</p>
<p>The game also includes 3 defense levels, which have you defending your planet for as long as possible! This goes on until the planet is destroyed, and so you can keep trying to beat your score!</p>
<p>It is integrated with Open Feint for high scores and achievements, as well as having local achievements for offline viewing! It also includes PlayHaven!</p>
<p>So to summarize the features:</p>
<ul>
<li>30 Main Missions to fight your way through.</li>
<li>8 Different enemies, and 4 Boss enemies to overcome.</li>
<li>Many different upgrades, from Torpedo's, to Shockwave Generators and the mighty Vortex Manipulator!</li>
<li>Defense Mode! Set after the events of the game, you must defend your planet, and stop the enemy acquiring planetary shielding technology!</li>
<li>Unlimited waves in Defense Mode, so see how long you can last!</li>
<li>Online leaderboards using Open Feint.</li>
<li>Stats Page, for viewing statistics such as hit rate, and enemies killed etc.</li>
<li>Achievements, both online and offline.</li>
<li>Built in Level Editor for creating your own levels, with control over many different settings. (no sharing yet!)</li>
<li>Integrated with PlayHaven.</li>
</ul>
<p>The method of control is tilt, although I plan on adding a stick to control the ship in a future update, as some people don't find the tilt controls too easy. I think this is the main problem at the moment, as it takes too long to master these controls, so people are maybe giving up too soon!</p>
<p>However I think the game is a lot of fun, and has a lot of replay potential! In fact I actually like just flying the ship around so much that I'm considering creating a new mini game mode, where you have to navigate around an obstacle course!</p>
<p>Here are some great screenshots of the game:<br />
<img src="http://www.relicagames.co.uk/HFGalleryFull/IMG_0105.jpg" alt="Shockwave" /><br />
<img src="http://www.relicagames.co.uk/HFGalleryFull/IMG_0099.jpg" alt="Level Editor" /><br />
<img src="http://www.relicagames.co.uk/HFGalleryFull/IMG_0102.jpg" alt="Upgrade Screen" /></p>
<p>More information and screenshots can be found on the games website here:<br />
<a href="http://www.relicagames.co.uk/HydronFlux.html">Hydron Flux Website</a></p>
<p>Here's a video of the game:<br />
<a href="http://www.youtube.com/watch?v=199PJxN_U0g" rel="nofollow">http://www.youtube.com/watch?v=199PJxN_U0g</a></p>
<p>You can download Hydron Flux from iTunes here:<br />
<a href="http://itunes.apple.com/gb/app/hydron-flux/id406641629?mt=8" rel="nofollow">http://itunes.apple.com/gb/app/hydron-flux/id406641629?mt=8</a></p>
<p>I really appreciate all of the help I got from other cocos2d users here.<br />
Here are some PROMO CODES for Hydron Flux.<br />
Please write an honest review on the app store and report directly back here about any bugs.<br />
AAPX3TM6LMHA<br />
WLLPY4TRAJ4X<br />
J6E6XREFHXRT<br />
MWWA4ARFKX7M
</p></description>
		</item>
		<item>
			<title>arcticfire on "achievements help!!!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/11544#post-65257</link>
			<pubDate>Wed, 01 Dec 2010 01:07:47 +0000</pubDate>
			<dc:creator>arcticfire</dc:creator>
			<guid isPermaLink="false">65257@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I am useing GameCenter achievements, and i want to give the user progress on the achievements.<br />
But i dont know how to do it...<br />
i had this but it doesnt work right:<br />
<pre><code>fpercentComplete = currentScore / 1000;
	[self.gameCenterManager submitAchievementWith:kGCAGot1KPoints floatPercentComplete:fpercentComplete];
	fpercentComplete = currentScore / 500000;
	[self.gameCenterManager submitAchievementWith:kGCAHalfWayToImpossible floatPercentComplete:fpercentComplete];
	fpercentComplete = currentScore / 1000000;
	[self.gameCenterManager submitAchievementWith:kGCAToTheImpossible floatPercentComplete:fpercentComplete];</code></pre>
<p>Those don't seem to work right. Like the first one, i get to 4000 points, but it doesnt seem to work, as it gives me 14 percent complete... and not 100 percent....</p>
<p>help?!?!
</p></description>
		</item>
		<item>
			<title>piotrwat on "[GAME] PROMO CODES!!! Zombies Ate My Baby  -50%!!!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/9134#post-52777</link>
			<pubDate>Sun, 29 Aug 2010 18:58:04 +0000</pubDate>
			<dc:creator>piotrwat</dc:creator>
			<guid isPermaLink="false">52777@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Zombies Ate My Baby </p>
<p>-50%!!! Zombies Ate My Baby is now on sale for only $0.99/0.79€/0.59£ !!!</p>
<p>You better prepare yourself for the great amount of fun! Defend yourself from the hordes of zombies in the greatest action game on your iphone/ipod. Enjoy the high quality comics who will lead you through the entire game. Be the best in survival mode!</p>
<p>Features:</p>
<p>- meet Cheyenne and find out what problems foes she have with her boyfriends. </p>
<p>- take part in the coolest adventure you've seen on your iphone/ipod </p>
<p>- unlock the achievements in the well developped campaign mode. </p>
<p>- compare your score with friends in the on-line rankings of the exciting survival mode </p>
<p>- enjoy the prices composed of some awesome wallpapers for your iphone/ipod </p>
<p>The game supports OpenFeint (Online Achievements and Leaderboards)</p>
<p>PROMO CODES:</p>
<p>RNMATX46JW79<br />
NP7TXNK4T9LE<br />
WRFFFPW4YJAH</p>
<p><img src="http://www.eccgames.com/zamb/img/zamb2.png" alt="Zombies Ate My Baby" /><br />
<img src="http://www.eccgames.com/zamb/img/zamb3.png" alt="Zombies Ate My Baby" />
</p></description>
		</item>
		<item>
			<title>RelicaGames on "[Game] Elemental Defense - New Castle Defense Game"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/7136#post-41908</link>
			<pubDate>Wed, 16 Jun 2010 14:22:03 +0000</pubDate>
			<dc:creator>RelicaGames</dc:creator>
			<guid isPermaLink="false">41908@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey Everyone!</p>
<p>Just wanted to let you all know that I've released my first game into the app store. So here are the details:</p>
<p>It is called 'Elemental Defense' and is a castle defense game, where you must use every element at your disposal to stop an oncoming wave of enemies.</p>
<p>You can use the basic elements provided, or combine them together in a range of different ways to create more powerful and deadly attacks.</p>
<p>Features:<br />
-A single level with unlimited rounds, so see how far you can get.<br />
-5 different elements to use or combine.<br />
-4 different super attacks.<br />
-5 different types of enemies, including fire, water, earth and air.<br />
-Unlimited upgrades can be bought for each element.<br />
-Online leaderboards using Open Feint.<br />
-Local scoreboard for offline viewing.<br />
-Achievements, both online and offline.<br />
-Use super attacks to change the state of the ground, for example creating a flood, bringing new enemies with new strengths and weaknesses.</p>
<p>You will need to master the elements, and learn the strengths and weaknesses of each enemy if you have any hope of surviving the countless waves.</p>
<p>You can visit the website for more information and screenshots here:<br />
<a href="http://www.relicagames.co.uk/">Relica Games</a></p>
<p>There is a video here:<br />
<a href="http://www.youtube.com/watch?v=0ozMIqKwrbU" rel="nofollow">http://www.youtube.com/watch?v=0ozMIqKwrbU</a></p>
<p><a href="http://itunes.apple.com/gb/app/elemental-defense/id376714251?mt=8">Click here for a link to the Itunes Store!! ($0.99)</a></p>
<p>I hope you enjoy it if you try it out! I've already had two 5 star reviews (much to my own surprise!) in the US store, and even had an email from someone to tell me that he finds the game enjoyable.</p>
<p>Also there is also a thread over at touch arcade here:<br />
<a href="http://forums.toucharcade.com/showthread.php?t=57947">Link to Touch Arcade</a><br />
What I want to do with the game is to add several new special abilities, which can be selected from a menu within the game, and I want those abilities to be ones that users such as yourself have suggested, so feel free to give any ideas you might have for future spells or improvements!</p>
<p>I found cocos2D to be very helpful for creating the game, and just so you know, I have included the cocos2D logo in the credits screen! So thanks for doing an amazing job with Cocos2D Riq!! It has to be one of the easiest ways to create a game, I would have certainly struggled without it! lol</p>
<p>Here are some screenshots for you:<br />
<img src="http://www.relicagames.co.uk/GalleryFull/IMG_0093.PNG" alt="Menu" /><br />
<img src="http://www.relicagames.co.uk/GalleryFull/IMG_0102.PNG" alt="InGame" /><br />
<img src="http://www.relicagames.co.uk/GalleryFull/IMG_0100.PNG" alt="InGame2" /></p>
<p>I'm hoping you'll find it interesting and different as it uses a unique elemental combination system to attack the enemies, rather than the standard flicking the enemies of the screen. So here you actually have to think about what spell to use for each enemy, and then aim where you want it to go. It actually gets quite hard on the later levels, so I'll be interested to see if anyone can get to a high level!
</p></description>
		</item>
		<item>
			<title>manicaesar on "[Game] Empires At War - loose mix of Age of War and Age of Empires"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4683#post-27886</link>
			<pubDate>Wed, 24 Feb 2010 20:48:38 +0000</pubDate>
			<dc:creator>manicaesar</dc:creator>
			<guid isPermaLink="false">27886@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello everyone<br />
   I represent group of students from Poland. On our studies we had to do complex project for one of the course - so we decided to do an iPhone game :) With the help of Cocos2d engine we managed to do this and we are very satisfied with the result:)</p>
<p>Here is an overview of the game:</p>
<p>Empires At War is variation of 'Age of War' game with several concepts added from 'Age of Empires' (multiple nations, upgrades).<br />
Main game features are:<br />
* 4 unique nations, each with different strongholds and tactics available<br />
* 33 offensive units, each with unique animations<br />
* 8 deadly defensive units, from simple Stone Defenders to ground-shaking Catapults<br />
* over 50 upgrades which can make your army invincible<br />
* 5 ages of technological evolution<br />
* quick but comprehensive tutorial which will smoothly guide you through the ancient world<br />
* 3 predefined difficulty levels along with the possibility of creating custom difficulty levels<br />
* Multiplayer over Bluetooth</p>
<p><img src="http://www.gulimaro.com/img/Screen1.png" /></p>
<p>Did you like very popular flash game 'Age of War'? Have you played its iPhone version: 'The Wars' and are not fully satisfied? I bet you will love Empires At War.</p>
<p><a href="http://itunes.apple.com/us/app/empires-at-war/id357363186?mt=8">iTunes Link</a></p>
<p>We have prepared some promo codes for you:<br />
YPAJR9X97WRK<br />
FKTM3K76AP6H<br />
WKPNT4LP9FJY<br />
MFWRKLX9RE3E<br />
33R6PKRJAKLY</p>
<p>If you take one, please post and be so kind to write a review :)</p>
<p>DEVELOPER INFORMATION:<br />
Empires At War was developed using 0.8.2 version of Cocos2d framework. It mainly uses AtlasSprites and AtlasSpriteManagers, along with multiple Actions. It also uses Menus, MenuItems, MenuItemFonts, Labels. For sounds, it uses CocosDenshion.</p>
<p><strong>We would like to thank Ricardo Quesada for the framework! It is JUST ASTONISHING!!</strong> We can not imagine finishing our game on time without Cocos:) We are going to take a party which will be 'fully cocos' - cocos-flavoured chocolate, cocos-flavoured cookies, Malibu :D If you are visiting Poznań (Poland) in the nearest time, please let us know and join us partying;) </p>
<p>Best Regards,<br />
--<br />
GuLiMaRo Team
</p></description>
		</item>
		<item>
			<title>pfg2009 on "[Game] PopFizz! - Now Available for Free"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/4284#post-25626</link>
			<pubDate>Fri, 05 Feb 2010 20:51:47 +0000</pubDate>
			<dc:creator>pfg2009</dc:creator>
			<guid isPermaLink="false">25626@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm very happy to announce the availability of my first Cocos2D title - <a href='http://itunes.apple.com/us/app/pop-fizz/id343237353?mt=8'>Pop Fizz</a>!</p>
<p>The game itself is an action-packed arcade adventure spreading across three world, supporting three different game play modes each.  Match corresponding images and explore a myriad of bonuses as you race against time and strive to collect close to thirty unique achievements.   Compare your scores to those from around the world through global leaderboards and seamless Twitter integration.</p>
<p>I've spend about two months working on this title and I'm happy with how it turned out.  I hope you enjoy it as well and if you have any comments or thoughts I would love to hear from you!</p>
<p>On a different note, I must say that I was very impressed with the cleanliness and extensibility of the Cocos2D framework.  Well done and thank you to everyone for contributing to it.</p>
<p>Here are some screen shots:</p>
<p><img src='http://www.gamecollage.com/images/PopFizz/Title.png' /><br />
<img src='http://www.gamecollage.com/images/PopFizz/Smile.png' /><br />
<img src='http://www.gamecollage.com/images/PopFizz/Airplanes.png' /><br />
<img src='http://www.gamecollage.com/images/PopFizz/Hearts.png' /><br />
<img src='http://www.gamecollage.com/images/PopFizz/SmileDark.png' /><br />
<img src='http://www.gamecollage.com/images/PopFizz/Achievements.png' />
</p></description>
		</item>

	</channel>
</rss>

