Web
Download the Lua bundle for web and unzip it. Three files are the
runtime, and data/main.lua is your game:
my_game/
├── data/
│ └── main.lua
├── natiny.html
├── natiny.js
└── natiny.wasm
Serve the folder over HTTP and open natiny.html. Any static server does:
python -m http.server 8000
Then go to http://localhost:8000/natiny.html.
It has to be HTTP. Opening the .html from file:// fails: a page cannot
fetch its own files that way, and data/main.lua is fetched rather than read.
The window becomes the page's canvas, so natiny.window.create gives you the
canvas rather than a new window. Everything else in the script is the same
code that runs on a desktop.
WebGPU is the only backend here. It needs a current Chrome, Edge or Safari; Firefox is still behind a flag at the time of writing.