Game Development Reference
In-Depth Information
Figure 14-6 . The Game Kit achievements view
So, what else can you do with achievements?
Obviously, you want to determine whether an achievement has been unlocked, and ac-
tually you want to report all the progress a player makes toward completing an
achievement. For example, if the achievement's goal is to eat 476 bananas, then you'd
report the progress to Game Center every time the player eats a banana. In this example
project, you're simply checking for time elapsed, and then you report progress on the
PlayedForTenSecs achievement. You do that in the TileMapLayer 's update
method, shown in Listing 14-14 .
Listing 14-14 . Determining Achievement Progress
-(void) update:(ccTime)delta
{
totalTime + = delta;
if (totalTime > 1.0f)
 
 
 
Search Nedrilad ::




Custom Search