Adobe Director 12 extends support for Apple Game Center unfolding social-gaming possibilities, on iOS devices, for games created using Director 12. 

Director 12 allows you to enable Leaderboards and Achievements for games, by introducing the following new methods.

authenticateLocalPlayer()

Allows you to authenticate the player with the Game Center server.

Usage

gameCenterObj = new Xtra("GameCenter")
gameCenterObj.authenticateLocalPlayer()

showBanner(title,message)

Allows you to display a notification to the user with the title and message strings.

showLeaderboard(categoryID)

Allows you to display the Leaderboard for any specified category. This method takes categoryID as input.

Usage

Properties

showLeaderboard(categoryId)
  • CategoryID String that uniquely identifies the category of the Leaderboard.

getLeaderboardsInfo(handlerSymbol)

Retrieve and load information about the leaderboard defined for the game. This method takes handlerSymbol as input, which is called with the result list. This method is an asynchronous function call.

On handleLeaderboardInfo resultList
-- process result list
End
gameCenterObj.getLeaderboardsInfo(#handleLeaderboardInfo)

The result list contains list of categories and corresponding title information.

reportScore(categoryId,Score)

Reports score to the Apple Game Center for a specified Leaderboard.

Usage

gameCenterObj.reportScore("1",2048)

Properties

  • CategoryID String that uniquely identifies the category of the Leaderboard.
  • Score An integer that specifies the score that is submitted to the Apple Game Center.

retrieveScore(categoryID,startRange,endRange,scoreHandler)

Retrieves score data from Apple Game Center for the specified Leaderboard and score range.

Usage

On processScores scoreList
//processScore
end
gameCenterObj.retrieveScore("1",1,10,#processScores)

Properties

  • CategoryID String that uniquely identifies the category of the Leaderboard.
  • startRange Integer that indicates the starting range of the score data.
  • endRange Integer that indicates the ending range of the score data.
  • scoreHandler Symbol that is called with the result list.

showAchievements()

Displays the Achievements interface.

Usage

gameCenterObj.showAchievements()

showAchievements(achievementsId)

Displays achievements for a specified Achievement ID.

Usage

gameCenterObj.showAchievements()
gameCenterObj.showAchievements("1")

Properties

  • AchievementID String that uniquely identifies an achievement.

loadAllAchievements(handlerSymbol)

Retrieves all achievements defined for the game.

Usage

On HandleAchievementData resultList
-- process result list
end

gameCenterObj.loadAllAchievements(#HandleAchievementData)

Properties

  • Identifier String that uniquely identifies an achievement.
  • Title String that reads the localized name or title of an achievement.
  • isHidden Boolean value that specifies if the achievement is hidden.
  • MaximumPoints Number that indicates the maximum points specified for an achievement.

loadPlayerAchievements(handlerSymbol)

Retrieves all achievements of a user.

Usage

On HandleAchievementData resultList
-- process result list
end

gameCenterObj.loadPlayerAchievements(#HandleAchievementData)

Properties

  • Identifier String that uniquely identifies an achievement.
  • isCompleted Boolean value that indicates if an achievement if complete.
  • isHidden Boolean value that specifies if the achievement is hidden.
  • percentageComplete Number that indicates the percentage of completion for an achievement.
  • showCompletionBanner Boolean value that allows you to show completion banner on finishing an achievement.

reportAchievement(categoryId, achievementPercentage)

Reports percentage of completion of an achievement to the Apple Game Center.

Usage

gameCenterObj.reportAchievement("1",20)

Properties

  • CategoryID String that uniquely identifies the category of the Leaderboard.
  • AchievementPercentage Number that indicates the percentage of completion for an achievement.

getLocalPlayerInfo()

Retrieves details about the local player. The method returns a property list containing DisplayName, PlayerID, and UnderAge.

Usage

plist = gameCenterObj.getLocalPlayerInfo()

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy