This repository provides a comprehensive example of how to integrate the Playgama Bridge SDK into a GDevelop project. It serves as a practical guide for game developers looking to publish their HTML5 games across a wide range of platforms and monetize them effectively.
Playgama Bridge is a unified Software Development Kit (SDK) that allows HTML5 game developers to integrate their games with multiple distribution platforms using a single, streamlined process. By integrating Playgama Bridge, developers can reach a massive audience of over 300 million monthly active users across various platforms without the need to manage multiple SDKs and APIs.
- One SDK, Many Platforms: Integrate once and publish your game on numerous platforms, including CrazyGames, YouTube, Huawei, Telegram, and many more.
- Monetization Made Easy: Seamlessly implement interstitial and rewarded video ads to generate revenue from your games.
- Cloud Saves: Provide a better player experience with cross-device saving, allowing users to continue their progress on any device.
- Simplified Development: The SDK abstracts away the complexities of platform-specific APIs, allowing you to focus on creating great games.
This repository contains a simple GDevelop game that demonstrates the core functionalities of the Playgama Bridge SDK. The game consists of a player character, collectible coins, and a simple level progression system. It is designed to showcase the following key integration points:
- SDK Initialization: How to properly initialize the Playgama Bridge SDK and wait for it to be ready.
- Ad Monetization: How to display interstitial and rewarded ads at appropriate moments in the game.
- Cloud Data Storage: How to save and retrieve player data, such as the highest level unlocked.
Follow these steps to get the project running on your local machine for development and testing purposes.
Before you begin, ensure you have the following installed:
- GDevelop 5: You can download the latest version for your operating system from the official GDevelop website.
- Git: (Optional, for cloning) You can download Git from git-scm.com.
-
Clone the repository: Open your terminal or command prompt and run the following command to clone the repository to your local machine:
git clone https://github.com/Playgama/bridge-gdevelop-example.git
Alternatively, you can download the project as a ZIP file by clicking the "Code" button on the GitHub repository page and selecting "Download ZIP".
-
Open the project in GDevelop:
- Launch the GDevelop 5 application.
- On the startup screen, select "Open a project".
- Navigate to the directory where you cloned or unzipped the repository (e.g.,
bridge-gdevelop-example). - Select the
PlaygamaBridgeExample.jsonfile and click "Open".
-
Run the game:
- Once the project is open, you can run the game directly in the GDevelop editor by clicking the "Preview" button (play icon) in the top toolbar. This will launch a preview of the game in a new window.
-
Explore the implementation:
- Navigate through the different scenes (
Loader,LevelSelect,Game) and open the event sheets to see how the Playgama Bridge integration is implemented.
- Navigate through the different scenes (
The integration with Playgama Bridge is primarily handled through the GDevelop event system. Here's a breakdown of the key events:
-
LoaderScene: This is the first scene that runs. Its purpose is to initialize the SDK and load any saved data before the game starts.- At the beginning of the scene, the
Initialize Playgama Bridgeaction is called. - The game then waits for the
Playgama Bridge is readycondition to be true. - Once the bridge is ready, the game retrieves the player's saved data from the cloud.
- Finally, the
GAME_READYmessage is sent to the SDK, and the game transitions to theLevelSelectscene.
- At the beginning of the scene, the
-
LevelSelectScene: This scene allows the player to choose a level.- When the player chooses a level, an interstitial ad is shown before transitioning to the
Gamescene.
- When the player chooses a level, an interstitial ad is shown before transitioning to the
-
GameScene: This is where the main gameplay happens.- When the player completes a level, their progress is saved to the cloud using the
Save dataaction. - When the player completes the fourth level, a rewarded ad is shown to simulate giving the player an in-game reward.
- When the player completes a level, their progress is saved to the cloud using the
This project is licensed under the MIT License. See the LICENSE file for details.