Book Image

Game Development with Swift

By : Stephen Haney
Book Image

Game Development with Swift

By: Stephen Haney

Overview of this book

Table of Contents (18 chapters)
Game Development with Swift
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding an achievement


Achievements add a second layer of fun to your game and create replay value. To demonstrate a Game Center achievement, we will add a reward for collecting 500 coins without dying.

Creating a new achievement in iTunes Connect

Just like the leaderboard, we first need to create an iTunes Connect record for our achievement. Follow these steps to create the record:

  1. Log into iTunes Connect and navigate to the Game Center page for your app.

  2. Underneath the leaderboards list, locate and click the Add Achievement button.

  3. Fill out the information for your achievement. Here are my values:

    Let’s take a look at each field:

    • Reference Name is the name iTunes Connect will use internally to refer to the achievement

    • Achievement ID is the unique identifier we will use to reference this achievement in our code

    • You can assign a Point Value to each achievement so players can earn more achievement points as they collect new achievements

    • Hidden and Achievable More Than Once are self-explanatory, but...