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
    • 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. Game Maker

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.

playgama_bridge_leaderboard_is_supported()

Check if built-in popup is supported.

playgama_bridge_leaderboard_is_native_popup_supported()

Check if multiple boards are supported.

playgama_bridge_leaderboard_is_multiple_boards_supported()

Check if user can set score to leaderboard.

playgama_bridge_leaderboard_is_set_score_supported()

Check if user can retrieve their score.

playgama_bridge_leaderboard_is_get_score_supported()

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

playgama_bridge_leaderboard_is_get_entries_supported()

Player Scores. Set

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

var options
switch playgama_bridge_platform_id() {
    case "yandex":
	options = {
    	    "leaderboardName": "YOUR_LEADERBOARD_NAME",
            "score": 42
        }
        break
    case "facebook":
        options = {
            "leaderboardName": "YOUR_LEADERBOARD_NAME",
            "score": 42
        }
        break
    case "msn":
        options = {
            "score": 42
        }
        break
    case "lagged":
        options = {
            "boardId": "YOUR_LEADERBOARD_ID",
            "score": 42
        }
        break
    case "y8":
        options = {
            "table": "YOUR_LEADERBOARD_NAME",
            "points": 42
        }
        break
}

playgama_bridge_leaderboard_set_score(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_leaderboard_set_score_callback" {
	if async_load[? "success"] {
		// your logic
	}
}

// callback via script
function playgama_bridge_leaderboard_set_score_callback(success) {
	if success {
		// your logic
	}
}

Player Scores. Get

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

var options
switch playgama_bridge_platform_id() {
    case "yandex":
        options = {
            "leaderboardName": "YOUR_LEADERBOARD_NAME",
        }
        break
    case "facebook":
        options = {
            "leaderboardName": "YOUR_LEADERBOARD_NAME",
        }
        break
    case "y8":
        options = {
            "table": "YOUR_LEADERBOARD_NAME",
        }
        break
}

playgama_bridge_leaderboard_get_score(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_leaderboard_get_score_callback" {
    if async_load[? "success"] {
        var score_value = async_load[? "data"]
    }
}

// callback via script
function playgama_bridge_leaderboard_get_score_callback(success, data) {
    if success {
        var score_value = data
    }
}

Get Full Leaderboard

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

var options
switch playgama_bridge_platform_id() {
    case "yandex":
        options = {
            "leaderboardName": "YOUR_LEADERBOARD_NAME",
            "includeUser": false, // default = false
            "quantityAround": 10, // default = 5
            "quantityTop": 10 // default = 5
        }
        break
    case "facebook":
        options = {
            "leaderboardName": "YOUR_LEADERBOARD_NAME",
            "count": 10, // default = 5
            "offset": 0 // default = 0
        }
        break
    case "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"
        }
        break
}

playgama_bridge_leaderboard_get_entries(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_leaderboard_get_entries_callback" {
    if async_load[? "success"] {
        var entries = json_parse(async_load[? "data"])
    }
}

// callback via script
function playgama_bridge_leaderboard_get_entries_callback(success, data) {
    if success {
        var entries = json_parse(data)
    }
}

Show Native Popup

Shows leaderboard entries built-in popup

var options
switch playgama_bridge_platform_id() {
    case "y8":
        options = {
            "table": "YOUR_LEADERBOARD_NAME"
        }
        break
}

playgama_bridge_leaderboard_show_native_popup(json_stringify(options))

// callback via Async Social Event
if async_load[? "type"] == "playgama_bridge_leaderboard_show_native_popup_callback" {
    if async_load[? "success"] {
        // your logic here
    }
}

// callback via script
function playgama_bridge_leaderboard_show_native_popup_callback(success, data) {
    if success {
        // your logic here
    }
}
PreviousSocial InteractionsNextAchievements

Last updated 19 days ago