Search documentation

Find pages, sections, and content across all docs.

WavedashDocs

Defold

Defold's built-in HTML5 bundle runs on Wavedash with no extra tooling.

View example project on GitHub Playtest the example project

Defold exports to HTML5, producing a folder with index.html, a .wasm file, and your game data. This output works on Wavedash directly.

Export your game

Option A — Defold Editor

  1. Open Project > Bundle > HTML5 Application
  2. Choose a destination folder (e.g. dist/)
  3. The output includes index.html, dmloader.js, your .wasm binary, and game archives

Option B — bob.jar (command-line)

Download bob.jar from the Defold releases and run:

java -jar bob.jar \
  --platform wasm-web \
  --archive \
  --bundle-output bundle \
  resolve build bundle

Then copy the output into your upload directory (e.g. dist/). The example-defold repo includes a build.sh that does this automatically.

SDK integration

Defold has a full integration with the Wavedash SDK, including Lua to JS bindings for easy scripting access to all of the Wavedash SDK functionality.

Open your Defold game.project file in the Defold Editor, select Project from the side menu, and in the Dependencies field add a new entry linking to a Wavedash SDK for Defold release on GitHub. As an example, here's the link to the 1.0.0 release of the Wavedash SDK for Defold:

https://github.com/wvdsh/sdk-defold/archive/refs/tags/1.0.0.zip

When the Wavedash SDK has been added as a project dependency all of the SDK functionality can be accessed from the wavedash module namespace.

Calling wavedash.init() is required. Your game stays hidden behind the Wavedash loading screen until you do. Call it once your game is ready to play.

function init(self)
    wavedash.init({}, function(_, event, payload)
        -- handle wavedash events here
    end)
end

Initialization

Loading progress will be automatically updated as your game loads and will be at 100% when the Defold engine initializes and is ready to show your game content. Call wavedash.init() to dismiss the Wavedash loading screen:

function init(self)
    -- ... set up your game ...
    wavedash.init({}, function(_, event, payload)
        -- handle wavedash events here
    end)
end

Configure wavedash.toml

Point upload_dir at the folder you bundled the HTML5 build to. Defold's bundle already includes index.html at the root, so entrypoint can be omitted.

game_id = "YOUR_GAME_ID_HERE"
upload_dir = "./dist"

Defold reserves the top-level build/ directory for its internal build cache. Use a different name like dist/ for your upload directory.