naughty.games
Play All games
Live Cams
Home Browse Random Live Saved
Left on Read 2 is out. New accounts get 100 free credits until Dec 6. See how →
Home / Guides

How to export your Construct 3 game for the web

Open Project > Export, choose Web (HTML5), and turn on Deduplicate images, Optimize images and Minify script for a smaller download. Turn the Offline support checkbox off: it is on by default and installs a service worker, and naughty.games does not allow hosted builds to register service workers. Test the exported files on a local server, then zip them with index.html at the top and upload.

Last checked 2026-10-04

Add in-game ads to your Construct 3 game: copy this prompt

Paste it into Claude Code, Cursor, Copilot or any coding agent. It adds the SDK to your project and tests it.

Preview the prompt
Goal: integrate the naughty.games in-game ads SDK (lifecycle and ad breaks only) into this Construct 3 project.

Setup:
1. Download https://naughty.games/sdk/wrappers/construct3/naughty-games-sdk.js, add it to the project's Scripts folder and set its Purpose to Main script.
2. Set Project Properties > Advanced > Use worker to No, and export with Minify script set to None or Simple.
3. In an event sheet, define the functions NgBreakDone, NgRewardDone (number parameter: 1 = watched to the end, 0 = not), NgMute and NgUnmute (silence and restore audio). Optionally NgPause and NgResume for logic the time scale does not stop.
4. From a Run script action call ngGameLoadingFinished(), ngCommercialBreak() (continue in NgBreakDone) and ngRewardedBreak() (reward in NgRewardDone). A second call while one is running is answered at once (NgBreakDone, or NgRewardDone with 0). The wrapper sets the time scale to 0 during ads and restores it.
5. After EACH Web export, add this tag inside <head> of the exported index.html, before Construct's own scripts (re-add it every time, or script the step):
   <script src="https://naughty.games/sdk/v1.js"></script>

API (global NgSdk, added by the script tag; the engine wrappers call these for you):
- NgSdk.init(): Promise of { env, signedIn, locale }. Call it first. env is naughty, local (test mode) or inert; signedIn is whether the player is signed in to naughty.games.
- NgSdk.gameLoadingFinished(): the game finished loading.
- NgSdk.gameplayStart() / NgSdk.gameplayStop(): active play starts or stops (menu, pause screen, game over).
- NgSdk.commercialBreak(): Promise of nothing. Shows an ad if one is due.
- NgSdk.rewardedBreak(): Promise of true or false. true only when the player watched the ad to the end.
- NgSdk.on('pause' | 'resume' | 'mute' | 'unmute', fn): fired around every ad.

Rules:
- The SDK only works in games hosted on naughty.games (an uploaded zip build). A game embedded from itch.io or another site runs in a third-party frame, so the SDK stays inert there and shows no ads.
- Every call settles, and the game must carry on once it does. A commercial break may finish at once (no ad, or too soon), so never wait for an ad to appear.
- Grant a reward only when rewardedBreak() resolves true. Not on the button tap, not when the promise settles.
- On pause and mute, stop the game loop and silence audio; restore both on resume and unmute. Keep the handlers quick, they can arrive back to back.
- Place commercial breaks at natural pauses (between levels, after game over), never mid-action or mid-dialogue, and not at startup.
- Put rewarded breaks behind a button the player chooses to tap, and say what the reward is first. Never block progress behind one: on false the player keeps playing.

Verify:
- Run the game from localhost, or add ?ngsdk=test to its address. A test ad covers the game with Complete and Skip buttons. Check both paths: Complete must grant the reward, Skip must not, and the game must continue after each. Left alone, the test ad closes itself after 5 seconds and a rewarded break resolves false: only Complete grants.
- Zip the build with index.html at the top level and upload it. The Build tab in the naughty.games developer console shows "SDK detected" when an HTML file in the build loads https://naughty.games/sdk/v1.js with a script tag, or an uncompressed .js file names that URL in its code.

Ask me before changing any gameplay. If anything is unclear, read the full guide at https://naughty.games/guides/in-game-ads-sdk before guessing.

What you need

  • A Construct 3 project, in the browser-based editor or the desktop app. There is no separate SDK to install: Construct compiles your project in the cloud when you export.
  • An internet connection while you export. Construct's script minifier runs as a cloud service, so exporting with Minify script on needs you to be online, even if you built the whole game offline.

Your build runs inside an iframe on naughty.games, behind the site's own age gate, so nothing extra is needed inside the project for that.

Export for the web

  1. Open the Export dialog. From the main menu, choose Project > Export.
  2. Choose Web (HTML5). Construct also exports to Android, iOS and desktop wrappers from the same dialog; pick Web (HTML5) for naughty.games.
  3. Turn on the shared optimisation options. Enable Deduplicate images, Optimize images, and Minify script in Advanced mode. These make exporting take a little longer but produce a smaller, harder to copy build, and Construct's own documentation recommends leaving them on for a finished release, only turning them off to speed up a quick test export.
  4. Turn off Offline support. The web export has a separate Offline support checkbox, on by default. See the box below for why to turn it off before uploading to naughty.games.
  5. Export. Click Export and wait for Construct to compile the project and hand you a zip to download.

Why to turn off Offline support

Construct's Offline support option is on by default for web exports. Once a player has loaded the game once, it keeps working without an internet connection by installing a service worker that caches the build in the browser. That is a good feature on your own site, but naughty.games does not allow hosted builds to register a service worker at all: a request to install one is refused outright. Leaving Offline support on will not break your upload, but the service worker registration will fail in every player's browser and log an error. Turn the checkbox off so the build does not try.

Construct's Export Manager keeps track of your last few exports, so if you need to grab the same zip again later, or compare a new export against the one you already uploaded, you do not have to export from scratch. It is worth checking there before re-exporting a large project just to re-download a build.

Test it locally

Opening the exported index.html straight from your file system will not work reliably: Construct's HTML5 export loads its scripts and assets in ways that browsers restrict on file:// pages, the same restriction that affects every other engine's web export.

Serve the exported files over HTTP instead. From inside the unzipped export folder, run:

python -m http.server 8000

Then open http://localhost:8000 and play through the game before you upload it anywhere.

Zip it for upload

  • Construct's own export zip already places index.html at the top level, so in most cases you can upload the zip Construct gave you without repacking it.
  • If you unzip it to make manual changes, keep index.html at the top when you re-zip. A build with index.html nested inside a subfolder will not be recognized.
  • Stay under 250 MB unpacked and 2,000 files. Construct projects usually stay well under this unless you are shipping a lot of full-resolution video or voice audio; Optimize images and a lossy image format for background art help if you are getting close.

Common problems

  1. The browser console shows a service worker registration error. Offline support was left on. The game still runs, but turn Offline support off and export again for a clean build.
  2. The export fails partway through or times out. Minify script depends on a cloud service, so a dropped connection mid-export can fail it. Just export again once you are back online.
  3. A scripted (JavaScript) feature works in preview but breaks only in the exported build. Advanced minification renamed something your script relied on. Switch Minify script to Simple mode, or check the Construct documentation's guide to advanced minification for how to keep specific names.
  4. The zip is too big to upload. Turn on Optimize images and pick a lossy format for background art or photos, and enable Deduplicate images if the same artwork appears in more than one object.
  5. No sound plays until the player interacts. Browsers block autoplaying audio until a click or tap. This is expected, not a bug in your project.

Add in-game ads (optional)

A build hosted on naughty.games can show ads between levels and rewarded ads ("watch an ad for a bonus") through the naughty.games SDK. For Construct 3, add naughty-games-sdk.js as a main script and add the SDK's script tag to the exported index.html. The in-game ads guide covers the setup, a test mode that runs on localhost, and how the revenue share works.

Publish it

Once the export runs cleanly from a local server with Offline support turned off, zip it with index.html at the top level (up to 250 MB unpacked and 2,000 files) and upload it to naughty.games, or send us an https URL if you would rather embed it. Review is usually about 2 working days, listing is free and non-exclusive, and any Patreon, Ko-fi, Steam or itch links inside the game earn you 100% of what they bring in. Head to /submit when you are ready.

Questions

Which Construct version does this guide use?
Construct 3 is a continuously updated web app rather than a versioned install, so there is no fixed version number. The export steps and options in this guide match its current release.
Should I leave Minify script turned on?
Yes for a real upload. Advanced mode shrinks the download and makes the code harder to copy. Only switch to Simple mode if minifying breaks custom JavaScript you added with the scripting feature.
Why does naughty.games ask me to turn off Offline support?
Offline support works through a service worker, and naughty.games blocks service workers on hosted builds so that a takedown or an update always reaches every player right away.
Can I still upload the same build to itch.io or the Scirra Arcade?
Yes. Exporting a Web (HTML5) build for naughty.games does not use up or block any other export, so you can upload the same zip anywhere else you already publish.
Do player saves work in the browser?
Yes. Construct's save and local storage features write to the browser's own storage, so progress stays on that browser and device.

Sources

  • Construct 3 documentation: Publishing projects

Free hosting, real players on phone and desktop, and a stats console.

Publish your Construct 3 game on naughty.games

More guides

  • Where to publish your adult game

    itch.io, Steam, Patreon, SubscribeStar, Nutaku, DLsite and naughty.games compared for adult games: content rules, fees, browser play and the 2025 delistings.

  • How to make money from your adult game

    Patreon, SubscribeStar, Ko-fi, Steam, itch.io, DLsite and Nutaku for adult games: fees, payouts and rules as of September 2026, plus what drives pledges.

  • Payment processors and adult games: what each platform allows

    Adult content rules and payouts on Patreon, SubscribeStar, Ko-fi, itch.io, Steam and DLsite, and where the 2025 payment processor crackdown stands in 2026.

  • How to add in-game ads to your HTML5 game with the naughty.games SDK

    Add the naughty.games SDK to a hosted HTML5, Unity, Godot, Ren'Py, Construct 3 or GameMaker game: commercial breaks, rewarded ads, test mode and revenue share.

  • How to put your Ren'Py game in the browser

    How to export a Ren'Py visual novel for the web, test it on a local server, zip it correctly, and publish it so players can play in the browser.

  • How to export your Unity game to WebGL for the browser

    How to build a Unity WebGL player, set compression correctly, test it locally, zip it, and publish it so players can play in the browser.

  • How to export your Godot game for the web

    How to export a Godot 4 project to HTML5, why single-threaded export is the safe choice, test it locally, zip it, and publish it to naughty.games.

Browse

  • Play online
  • Live cams
  • All games
  • Tags
  • Platforms
  • Best of
  • Privacy
  • Terms
  • Terms of sale
  • DMCA
  • 2257
  • DSA
  • Advertise
  • No ads
  • For developers
  • Guides
  • Data reports
  • Contact
© 2026 naughty.games Adult content. 18+.

Adult content ahead

naughty.games contains adult-oriented game listings. By entering, you confirm you are at least 18 years old and that adult content is legal in your jurisdiction.

What do you want to see?

You can change this anytime

Nothing selected = show me everything