Gaming

From GiderosMobile
Revision as of 08:22, 8 January 2021 by Hgy29 (talk | contribs) (→‎Methods)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


Supported platforms: Platform android.pngPlatform ios.png
Available since: Gideros 2012.09

Description


The Gaming class is defined in the module "gaming". Therefore, you need to call
require("gaming") before using it. Loading the Gaming module
also creates a global class Gaming.

Currently supports:

  • Gaming.new("googleplay") -- Android
  • Gaming.new("gamekit") -- iOS

Methods

Gaming.new instanciate the Gaming plugin
Gaming:autoMatch
Gaming:deleteState remove the specified save/state
Gaming:getAllPlayers
Gaming:getPlayerId Get the id of current player
Gaming:getPlayerInfo
Gaming:getPlayerName Get the name of current player
Gaming:getPlayerPicture Get the profile picture of current player
Gaming:getPlayerScore Get the score of current player
Gaming:incrementAchievement Increment the progress toward an achievement
Gaming:invitePlayers
Gaming:isLoggedIn Returns the login state in Gaming service
Gaming:joinRoom
Gaming:loadAchievements Load all achievements
Gaming:loadPlayerCenteredScores Load a leaderboard cenetered on the player
Gaming:loadScores Load a leaderboard
Gaming:loadState Load a save/state
Gaming:login Log in the Gaming service
Gaming:logout Log out of the gaming service
Gaming:reportAchievement Report an achievement progress
Gaming:reportScore Report a new score
Gaming:resolveState Resolve a save/state conflict
Gaming:revealAchievement Reveal an achievement
Gaming:sendTo
Gaming:sendToAll
Gaming:showAchievements Show the achievements
Gaming:showInvitations
Gaming:showLeaderboard Show a leaderboard
Gaming:showWaitingRoom Display the waiting room
Gaming:updateState Updates a save/state

Events

Event.CONNECTED_TO_ROOM
Event.DATA_RECEIVED
Event.DISCONNECTED_FROM_ROOM
Event.GAME_STARTED
Event.INVITATION_RECEIVED
Event.JOINED_ROOM
Event.LEFT_ROOM
Event.LOAD_ACHIEVEMENTS_COMPLETE
Event.LOAD_ACHIEVEMENTS_ERROR
Event.LOAD_SCORES_COMPLETE
Event.LOAD_SCORES_ERROR
Event.LOGIN_COMPLETE
Event.LOGIN_ERROR
Event.PEER_CONNECTED
Event.PEER_DECLINED
Event.PEER_DISCONNECTED
Event.PEER_INVITED
Event.PEER_JOINED
Event.PEER_LEFT
Event.PLAYER_INFORMATION_COMPLETE
Event.PLAYER_INFORMATION_ERROR
Event.PLAYER_SCORE_COMPLETE
Event.PLAYER_SCORE_ERROR
Event.REPORT_ACHIEVEMENT_COMPLETE
Event.REPORT_ACHIEVEMENT_ERROR
Event.REPORT_SCORE_COMPLETE
Event.REPORT_SCORE_ERROR
Event.ROOM_AUTO_MATCHING
Event.ROOM_CONNECTED
Event.ROOM_CONNECTING
Event.ROOM_CREATED
Event.STATE_CONFLICT
Event.STATE_DELETED
Event.STATE_ERROR
Event.STATE_LOADED

Constants

Gaming.ALL_PLAYERS
Gaming.ALL_TIME
Gaming.FRIENDS
Gaming.HIDDEN
Gaming.REVEALED
Gaming.TODAY
Gaming.UNLOCKED
Gaming.WEEK