守望者--AIR技术交流

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
热搜: ANE FlasCC 炼金术
查看: 1142|回复: 1

苹果移动游戏中心ANE

[复制链接]
  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    51756
    钢镚
    1422

    开源英雄守望者

    发表于 2015-1-22 09:55:16 | 显示全部楼层 |阅读模式
    应用下载
    应用名称: ANE-Game-Center
    支持64位:
    当前版本: 未知
    运行平台: IOS 
    开发语言: ActionScript 3 其他 
    应用类别: ANE-C/C++
    应用简介: Air native extension for integration with Apple's game center
    http://www.sticksports.com/mobile/
    Air Native Extension for Game Center integration on iOS

    This is an Air native extension for Game Center integration on the iOS platform.

    Version

    This is version 0.7.0 of this extension.

    Binary files

    The bin folder contains the compiled extension and the default swc, which can be used for local testing if required by your development environment (Flash Builder shouldn’t need it, but other IDEs may).

    Building

    Requirements – Adobe Air SDK 3.1 or later, XCode IDE, iOS SDK 5.0 or later

    • Add the FlashRuntimeExtensions.h file from the Adobe Air sdk to the ios/GameCenterIosExtension folder in the project.
    • Create a copy of the build/example.build.config file in the build folder, calling it build.config and change the properties in this file to match your system.
      • A certificate is required by the build script. This may be a self-signed certificate created by Adobe Air.
    • Run the ant build script build.xml. This creates the native extension, and default swc file, inside the bin folder.
    The test project

    A simple test project is included for testing the extension. To build this air project

    • Create a copy of the test/build/example.build.config file in the test/build folder, calling it build.config and change the properties in this file to match your system.
    • Create a test app in iTunesConnect and add Game Center to the app.
      • Add a leaderboard to the project with the id “HighScore”.
      • Add an achievement to the project with the id “started”.
    • Create a copy of the test/build/example.GameCenterExtensionTest-app.xml file in the test/build folder, calling it GameCenterExtensionTest-app.xml and change the id in this file to match the test app you just created.
    • Run the ant build script test/build.xml. This creates the test ipa inside the test/bin folder.
    Using the extensionTest if Game Center is supported

    GameCenter.isSupported;

    Is a boolean.

    Authenticate the local player

    If Game Center is supported, you should authenticate the local player before doing anything else.

    GameCenter.authenticateLocalPlayer();

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.localPlayerAuthenticated
    • GameCenter.localPlayerNotAuthenticated

    Throws an error if Game Center is not supported

    GameCenter.isAuthenticated;

    is a boolean.

    Get the local player

    GameCenter.localPlayer;

    Is an object of type GCLocalPlayer.

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Get the local player’s score

    GameCenter.getLocalPlayerScore( "leaderboard" );

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.localPlayerScoreLoadComplete with parameter of type GCLeaderboard
    • GameCenter.localPlayerScoreLoadFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Report a score

    GameCenter.reportScore( leaderboard, score );

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.localPlayerScoreReported
    • GameCenter.localPlayerScoreReportFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Report an achievement

    GameCenter.reportAchievement( achievement, value );

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.localPlayerAchievementReported
    • GameCenter.localPlayerAchievementReportFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Show a leaderboard

    GameCenter.showStandardLeaderboard( leaderboard (optional), timeScope (optional) );

    Shows Apple’s standard leaderboard view.

    When the view is closed, dispatches the signal

    • GameCenter.gameCenterViewRemoved

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Get a leaderboard

    GameCenter.getLeaderboard( "leaderboard" );

    Returns the leaderboard as an Actionscript object for custom rendering within your game.

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.leaderboardLoadComplete with parameter of type GCLeaderboard
    • GameCenter.leaderboardScoreLoadFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Show the achievements

    GameCenter.showAchievements();

    Shows Apple’s standard achievements view.

    When the view is closed, dispatches the signal

    • GameCenter.gameCenterViewRemoved

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Get player achievements

    GameCenter.getAchievements();

    Returns the local player’s achievements.

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.achievementsLoadComplete with parameter of type Vector.
    • GameCenter.achievementsLoadFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Get the local player’s friends

    GameCenter.getLocalPlayerFriends();

    Is asynchronous.

    Dispatches one of two signals

    • GameCenter.localPlayerFriendsLoadComplete with a parameter of type Array containing objects of type GCPlayer
    • GameCenter.localPlayerFriendsLoadFailed

    Throws an error if Game Center is not supported or the local player has not been authenticated.

    Example code

    You can see all the features in action in the source code of the test project.

    Compiling your project

    The extension requires that your project is built against version 5 of the iOS SDK. It doesn’t require version 5 at run-time (version 4 is sufficient, isSuported will be false for versions before 4.2), but it is required at compile-time. Due to this limitation, any project using the extension must be compiled on a computer running Mac OS X and with version 5 or later of the iOS SDK. Specify the path to the SDK when compiling the project, using the functionality built in to your IDE or the platformsdk parameter if building with adt from the command line or a build script. And use Adobe Air SDK 3.1 or later

    DevelopersGames using this extensionLicense

    Author: Richard Lord
    Owner: Stick Sports Ltd.
    http://www.sticksports.com

    Copyright © 2011-2012, Stick Sports Ltd.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of Stick Sports Ltd. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.





    相关链接:


    https://github.com/freshplanet/ANE-Game-Center


    https://github.com/StickSports/ANE-Game-Center




    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    守望者AIR技术交流社区(www.airmyth.com)
    回复

    使用道具 举报

  • TA的每日心情
    擦汗
    2018-4-10 15:18
  • 签到天数: 447 天

    [LV.9]以坛为家II

    1742

    主题

    2094

    帖子

    13万

    积分

    超级版主

    Rank: 18Rank: 18Rank: 18Rank: 18Rank: 18

    威望
    562
    贡献
    29
    金币
    51756
    钢镚
    1422

    开源英雄守望者

     楼主| 发表于 2015-2-20 21:16:29 | 显示全部楼层
    守望者AIR技术交流社区(www.airmyth.com)
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    
    关闭

    站长推荐上一条 /4 下一条

    QQ|手机版|Archiver|网站地图|小黑屋|守望者 ( 京ICP备14061876号

    GMT+8, 2019-10-23 01:17 , Processed in 0.072814 second(s), 37 queries .

    守望者AIR

    守望者AIR技术交流社区

    本站成立于 2014年12月31日

    快速回复 返回顶部 返回列表