Skip to content

PokiSDK - Construct 3

Made by Ossama Jouini 

Introduction & Features

This is a Poki Plugin made for the Construct 3 Engine. It was designed to help the integration of the PokiSDK into your Construct 3 game.

Features
  • A preview project showing the implementation of the SDK through the addon.
  • The Poki SDK Construct 3 addon.

Once you install and enable the extension, you will be able to test the PokiSDK integration in preview mode (in browser) and be able to make builds (web-mobile) that can be uploaded to Poki platform.

1. Initialize the SDK

Or download the source code as a zip file.

git clone https://github.com/skymen/poki-c3-plugin

Once this is done, you can add the extension by going to Menu > View > Addons Manager.

You can download an example project here. In this project, you can find examples of how the Construct 3 Poki SDK can be implemented.

Screenshot

extension-add

Here you can upload the addon by clicking on Install new addon... and selecting the .c3addon you’ve just downloaded.

extension-enable

To make sure the extension is enabled, simply refresh the page. The Poki SDK addon should now be visible in your Addon Manager.

extension-enable


2. Implement the gameplay events

Use the  ๐ŸŽฎ gameplayStart()  event to describe when users are playing your game (e.g. level start and unpause).

Use the  โ˜  gameplayStop()  event to describe when users aren’t playing your game (e.g. level finish, game over, pause, quit to menu).

The Construct 3 SDK comes packed with two trigger functions that you can use to implement these events. These are PK_TriggerGameStart and PK_TriggerGameStop respectively.

gameplay-function-desc

You can implement these triggers as indicated below to trigger these events in the right locations for your game.

gameplay-function-triggers


3. Implement commercialBreak

Commercial breaks are used to display video ads and should be triggered on natural breaks in your game. Throughout the rest of your game, we recommend you implement the  ๐ŸŽž commercialBreak()  before every  ๐ŸŽฎ gameplayStart() , i.e. whenever the user has shown an intent to continue playing.

For this event, there’s a similar trigger as for the gameplay events. You can use PK_LoadCommercialBreak.

gameplay-function-triggers

Important information about commercialBreaks

Not every single  ๐ŸŽž commercialBreak()  will trigger an ad. Poki’s system will determine when a user is ready for another ad, so feel free to signal as many commercial break opportunities as possible.


4. Implement rewardedBreak

Rewarded breaks allow for a user to choose to watch a rewarded video ad in exchange for a certain benefit in the game (e.g. more coins, etc.). When using  ๐ŸŽฌ rewardedBreak() , please make it clear to the player beforehand that they’re about to watch an ad.

In order to use a rewarded break in your game, please follow the steps below:

  • Use the PK_LoadRewardedBreak trigger gameplay-function-triggers
  • In the handling of the  ๐ŸŽฌ rewardedBreak() , if a PK_RewardedBreakFail is called, that means that no ad was played. If this happens, don’t give the player a reward. gameplay-function-triggers

About the rewardedBreak timer

 ๐ŸŽฌ rewardedBreak()  affects the timing of  ๐ŸŽž commercialBreak()  - When a user interacts with a rewarded break, our systemโ€™s ad timer is reset to ensure the user does not immediately see another ad.


Upload and test your game in Poki for Developers

Congrats, youโ€™ve successfully implemented the PokiSDK! Now upload your game to the Poki Inspector and test it there. When you’re happy with the implementation, send us a review request and we’ll play the game. Feel free to contact us via Discord or developersupport@poki.com if you’re stuck.