Low Flying Ducks started as an Android game: drag your tank along the bottom of the screen while ducks drop eggs, boots and exploding melons on you. It's written in Flutter with the Flame game engine, and both can target the web. "Can target" and "works on a game portal" are not the same thing, though. This is what we changed.
Step 1: find everything that only exists on a phone
A mobile game quietly depends on a lot of things a browser doesn't have. Going through the project, the list was:
- Google Play billing for coin packs and the club membership.
- Push notifications, used to tell you a friend invited you to a race.
- Nearby races, which find phones in the same room over Bluetooth and Wi-Fi.
- Opening web pages inside the app, which we use for the legal documents.
- Direct file and network access in a few places, such as loading sponsor images.
Most of the code already checked whether it was running on Android before using these. The rest got the same treatment. The web version simply has no store purchases, asks for no notification permission (a pop-up asking for notifications the moment a game loads would be a bad first impression), hides nearby races, and opens legal pages in a new browser tab.
Step 2: Firebase needs its own web app
Leaderboards, online races, cloud saves and anonymous sign-in all run on Firebase. On Android the app identifies itself with Android settings; a browser needs a separate "web app" registered in the same Firebase project, with its own app id and key. Those web keys are public by design. What protects the data is the database's security rules, which check every read and write, and those rules are the same for every platform. Once the web app was registered, the web build shared the same leaderboards and players as the phones.
Step 3: make it run from any folder
Game portals like itch.io host your game in a folder with an address you don't control, inside an iframe on their own page. A Flutter web build normally assumes it lives at the root of a website. Flutter only accepts an absolute starting path when building, so our build script builds with the default and then rewrites the page's base address to a relative one. Every file is then found next to the page, wherever the portal puts it.
We also bundle the rendering engine with the game instead of loading it from a public content network. That makes the download larger (about 18 MB zipped) but means the game doesn't depend on a third-party server being reachable from inside a portal's iframe.
Step 4: a portrait game on a landscape screen
On a phone the game fills a tall screen. On a desktop monitor, a portal shows a box of whatever size you choose. We picked 450 by 800 pixels, the same shape as a phone in portrait, so the playfield, the boss fights and the controls look exactly as designed, with a fullscreen button for anyone who wants it bigger. Dragging works with a mouse as well as a finger.
Step 5: zip it so Linux servers can read it
A small detail that costs people hours: the zip tool built into older versions of Windows PowerShell writes folder paths with backslashes. Game portals run on Linux and treat assets\image.png as a file name, not a folder, so the game loads to a black screen. Our build script writes the zip itself with forward slashes. One build command now produces a ready-to-upload archive.
Step 6: build it in the cloud
Finally, the web build runs automatically. When the game's code, assets or web files change, a cloud build compiles the browser version and pushes it to itch.io. Nobody has to remember to rebuild the web version after an Android update.
A version without ads
Some game portals don't allow games to show their own ads or sponsors, because the portal runs the ads itself. The same build script can make a version with the sponsor cards switched off at compile time, so the code that shows them isn't even running.
What players get
The browser version has the same nine worlds, bosses every third level, power-ups, difficulties and leaderboards as the Android game. Purchases, push invites and nearby races stay on Android. Everything else is one click away, with nothing to install.


