### Get Server Time (Construct 3 Action) Source: https://context7.com/playgama/bridge-construct/llms.txt Asynchronously retrieves the current server time from the platform. Requires calling an action and then listening for a trigger to get the timestamp. ```construct3 // In Construct 3 Event Sheet: // Action: PlaygamaBridge -> Get Server Time // Trigger: On Get Server Time Completed // Condition: Is Last Action Completed Successfully // Expression: PlaygamaBridge.ServerTime // Event flow: // 1. Call "Get Server Time" action // 2. Wait for "On Get Server Time Completed" trigger // 3. Check "Is Last Action Completed Successfully" // 4. Use PlaygamaBridge.ServerTime expression (Unix timestamp) ``` -------------------------------- ### Authorize Player (Construct 3 Action) Source: https://context7.com/playgama/bridge-construct/llms.txt Initiates the player authorization process on platforms that support it, typically displaying a login or consent dialog. It uses an action to start and a trigger to confirm completion. ```construct3 // In Construct 3 Event Sheet: // Condition: Is Player Authorization Supported // Action: PlaygamaBridge -> Authorize Player // Trigger: On Authorize Player Completed // Example flow: // On Button "Login" Clicked // If PlaygamaBridge.IsPlayerAuthorizationSupported // -> PlaygamaBridge: Authorize Player // // On Authorize Player Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Set Text to "Welcome, " & PlaygamaBridge.PlayerName // Else // -> Set Text to "Login failed" ``` -------------------------------- ### Get Player Information (Construct 3 Expressions) Source: https://context7.com/playgama/bridge-construct/llms.txt Accesses player profile data such as ID, name, and photos after successful authorization. Provides expressions to retrieve this information and conditions to check its availability. ```construct3 // In Construct 3 Event Sheet: // Expressions: // - PlaygamaBridge.PlayerId - Unique player identifier // - PlaygamaBridge.PlayerName - Display name // - PlaygamaBridge.PlayerPhotosCount - Number of photos available // - PlaygamaBridge.PlayerPhoto(index) - Photo URL at index // Conditions: // - Is Player Authorized // - Does Player Have Name // - Does Player Have Photo (index) // Example: // If PlaygamaBridge.IsPlayerAuthorized // If PlaygamaBridge.DoesPlayerHaveName // -> Set Text to PlaygamaBridge.PlayerName // If PlaygamaBridge.DoesPlayerHavePhoto(0) // -> Load image from PlaygamaBridge.PlayerPhoto(0) ``` -------------------------------- ### Show Rewarded Ad in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Display a rewarded video advertisement that grants players in-game rewards upon completion. Includes triggers for ad states and an expression to get the rewarded state and placement. ```javascript // In Construct 3 Event Sheet: // Condition: Is Rewarded Supported // Action: Show Rewarded (Placement) // Triggers: // - On Rewarded Loading // - On Rewarded Opened // - On Rewarded Rewarded <- Player completed watching // - On Rewarded Closed // - On Rewarded Failed // - On Rewarded State Changed // Expressions: // - PlaygamaBridge.RewardedState // - PlaygamaBridge.RewardedPlacement // Example: // On Button "Watch Ad for Coins" Clicked // If PlaygamaBridge.IsRewardedSupported // -> PlaygamaBridge: Show Rewarded // Placement: "bonus_coins" // -> Pause game // // On Rewarded Rewarded // -> Add 100 to PlayerCoins // -> Set Text to "You earned 100 coins!" // // On Rewarded Closed // -> Resume game ``` -------------------------------- ### Get Leaderboard Entries in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Retrieves entries from a leaderboard to display rankings within the game. It provides expressions to access the count and details of each entry, such as name, score, and rank. ```javascript // In Construct 3 Event Sheet: // Action: Get Leaderboard Entries (ID) // Trigger: On Leaderboards Get Entries Completed // Expressions: // - PlaygamaBridge.LeaderboardEntriesCount // - PlaygamaBridge.LeaderboardEntryId(index) // - PlaygamaBridge.LeaderboardEntryName(index) // - PlaygamaBridge.LeaderboardEntryPhoto(index) // - PlaygamaBridge.LeaderboardEntryScore(index) // - PlaygamaBridge.LeaderboardEntryRank(index) // Example: // On Button "Leaderboard" Clicked // -> PlaygamaBridge: Get Leaderboard Entries // ID: "main_leaderboard" // // On Leaderboards Get Entries Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // Repeat PlaygamaBridge.LeaderboardEntriesCount times // -> Create "LeaderboardEntry" object // -> Set Name to PlaygamaBridge.LeaderboardEntryName(loopindex) // -> Set Score to PlaygamaBridge.LeaderboardEntryScore(loopindex) // -> Set Rank to PlaygamaBridge.LeaderboardEntryRank(loopindex) ``` -------------------------------- ### Get Platform Language (JavaScript) Source: https://context7.com/playgama/bridge-construct/llms.txt Fetches the language code of the current platform (e.g., 'en', 'ru', 'de') for implementing localization in the game. This allows adapting text and content to the user's preferred language. ```javascript // In Construct 3 Event Sheet: // Expression: PlaygamaBridge.PlatformLanguage // Returns: "en", "ru", "de", etc. // Example usage for localization: // Set Text to PlaygamaBridge.PlatformLanguage // If PlaygamaBridge.PlatformLanguage = "ru" // -> Load Russian language pack ``` -------------------------------- ### Get Platform ID (JavaScript) Source: https://context7.com/playgama/bridge-construct/llms.txt Retrieves the unique identifier for the current gaming platform (e.g., 'playgama', 'yandex', 'vk'). This is useful for implementing platform-specific features or logic. ```javascript // In Construct 3 Event Sheet: // Expression: PlaygamaBridge.PlatformId // Returns: "playgama", "yandex", "vk", "crazy_games", etc. // Example condition usage: // If PlaygamaBridge.PlatformId = "yandex" // -> Show Yandex-specific features ``` -------------------------------- ### Process In-App Purchases in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Demonstrates how to initiate a purchase and handle the completion trigger. It uses the PlaygamaBridge plugin to check support and process the transaction. ```javascript // On Button "Buy 1000 Coins" Clicked // If PlaygamaBridge.IsPaymentsSupported // -> PlaygamaBridge: Payments Purchase // ID: "coins_1000" // // On Payments Purchase Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Add 1000 to PlayerCoins // -> Set Text to "Purchase successful!" ``` -------------------------------- ### Retrieve and Display Product Catalog Source: https://context7.com/playgama/bridge-construct/llms.txt Fetches the list of available products from the store and iterates through them to populate shop UI elements. ```javascript // On Start of Layout // -> PlaygamaBridge: Payments Get Catalog // // On Payments Get Catalog Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // Repeat PlaygamaBridge.PaymentsCatalogItemsCount times // -> Create "ShopItem" object // -> Set ItemID to PlaygamaBridge.PaymentsCatalogItemPropertyValue(loopindex, "id") // -> Set Price to PlaygamaBridge.PaymentsCatalogItemPropertyValue(loopindex, "price") ``` -------------------------------- ### Send Platform Message (Construct 3 Action) Source: https://context7.com/playgama/bridge-construct/llms.txt Sends predefined game state messages to the platform to signal events like game readiness, loading progress, or player achievements. This helps platforms track game lifecycle and features. ```construct3 // In Construct 3 Event Sheet: // Action: PlaygamaBridge -> Send Message to Platform // Available messages: // - Game Ready - Signal game has loaded and is ready // - In-Game Loading Started/Stopped - For loading screens // - Gameplay Started/Stopped - Track active gameplay // - Player Got Achievement - Achievement unlocked // - Level Started/Completed/Failed - Level progression // - Level Paused/Resumed - Pause state // Example: // On Start of Layout // -> PlaygamaBridge: Send Message "Game Ready" // On Level Complete // -> PlaygamaBridge: Send Message "Level Completed" ``` -------------------------------- ### Additional Social Actions in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Provides actions for joining communities, creating posts, adding the game to the home screen (PWA), adding to favorites, and rating the game. Each action has corresponding conditions and triggers. ```javascript // In Construct 3 Event Sheet: // Available conditions and actions: // Join Community // Condition: Is Join Community Supported // Action: Join Community // Trigger: On Join Community Completed // Create Post // Condition: Is Create Post Supported // Action: Create Post // Trigger: On Create Post Completed // Add to Home Screen (PWA) // Condition: Is Add To Home Screen Supported // Action: Add To Home Screen // Trigger: On Add To Home Screen Completed // Add to Favorites // Condition: Is Add To Favorites Supported // Action: Add To Favorites // Trigger: On Add To Favorites Completed // Rate Game // Condition: Is Rate Supported // Action: Rate // Trigger: On Rate Completed // External Links // Condition: Is External Links Allowed ``` -------------------------------- ### Check Device Type (Construct 3 Conditions) Source: https://context7.com/playgama/bridge-construct/llms.txt Determines the type of device the game is running on (mobile, tablet, desktop, TV) using built-in conditions and an expression. This is crucial for implementing responsive design and platform-specific controls. ```construct3 // In Construct 3 Event Sheet: // Conditions available: // - Is Mobile // - Is Tablet // - Is Desktop // - Is Tv // Expression: PlaygamaBridge.DeviceType // Returns: "mobile", "tablet", "desktop", or "tv" // Example: // If PlaygamaBridge.IsMobile // -> Show touch controls // -> Set Sprite "JoystickUI" visible // Else If PlaygamaBridge.IsDesktop // -> Show keyboard prompts // -> Set Text to "Use WASD to move" ``` -------------------------------- ### Fetch Remote Config Values in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Fetches remote configuration values for A/B testing and feature flags using Playgama Bridge. It outlines the necessary conditions, actions, and triggers within Construct 3's event sheet system. It also shows how to check for the existence of a value and retrieve it. ```javascript // In Construct 3 Event Sheet: // Condition: Is Remote Config Supported // Action: Send Remote Config Get Request // Trigger: On Remote Config Got Completed // Conditions: // - Has Remote Config Value (Key) // Expression: // - PlaygamaBridge.RemoteConfigValue(key) // Example: // On Start of Layout // If PlaygamaBridge.IsRemoteConfigSupported // -> PlaygamaBridge: Send Remote Config Get Request // // On Remote Config Got Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // If PlaygamaBridge.HasRemoteConfigValue("difficulty_multiplier") // -> Set DifficultyMultiplier to PlaygamaBridge.RemoteConfigValue("difficulty_multiplier") // If PlaygamaBridge.HasRemoteConfigValue("enable_bonus_level") // -> Set BonusLevelEnabled to PlaygamaBridge.RemoteConfigValue("enable_bonus_level") ``` -------------------------------- ### Load Data from Storage in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Retrieve previously saved game data. This involves appending keys for the data to retrieve and sending a request. Retrieved data can be accessed by key or as a JSON string. ```javascript // In Construct 3 Event Sheet: // Actions: // - Append Storage Data Get Request (Key) // - Send Storage Data Get Request (StorageType) // Expressions: // - PlaygamaBridge.StorageData(key) - Get value by key // - PlaygamaBridge.StorageDataAsJSON(key) - Get value as JSON string // - PlaygamaBridge.DefaultStorageType - Platform's default storage // Example - Load player progress: // On Start of Layout // -> PlaygamaBridge: Append Storage Data Get Request // Key: "level" // -> PlaygamaBridge: Append Storage Data Get Request // Key: "score" // -> PlaygamaBridge: Send Storage Data Get Request (Default) // // On Storage Data Get Request Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // If PlaygamaBridge.HasStorageData("level") // -> Set CurrentLevel to PlaygamaBridge.StorageData("level") // If PlaygamaBridge.HasStorageData("score") // -> Set PlayerScore to PlaygamaBridge.StorageData("score") ``` -------------------------------- ### Handle Platform Audio State Changes in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Responds to platform-level audio enable or disable events. It utilizes the 'On Platform Audio State Changed' trigger and the 'PlaygamaBridge.IsPlatformAudioEnabled' condition to adjust master volume accordingly. ```javascript // In Construct 3 Event Sheet: // Condition: Is Platform Audio Enabled // Trigger: On Platform Audio State Changed // Example: // On Platform Audio State Changed // If PlaygamaBridge.IsPlatformAudioEnabled // -> Set master volume to 1 // Else // -> Set master volume to 0 ``` -------------------------------- ### Show Native Leaderboard Popup in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Displays the platform's native leaderboard UI. This action is conditional on the leaderboard type being set to 'Native Popup'. ```javascript // In Construct 3 Event Sheet: // Condition: Is Leaderboards Type Native Popup // Action: Show Leaderboard Native Popup (ID) // Trigger: On Leaderboards Show Native Popup Completed // Example: // On Button "View Rankings" Clicked // If PlaygamaBridge.IsLeaderboardsTypeNativePopup // -> PlaygamaBridge: Show Leaderboard Native Popup // ID: "main_leaderboard" // Else If PlaygamaBridge.IsLeaderboardsTypeInGame // -> Show custom in-game leaderboard UI ``` -------------------------------- ### Show Banner Ad in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Display a banner advertisement at the top or bottom of the screen. Supports showing and hiding the banner, with triggers for various ad states like loading, shown, hidden, and failures. ```javascript // In Construct 3 Event Sheet: // Condition: Is Banner Supported // Actions: // - Show Banner (Position, Placement) // - Hide Banner // Triggers: // - On Banner Loading // - On Banner Shown // - On Banner Hidden // - On Banner Failed // - On Banner State Changed // Example: // On Start of Layout // If PlaygamaBridge.IsBannerSupported // -> PlaygamaBridge: Show Banner // Position: Bottom // Placement: "main_menu" // // On Banner Shown // -> Adjust UI layout for banner // // On Game Start // -> PlaygamaBridge: Hide Banner ``` -------------------------------- ### Invite Friends Feature in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Allows players to send game invitations to their friends through supported platforms. This feature can optionally trigger a referral bonus upon successful completion. ```javascript // In Construct 3 Event Sheet: // Condition: Is Invite Friends Supported // Action: Invite Friends // Trigger: On Invite Friends Completed // Example: // On Button "Invite" Clicked // If PlaygamaBridge.IsInviteFriendsSupported // -> PlaygamaBridge: Invite Friends // // On Invite Friends Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Add 50 to PlayerCoins (referral bonus) ``` -------------------------------- ### Save Data to Storage in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Persistently store game data using the platform's storage system. This involves appending data keys and values, then sending a request to save them. It supports different storage types like Default, LocalStorage, and PlatformInternal. ```javascript // In Construct 3 Event Sheet: // Actions: // - Append Storage Data Set Request (Key, Value) // - Send Storage Data Set Request (StorageType) // Storage types: Default, LocalStorage, PlatformInternal // Example - Save player progress: // On Level Complete // -> PlaygamaBridge: Append Storage Data Set Request // Key: "level" // Value: CurrentLevel // -> PlaygamaBridge: Append Storage Data Set Request // Key: "score" // Value: PlayerScore // -> PlaygamaBridge: Send Storage Data Set Request (Default) // // On Storage Data Set Request Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Set Text to "Progress saved!" ``` -------------------------------- ### Show Native Achievements UI Source: https://context7.com/playgama/bridge-construct/llms.txt Opens the platform-specific native UI for viewing achievements. ```javascript // On Button "View Achievements" Clicked // If PlaygamaBridge.IsAchievementsNativePopupSupported // -> PlaygamaBridge: Achievements Show Native Popup ``` -------------------------------- ### Share Game Functionality in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Enables players to share the game on social platforms. Supports custom text and requires checking if the feature is supported before attempting to share. ```javascript // In Construct 3 Event Sheet: // Condition: Is Share Supported // Action: Share // Trigger: On Share Completed // Example with parameters: // On Button "Share" Clicked // If PlaygamaBridge.IsShareSupported // -> PlaygamaBridge: Add Action Parameter // Key: "text" // Value: "I scored " & PlayerScore & " points!" // -> PlaygamaBridge: Share // // On Share Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Set Text to "Thanks for sharing!" ``` -------------------------------- ### Handle Game Visibility Changes in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Responds to changes in the game's visibility state, such as when the tab is switched or the game is minimized. It uses the 'On Visibility State Changed' trigger and the 'PlaygamaBridge.VisibilityState' expression to determine if the game is 'visible' or 'hidden'. ```javascript // In Construct 3 Event Sheet: // Trigger: On Visibility State Changed // Expression: PlaygamaBridge.VisibilityState // Returns: "visible" or "hidden" // Example: // On Visibility State Changed // If PlaygamaBridge.VisibilityState = "hidden" // -> Pause game // -> Mute audio // Else // -> Resume game // -> Unmute audio ``` -------------------------------- ### Show Interstitial Ad in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Display a full-screen interstitial advertisement between game sections. Allows setting a minimum delay between ads and provides triggers for ad loading, opening, closing, and failures. ```javascript // In Construct 3 Event Sheet: // Condition: Is Interstitial Supported // Action: Show Interstitial (Placement) // Action: Set Minimum Delay Between Interstitial (Seconds) // Triggers: // - On Interstitial Loading // - On Interstitial Opened // - On Interstitial Closed // - On Interstitial Failed // - On Interstitial State Changed // Example: // On Start of Layout // -> PlaygamaBridge: Set Minimum Delay Between Interstitial // Seconds: 120 // // On Level Complete // If PlaygamaBridge.IsInterstitialSupported // -> PlaygamaBridge: Show Interstitial // Placement: "level_complete" // -> Pause game audio // // On Interstitial Closed // -> Resume game audio // -> Go to Next Level ``` -------------------------------- ### Restore Player Purchases Source: https://context7.com/playgama/bridge-construct/llms.txt Retrieves the history of player purchases to allow for restoration of items across sessions or devices. ```javascript // On Button "Restore Purchases" Clicked // -> PlaygamaBridge: Payments Get Purchases // // On Payments Get Purchases Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // Repeat PlaygamaBridge.PaymentsPurchasesCount times // -> Process restored purchase at loopindex ``` -------------------------------- ### Retrieve Achievements List Source: https://context7.com/playgama/bridge-construct/llms.txt Fetches the full list of achievements and their current status for display in a player menu. ```javascript // On Button "Achievements" Clicked // If PlaygamaBridge.IsAchievementsGetListSupported // -> PlaygamaBridge: Achievements Get List // // On Achievements Get List Completed // Repeat PlaygamaBridge.AchievementsCount times // -> Display achievement at loopindex ``` -------------------------------- ### Handle Platform Pause State Changes in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Responds to platform-level pause events, such as when an advertisement is displayed. It uses the 'On Platform Pause State Changed' trigger and the 'PlaygamaBridge.IsPlatformPaused' condition to control the game's time scale and audio playback. ```javascript // In Construct 3 Event Sheet: // Condition: Is Platform Paused // Trigger: On Platform Pause State Changed // Example: // On Platform Pause State Changed // If PlaygamaBridge.IsPlatformPaused // -> Set time scale to 0 // -> Pause all audio // Else // -> Set time scale to 1 // -> Resume all audio ``` -------------------------------- ### Check AdBlock Status in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Detects if a player is using an ad blocker. This functionality relies on the PlaygamaBridge SDK and triggers an event upon completion. ```javascript // In Construct 3 Event Sheet: // Action: Check Ad Block // Trigger: On Check AdBlock Completed // Condition: Is AdBlock Detected // Example: // On Start of Layout // -> PlaygamaBridge: Check Ad Block // // On Check AdBlock Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // If PlaygamaBridge.IsAdBlockDetected // -> Show "Please disable AdBlock" message ``` -------------------------------- ### Submit Score to Leaderboard in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Submits a player's score to a specified leaderboard. The function requires a leaderboard ID and the score. It also provides conditions to check the type of leaderboard available. ```javascript // In Construct 3 Event Sheet: // Action: Set Leaderboard Score (ID, Score) // Trigger: On Leaderboards Set Score Completed // Leaderboard types (check with conditions): // - Is Leaderboards Type Not Available // - Is Leaderboards Type In Game // - Is Leaderboards Type Native // - Is Leaderboards Type Native Popup // Example: // On Game Over // -> PlaygamaBridge: Set Leaderboard Score // ID: "main_leaderboard" // Score: PlayerScore // // On Leaderboards Set Score Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Set Text to "Score submitted!" ``` -------------------------------- ### Delete Data from Storage in Construct 3 Source: https://context7.com/playgama/bridge-construct/llms.txt Remove saved data from storage by specifying the keys to delete and sending a request. This is useful for resetting player progress or clearing specific data entries. ```javascript // In Construct 3 Event Sheet: // Actions: // - Append Storage Data Delete Request (Key) // - Send Storage Data Delete Request (StorageType) // Example - Reset progress: // On Button "Reset" Clicked // -> PlaygamaBridge: Append Storage Data Delete Request // Key: "level" // -> PlaygamaBridge: Append Storage Data Delete Request // Key: "score" // -> PlaygamaBridge: Send Storage Data Delete Request (Default) // // On Storage Data Delete Request Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Set Text to "Progress reset!" ``` -------------------------------- ### Unlock Achievements Source: https://context7.com/playgama/bridge-construct/llms.txt Triggers an achievement unlock event when specific game conditions are met, such as reaching a kill count threshold. ```javascript // On Enemy Defeated // Add 1 to EnemiesKilled // If EnemiesKilled >= 100 // If PlaygamaBridge.IsAchievementsSupported // -> PlaygamaBridge: Add Action Parameter // Key: "id" // Value: "kill_100_enemies" // -> PlaygamaBridge: Achievements Unlock // // On Achievements Unlock Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> Show achievement popup ``` -------------------------------- ### Consume Consumable Purchases Source: https://context7.com/playgama/bridge-construct/llms.txt Marks a specific purchase as consumed after a successful transaction, which is required for certain platform store policies. ```javascript // On Payments Purchase Completed // If PlaygamaBridge.IsLastActionCompletedSuccessfully // -> PlaygamaBridge: Payments Consume Purchase // ID: "coins_1000" // -> Add 1000 to PlayerCoins ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.