Poki SDK

rob1221

  • *
  • Posts: 9448
This is an extension for the Poki.com SDK for HTML5 games that can be used by any developers approved by Poki.  If not already involved with Poki, you can check this page for more information: https://developers.poki.com/

The extension has 5 blocks, and the initialization happens automatically due to the template files that are replaced by the extension (thanks to Justin for helping with that).


Use this block to tell Poki when gameplay has started and stopped.


Show a standard ad and then the blocks inside the wrapper will be triggered when the ad either finishes or fails to show.  Ad rate throttling is done automatically on Poki's end.


Show a rewarded ad and then the blocks inside the wrapper will be triggered when the ad either finishes or fails to show.  If the embedded reward boolean is true inside the wrapper, then the ad was shown correctly and the player should be rewarded.


Returns true if an ad blocker was detected by Poki when starting.


Use this block when a happy event happens in your game.  Intensity is between 0 and 1.

For more info about when to use these blocks, refer to the instructions in this link, ignoring the code examples: https://sdk.poki.com/html5/

To enable debug mode for testing purposes, go to Settings > Advanced > Haxe Flags.
Then paste -D pokiDebug into that box.  When ready to publish your final build to Poki, remember to delete that line.

Poki games need to be sitelocked, but the sitelock code is not public and thus cannot be included in the extension.  When given the sitelock code, open templates/haxe/ApplicationMain.hx inside of the extension folder.  At or close to line 325 it says // INSERT POKI SITELOCK CODE HERE and you can either replace that line or paste the sitelock code just under it.  The sitelock can be tested on Poki's QA tool when the pokiDebug flag is disabled.

While not a part of this extension, Poki games need to be scalable on their site.  To enable automatic scaling, go to Settings > Advanced > OpenFL Settings and paste <window resizable="true" /> into that box.  Your game resolution will also need to be in the 16:9 aspect ratio.

If using the public build b10300, open up include.xml inside of the extension folder and uncomment the line that says <set name="b10300" />

If there are issues with any Stencyl builds let me know as I've only tested with b10300 and b10417.

Download Extension
(must be signed in to the forums to download)

Update 1:
Restricted the sitelock code to non-debug mode since it caused a crash when testing locally.
Added a boolean block to check if an ad blocker was detected by Poki on startup.

« Last Edit: November 15, 2019, 02:56:24 pm by rob1221 »

zerosimms

  • Posts: 696
Legend! Thanks for sharing this, looking forward to giving it a whirl (if my game gets accepted)

rodolfovs

  • *
  • Posts: 146
Hi Rob,

Reading the POKI SDK page says I need to implement a loading code like the one below:

PokiSDK.gameLoadingStart();
PokiSDK.gameLoadingFinished();
PokiSDK.gameLoadingProgress(<data>);


Does your extension have blocks that meet this need?

rob1221

  • *
  • Posts: 9448
That's done automatically with the ApplicationMain.hx template file included in the extension.

rodolfovs

  • *
  • Posts: 146
I imagined that the extension automatically would, but I thought I'd ask.

And another question, out of curiosity, in the SDK documents POKI says nothing about ad blocker. What use is indicated for this block? If the user has adblocker enabled is it to block the game or something?

rob1221

  • *
  • Posts: 9448
I think one of the code samples mentions ad block.  You could use that block to ask the player to disable ad block or you could use it to hide any rewarded ad buttons.  It's optional, but you should absolutely not use it to block the game.

rodolfovs

  • *
  • Posts: 146
I asked because some game sites do not open the game if you use adblocker.

But this block will be very useful to warn the user about the lock and offer benefits.

Thanks for the extension Rob!