Add an Achievement

Similar to leaderboards, achievements give your players an incentive to play your game. Unlike leaderboards, though, achievements mark when players reach certain milestones within your game; for example, with Hog Dice, you’ll create a “First Win” achievement that players can earn the first time they win a game.

When you’re designing achievements for your own games, you need to decide what milestones to include. You also need to decide if these milestones (achievements) are hidden from the player and if players can achieve them more than once. Planning out your game’s achievements is important because you’re only allowed up to 100 achievements for each app.

To add a new achievement, click the + button immediately to the right of the text that reads Achievements (0). Like leaderboards, you’re presented with several options.

Set up the “First Win” achievement, like so:

images/AddingLeaderboardsAndAchievements/achievement-setup.png

You’ll need to modify the Achievement ID to match your Bundle ID, for example, {your bundle id}.first.win.

Again, like leaderboards, you need to set up the localization options. Click the Add Language button and set up the language options, like so:

images/AddingLeaderboardsAndAchievements/add-language-achievement.png

For the image, select the first_win.png file from the resources folder.

Once you have everything set up, click Save and you’ll end up with something like this:

images/AddingLeaderboardsAndAchievements/add-language-achievement-saved.png

Click the Save button on the achievement setup screen to save the achievement and all of its options.

Perfect, you’re done in the portal, and you’re ready to return to Xcode to write the necessary code that interfaces with your new leaderboard and achievement.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.241.51