Playgama
  • Welcome
  • 🚀Quick start
  • Submitting a game
  • Game Requirments
    • 💥Self-check
    • Technical Requirements
    • Advertising Requirements
    • User Experience Requirements
    • Content Requirements
    • Other Requirements
    • Platform-Specific Requirements
  • In-Game Purchases
    • Step-by-step IAP integration guide for Unity
  • FAQ
    • General
    • Submitting a Game
    • Game Moderation
    • Payments and Statistics
  • SDK
    • Getting started
    • Engines
      • Core (Plain JS)
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Unity
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Construct 3
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • GDevelop
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Godot
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Game Maker
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
      • Defold
        • 💥Intro
        • Setup
        • Platform Parameters
        • User Data
        • Advertising
          • Banner
          • Interstitial
          • Rewarded
          • AdBlock
        • User Parameters
        • Social Interactions
        • Leaderboards
        • Achievements
        • In-Game Purchases
        • Remote Configuration
    • Playgama Bridge Config
    • Changelog
  • For Partners
    • Getting Started
    • Embed the Widget
      • Adding Games Widget to Your WordPress Site
      • Adding Games Widget to Your Tilda Site
      • Adding Games Widget to Your Framer Site
    • Import the Game Catalog
    • Share your referral link
Powered by GitBook
On this page
  1. SDK
  2. Engines
  3. Godot

Leaderboards

Enhance competitiveness by integrating leaderboards, allowing players to compare their scores and achievements.

Support

Use this to determine if you can implement leaderboards for your game on the current platform.

Check if the leaderboard feature is supported on the platform.

Bridge.leaderboard.is_supported

Check if built-in popup is supported.

Bridge.leaderboard.is_native_popup_supported

Check if multiple boards are supported.

Bridge.leaderboard.is_multiple_boards_supported

Check if user can set score to leaderboard.

Bridge.leaderboard.is_set_score_supported

Check if user can retrieve their score.

Bridge.leaderboard.is_get_score_supported

Check if user can access leaderboard entries including other players' scores.

Bridge.leaderboard.is_get_entries_supported

Player Scores. Set

Submit the player's score to the leaderboard to update their rank and position.

func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "score": 42
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "score": 42
            }
        "msn":
            options = {
                "score": 42
            }
        "lagged":
            options = {
                "boardId": "YOUR_LEADERBOARD_ID",
                "score": 42
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME",
                "points": 42
            }

    Bridge.leaderboard.set_score(options, funcref(self, "_on_set_score_completed"))

func _on_set_score_completed(success):
    print(success)
func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "score": 42
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "score": 42
            }
        "msn":
            options = {
                "score": 42
            }
        "lagged":
            options = {
                "boardId": "YOUR_LEADERBOARD_ID",
                "score": 42
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME",
                "points": 42
            }

    Bridge.leaderboard.set_score(options, Callable(self, "_on_set_score_completed"))

func _on_set_score_completed(success):
    print(success)

Player Scores. Get

Retrieve the player's score from the leaderboard to display their current standing.

func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME"
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME"
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME"
            }

    Bridge.leaderboard.get_score(options, funcref(self, "_on_get_score_completed"))

func _on_get_score_completed(success, score):
    print(success)
    print(score)
func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME"
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME"
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME"
            }

    Bridge.leaderboard.get_score(options, Callable(self, "_on_get_score_completed"))

func _on_get_score_completed(success, score):
    print(success)
    print(score)

Read Full Leaderboard

Retrieve entries from the leaderboard, including the player's rank and score, to display a comprehensive leaderboard.

func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "includeUser": false, # default = false
                "quantityAround": 10, # default = 5
                "quantityTop": 10 # default = 5
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "count": 10, # default = 5
                "offset": 0 # default = 0
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME",
                "perPage": 10, # optional, default = 20, max = 100
                "page": 1, # optional, default = 1
                "mode": "alltime" # optional, "alltime" | "last30days" | "last7days" | "today" | "newest"
            }
            

    Bridge.leaderboard.get_entries(options, funcref(self, "_on_get_entries_completed"))

func _on_get_entries_completed(success, entries):
    print(success)

    match Bridge.platform.id:
        "yandex":
            for entry in entries:
                print("ID: " + str(entry.id))
                print("Name: " + str(entry.name))
                print("Score: " + str(entry.score))
                print("Rank: " + str(entry.rank))
                print("Photo: " + str(entry.photo))
        "facebook":
            for entry in entries:
                print("ID: " + str(entry.playerId))
                print("Name: " + str(entry.playerName))
                print("Score: " + str(entry.score))
                print("Rank: " + str(entry.rank))
                print("Photo: " + str(entry.playerPhoto))
        "y8":
            for entry in entries:
                print("ID: " + str(entry.playerid))
                print("Name: " + str(entry.playername))
                print("Score: " + str(entry.points))
                print("Rank: " + str(entry.rank))
func _ready():
    var options

    match Bridge.platform.id:
        "yandex":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "includeUser": false, # default = false
                "quantityAround": 10, # default = 5
                "quantityTop": 10 # default = 5
            }
        "facebook":
            options = {
                "leaderboardName": "YOUR_LEADERBOARD_NAME",
                "count": 10, # default = 5
                "offset": 0 # default = 0
            }
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME",
                "perPage": 10, # optional, default = 20, max = 100
                "page": 1, # optional, default = 1
                "mode": "alltime" # optional, "alltime" | "last30days" | "last7days" | "today" | "newest"
            }

    Bridge.leaderboard.get_entries(options, Callable(self, "_on_get_entries_completed"))

func _on_get_entries_completed(success, entries):
    print(success)

    match Bridge.platform.id:
        "yandex":
            for entry in entries:
                print("ID: " + str(entry.id))
                print("Name: " + str(entry.name))
                print("Score: " + str(entry.score))
                print("Rank: " + str(entry.rank))
                print("Photo: " + str(entry.photo))
        "facebook":
            for entry in entries:
                print("ID: " + str(entry.playerId))
                print("Name: " + str(entry.playerName))
                print("Score: " + str(entry.score))
                print("Rank: " + str(entry.rank))
                print("Photo: " + str(entry.playerPhoto))
        "y8":
            for entry in entries:
                print("ID: " + str(entry.playerid))
                print("Name: " + str(entry.playername))
                print("Score: " + str(entry.points))
                print("Rank: " + str(entry.rank))

Show Native Popup

Shows leaderboard entries built-in popup

func _ready():
    var options

    match Bridge.platform.id:
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME"
            }
            

    Bridge.leaderboard.show_native_popup(options, funcref(self, "_on_show_native_popup_completed"))

func _on_show_native_popup_completed(success):
    print(success)
func _ready():
    var options

    match Bridge.platform.id:
        "y8":
            options = {
                "table": "YOUR_LEADERBOARD_NAME"
            }
            

    Bridge.leaderboard.show_native_popup(options, Callback(self, "_on_show_native_popup_completed"))

func _on_show_native_popup_completed(success):
    print(success)
PreviousSocial InteractionsNextAchievements

Last updated 1 month ago