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
- Open Project > Bundle > HTML5 Application
- Choose a destination folder (e.g.
dist/) - The output includes
index.html,dmloader.js, your.wasmbinary, and game archives
Option B — bob.jar (command-line)
Download bob.jar from the Defold releases and run:
java -jar bob.jar \
--platform js-web \
--architectures 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 bridge via html5.run
Defold exposes html5.run() to call JavaScript from Lua. Create a small module (e.g. main/wavedash.lua) that wraps the Wavedash JS calls:
local M = {}
local function run(code)
if html5 then html5.run(code) end
end
function M.init()
run("window.WavedashJS && window.WavedashJS.init()")
end
function M.update_load_progress(fraction)
run("window.WavedashJS && window.WavedashJS.updateLoadProgressZeroToOne(" .. tostring(fraction) .. ")")
end
return M
The run helper guards once for the whole module, so the game still works in non-HTML5 contexts (desktop, editor playtest) without checking on every call.
Initialization
Require the module in your game script. Call update_load_progress(1) to fill the progress bar, then init() which signals load completion and dismisses the Wavedash loading screen:
local wavedash = require("main.wavedash")
function init(self)
-- ... set up your game ...
wavedash.update_load_progress(1)
wavedash.init()
end
Call update_load_progress(...) with intermediate values during async asset loading. init() automatically signals load completion, so call it last.
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.