Leaderboards
Last updated
Last updated
Enhance competitiveness by integrating leaderboards, allowing players to compare their scores and achievements.
Use this to determine if you can implement leaderboards for your game on the current platform.
Submit the player's score to the leaderboard to update their rank and position.
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"score\"","value":"42"}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"score\"","value":"42"}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"lagged\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"boardId\"","value":"\"YOUR_LEADERBOARD_ID\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"score\"","value":"42"}}]},{"eventType":"block","conditions":[],"actions":[{"id":"leaderboard-set-score","objectClass":"PlaygamaBridge"}]}]}]}
Retrieve the player's score from the leaderboard to display their current standing.
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}}]},{"eventType":"block","conditions":[],"actions":[{"id":"leaderboard-get-score","objectClass":"PlaygamaBridge"}]}]},{"eventType":"block","conditions":[{"id":"on-leaderboard-get-score-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.LeaderboardPlayerScore"}}]}]}]}
Retrieve entries from the leaderboard, including the player's rank and score, to display a comprehensive leaderboard.
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}},{"id":"add-bool-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"includeUser\"","value":true}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"quantityAround\"","value":"10"}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"quantityTop\"","value":"10"}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"leaderboardName\"","value":"\"YOUR_LEADERBOARD_NAME\""}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"count\"","value":"10"}},{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"offset\"","value":"10"}}]},{"eventType":"block","conditions":[],"actions":[{"id":"leaderboard-get-entries","objectClass":"PlaygamaBridge"}]}]},{"eventType":"block","conditions":[{"id":"on-leaderboard-get-entries-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.LeaderboardEntriesCount","comparison":4,"second-value":"0"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"for","objectClass":"System","parameters":{"name":"\"entries\"","start-index":"0","end-index":"PlaygamaBridge.LeaderboardEntriesCount - 1"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"ID:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"id\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Score:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"score\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Rank:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"rank\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Name:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"name\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Photo:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"photo\")"}}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"facebook\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Player ID:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"playerId\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Score:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"score\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Rank:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"rank\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Player Name:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"playerName\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Player Photo:\" & PlaygamaBridge.LeaderboardEntryPropertyValue(loopindex(\"entries\"),\"playerPhoto\")"}}]}]}]}]}]}