Pixlland

Engine guide

Construct 3

Drag-and-drop, pure HTML5 output

Construct 3 exports pure HTML5 and lets you mix visual event-sheets with JavaScript. Integrate the SDK via a small script module + a Call expression action from your event sheets.

1. Include the SDK

In Project → Files → Add File → Create script, name it pixlland.js, and include the SDK from Pixlland. In Project → Export → HTML5 → Inject into head add:

<script src="https://pixlland.com/sdk/v1/pixlland.js" defer></script>

2. Helper script

// pixlland.js — Construct 3 project script
runOnStartup(async (runtime) => {
  if (!window.PixllandSDK) return;
  await window.PixllandSDK.init();
  window.PixllandSDK.gameLoadingFinished();
});

export function gameplayStart() {
  window.PixllandSDK && window.PixllandSDK.gameplayStart();
}
export function gameplayStop() {
  window.PixllandSDK && window.PixllandSDK.gameplayStop();
}
export async function commercialBreak() {
  if (!window.PixllandSDK) return;
  await window.PixllandSDK.commercialBreak();
}
export function happyTime(dt) {
  window.PixllandSDK && window.PixllandSDK.happyTime(dt);
}

3. Event-sheet wiring

In a System / On start of layout event use System → Call expression gameplayStart(). For every tick (On tick event), call happyTime(dt) where dt is dt (Construct's built-in delta in seconds).

4. Ad break between levels

// From a "On level complete" event → Call async expression:
await commercialBreak();
// Then: System → Go to layout → <next level>

Common pitfalls

  • Scirra services in stub mode. Construct's own leaderboards / cloud save must be disabled — they call domains our iframe sandbox doesn't whitelist. Use Pixlland's data API instead.
  • Minify script. Leave it on — shrinks the bundle, and Construct already guards script names the SDK references.
Construct 3 · Pixlland Engines