Skip to content

Extension update: <PlaygamaBridge> #2272

Description

@davitsedrakian

Changes

Social

  • Added post rewards — IsPostRewardSupported, GetPostReward and OnGetPostRewardCompleted, with the rewards read through PostRewardsCount, PostRewardId, PostRewardAmount, PostRewardType and PostRewardsAsJSON
  • CreatePost takes an optional Payload — the game's own string for that one post, handed back through PlatformPayload when someone opens it
  • Share, InviteFriends and CreatePost accept the id of an entry declared in playgama-bridge-config.json (social.shares, social.invites, social.posts), so the text, image and link live in the config instead of the events

Platform

  • Added PlatformLaunchSource — tells whether the game was opened from a notification or from one of its own posts
  • Added PlatformDataValue and PlatformDataAsJSON — the launch parameters the platform passed to the game, including postId when it was opened from a post

Platforms

  • Reddit — posts, sharing as a comment, leaderboards, server time and post rewards
  • Samsung Instant Plays — in-app purchases, loading progress, GRAC rating badge
  • Added the Playgama Sandbox platform

Changed

  • Playgama shows payment prices resolved by the platform
  • Playgama cloud saves now work for guest players

How to use the new features

Post rewards let a game reward two people: the player who opened the game from a post,
and the author of that post, once other players come through it. The rewards themselves
are declared per post in playgama-bridge-config.json, so the events stay simple:

Create Post — Id: "gift", Payload: ""

Then, on startup:

Condition: Is Post Reward Supported
Action:    Get Post Reward
Event:     On Get Post Reward Completed
    Repeat PostRewardsCount times:
        Add PostRewardAmount(i) to the variable named PostRewardId(i)

The list is empty when there is nothing to grant, and the platform backend decides who is
rewarded and when, so the game only reads what it gets.

PlatformLaunchSource and PlatformDataValue("postId") tell the game it was opened from
one of its own posts and which post that was, which is what makes level sharing possible:
put the level into the payload of Create Post, then read it back with PlatformPayload.

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

Example file

bridge-gdevelop-examples.zip

Extension file

PlaygamaBridge.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔄 Extension updateAn update for an existing extension🔍 Reviewed extensionAn extension that is to be reviewed in great detail before merging.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions