Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Any simple example of using game circle? - Gideros Forum

Any simple example of using game circle?

zoolaxzoolax Member
edited April 2014 in Plugins
Hi,I have been looking into the game circle,for cross platform?
Dose anybody know a simple example of how to use the gideros gamecircle plug ins.
Or knows any reference?
Thanks
www.zoolax.com

Comments

  • ar2rsawseenar2rsawseen Maintainer
    So as you probably know, gamecircle is a part of Gaming Interface (http://giderosmobile.com/labs/gaming)

    And usage is quite simple:
    require "gaming"
    game = Gaming.new("gamecircle") -- or googleplay or gamekit
    game:addEventListener(Event.STATE_LOADED, function(e)
        --load saved data from cloud here
        if e.data ~= "" then
            print(e.data)
        end
    end)
    game:addEventListener(Event.STATE_CONFLICT, function(e)
        --resolve data conflicts here
    	--for example always taking server data
        game:resolveState(e.key, e.version, e.serverData)
    end)
    game:addEventListener(Event.LOGIN_COMPLETE, function()
    	game.isLoaded = true
    	--you can request data from server here
    	game:loadState(1)
    end)
    --authenticate
    game:login()
     
     
    --you create some global functions to post scores and achievements
    function postScore(score)
    	if game and game.isLoaded then
    		game:reportScore("leaderboard1", score)
    	end
    end
     
    function unlockAchievement(achievementId)
    	if game and game.isLoaded then
    		gamereportAchievement(achievementId, 100)
    	end
    end
     
    function showAchievements()
    	if game and game.isLoaded then
    		game:showAchievements()
    	end
    end
     
    function showLeaderboard()
    	if game and game.isLoaded then
    		game:showLeaderboard("leaderboard1")
    	end
    end

    Likes: hgvyas123

    +1 -1 (+1 / -0 ) Share on Facebook
  • Has ios gaming been updated to include gamecircle/play services?
  • ar2rsawseenar2rsawseen Maintainer
    edited April 2014
    unfortunately not yet, maybe this weekend :)
  • That is awesome,by any chance ,any news on gamecircle support for iOS?
    Thanks
    www.zoolax.com
  • ar2rsawseenar2rsawseen Maintainer
    I started modifying it, by adding methods to manipulate notifications pop ups and its positions, retrieving information about player and its scores, standartizing achievements values from 0 to 100 for all frameworks and also adding the other ios frameworks,
    But not finished yet, but probably will be this week ;)
    +1 -1 (+2 / -0 ) Share on Facebook
  • @ar2rsawseen
    no rush,take your time,as long as it is coming along I am happy:)
    and Thank you very much:)
    www.zoolax.com
Sign In or Register to comment.