Dev.to WebDev 🛠 Dev 👁 0 📖 10 min read

41 browser games, one canvas codebase: how we ship them to a dozen portals

We build HTML5 games on a plain JavaScript canvas — no engine, no plugins — and ship them through the Playgama Bridge SDK. This is what we actually learned building them, and where the costs turned out to be. Th

We build HTML5 games on a plain JavaScript canvas — no engine, no plugins — and
ship them through the Playgama Bridge SDK. This is what we actually learned
building them, and where the costs turned out to be.

The build is the easy part

A canvas game is a zip with an index.html. Ours are 0.6–3.8 MB. The portals
work to size budgets of 50 MB (MSN Games) and 30 MB (YouTube Playables), so
the headroom is what makes passing portal review possible at all.

<!-- index.html of a real build -->
<script src="https://bridge.playgama.com/v2/stable/playgama-bridge.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" />
<title>VERTIKA</title>

No bundler step worth mentioning, no asset pipeline, no engine version to
negotiate with anyone. The whole game is game.js plus a folder of sound files.

The bridge is the interesting part

The Bridge SDK is a thin layer over the platform — storage, ads, leaderboards,
achievements, social — and it is not an engine. It does not take over your
game loop, and it degrades gracefully when a capability is not available.

That matters more than it sounds. The same zip runs on our own sandbox and on
20+ partner portals, and on each of them the bridge exposes a different subset:

// what actually differs between portals, and why a thin layer beats a full SDK
const canSave = await bridge.storage.isAvailable?.();   // false on some portals
const lb = await bridge.leaderboards.submit("main", score); // no-op if unsupported

You write against the bridge once and the game works everywhere. Written by
hand, that would have been twenty adapters to maintain.

One caveat worth stating plainly: the bridge is loaded from a CDN, so a portal
that blocks third-party scripts will break the build. We check for
window.bridge before initialising and fall back to a no-op mode, which is why
the games still run when the bridge never arrives.

Distribution is a catalog problem, not a marketing problem

Once a game passes moderation into the Playgama catalog it syndicates out to
the partner portals on its own. The work is metadata — genre, supported
languages, orientation, cover art — because the catalog filters by it, and a
game that describes itself badly does not surface in the right slots.

This is the part that is easy to underestimate. We had working builds with
mediocre metadata, and the difference in impressions was not subtle.

Localisation is not optional

Our games ship in 14 languages. The partner requirements make that concrete:
VK and Playhop want Russian, most of the rest want English, and YouTube
Playables wants a build that works in both orientations.

The moment you add a second language you also have to handle text expansion.
German is roughly 30% longer than English, and a button that fit in English
will not fit in German. We do the layout work once and let the strings expand
rather than trying to squeeze them:

// layout maths that assumes the longest translation, not the average one
const label = t("pause");           // "Pause" / "Pausieren" / "Пауза"
el.style.minWidth = `${label.length * 0.62}rem`;  // ~0.62rem per glyph

The second thing that bites is that a canvas game has no text nodes at all —
every label is drawn by us. We keep a string table per language and re-render
on locale change, and we test the longest locale (German) rather than English.

Audio as files, not as a library

Sound is generated at build time and shipped as files, decoded by the browser's
own audio stack:

index.html
game.js
sfx/
  hit.ogg
  hit.webm
  ...

Two reasons. It keeps the bundle small — no audio library, no synthesis code
in the hot path. And it means the same audio behaves identically on every
portal, which matters when you are comparing retention numbers between them.
It also means there is no audio middleware to break on a portal that does not
like your WebAudio usage.

The honest part: retention is the hard problem

Portals filter on average playtime — MSN wants 300 seconds, YouTube Playables
wants eight minutes — and our shorter games fall short of those thresholds even
though the same games hold up fine in playtests.

Building the game and getting it seen are two different problems, and only one
of them is solved by making a better game. We spent a long time on the wrong
one.

What we would do differently

  • Ask about the portal's thresholds before tuning the game. We tuned for "feels good" and then discovered that the retention gate is a specific number of seconds.
  • Ship the metadata with the build, not after it. Cover art, genre and language list are part of the upload, not an afterthought.
  • Budget for the long tail of orientations. Half the ports want both landscape and portrait; the ones that only want landscape are the ones that let you skip the safe-area work.

Try them

Two examples, both run in the browser with no download:

The thing I keep going back and forth on is the 14-language requirement. It is
a lot of string work for games that are not primarily story-driven, and some of
the ports only care about one language. Has anyone here shipped a small game in
many languages, and was it worth it?

The games

All of them run in the browser, have a Russian + English interface (14 languages
in total) and work on a phone. Click a title to play — no download, no ads wall,
just a playable build.

Game What it is Play
Accretion Accretion is how astrophysics names the growth of worlds: dust sticks into meteors, meteors into comets, comets into planets. Drop dust, meteors and… play
AquaSort Pour coloured liquids between tubes until every colour collects in a single vessel. The rules take ten seconds to learn, and the levels never end —… play
BLADE 13: Crystal Quest BLADE 13: Crystal Quest is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Chameleon You are a chameleon on a tiled board. Step onto a colored tile and you take its color. A fly can only be eaten in exactly that color, and every step… play
Chromlins: Crystal Quest Chromlins: Crystal Quest is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
CHRONO ECHO An arena survivor built on a time loop, where every loop rewinds the arena and your path with it. The echo of where you just walked keeps hunting the… play
Collect Rainbow: Star Rush Collect Rainbow: Star Rush is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Cornelius Uni: Nova Rush Cornelius Uni: Nova Rush is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Crystal Stream Steer a living stream of sand with your finger and grow crystals. Pour clean veins of a single colour onto the crystal floor — a vein freezes into a… play
DR1LL3R: Zero G DR1LL3R: Zero G is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts instantly in… play
DYE HARD: Neon Run DYE HARD: Neon Run is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts instantly in… play
ECHO DRIFT A neon arcade survival game where the opponent is your own trail. Every few seconds an echo of your recent flight cuts across the arena, and it… play
ECHO RIFT A neon arena defence game where your own past shots come back to fight for you. The rift records where you aimed and turns that version of you into… play
ECHO WARDEN A time-loop arena where you defend a core while an echo of your own previous run fights beside you. The echo replays your steps and your shots… play
Errands Iris: Nova Rush Errands Iris: Nova Rush is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Gravity Forge Star cores fall from the sky and you never touch them — you bend the space around them. Place gravity nodes that curve the fall and steer every core… play
Gravity Goo The Fusion Lab: launch blobs of goo, steer them mid-flight with a gravity well, and fuse them together into new creatures. Sixteen levels of rising… play
GRAVITY WELL A three-dimensional arcade roguelite built around one mechanic: you devour waves of void creatures, and every devoured thing charges your singularity… play
HEAVO A 3D arcade game built around one unusual mechanic: tap to float, hold to slam. Swap your mass mid-run and you can clear sixty handcrafted procedural… play
Jellytris Tetris that melts. Pieces fall, touch the pile and melt into jelly beads: the beads flow into gaps, fill holes and spread down the slopes, so you… play
LUMI LUMI is a cozy one-touch night arcade. Guide a tiny firefly through the twilight forest: tap to flip gravity, collect light dew, dodge thorns, saws… play
MAGNETA A three-dimensional arcade game about a magnetic field, where you are the magnet and you can pull or push. Flip your polarity, gather charged orbs… play
Matryoshka Merge Drop matryoshka dolls into a wooden tray and merge the matching ones — two Buttons make a Little One, and two Empresses trigger a big salute. Chains… play
NEBOPAD A launcher sits under the observatory and asteroids hang above it. Drag from the launcher and release: a fan of comets flies up, bounces off the… play
Nechist A warrior holds off waves of folkloric evil in a dark clearing: he fights on his own while you lead him with a finger or WASD, gather experience… play
NEON REAPER A neon roguelike survival. You are in the abyss and the Devourers keep coming, wave after wave, faster every time. Your ship flies along the vector… play
ORBIT DRIFT Your comet orbits a planet. One tap breaks it away along the tangent, and the next planet catches it with its gravity ring. Every ten hops a new… play
Poopicorn: Pixel Rush Poopicorn: Pixel Rush is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts instantly… play
PRISMHOOF: Star Rush PRISMHOOF: Star Rush is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts instantly… play
PROBOY Aim, fire and keep the wall away. The cannon spits out a swarm of balls: you drag away from the cannon, an aim line appears, and on release the balls… play
PULSAR-9 An endless descent through a storm. The ship flies and shoots on its own — you only dodge rocks, drones, weavers, tanks, snipers and mines. Shards… play
RIFT Walls of neon bricks march down toward the pink rift line — knock them out with the ball and keep the siege off your paddle. Every cleared sector… play
ROTOR One button is the whole skill. Throw shards into a spinning rotor: charge the ring without hitting the shards already in it. Cores give a bonus and… play
Rush to: Crystal Quest Rush to: Crystal Quest is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Spectral Horn: Hyper Dash Spectral Horn: Hyper Dash is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Spectrum Sprites: Zero G Spectrum Sprites: Zero G is a tiny arcade game from the js13kGames competition — the whole game fits in a few kilobytes of code, and it starts… play
Stellar Shepherd A flock of glowing comets is your score. Lead them with the cursor: the gravity well pulls the swarm into a tight cluster and the Gate opens wider… play
TAIL BRAWL Collect fallen spirits and they grow into a living whip-tail that becomes your weapon and your armour. The longer the tail, the wider the swing: a… play
TANGENT The comet circles a planet. One tap and it breaks orbit, flying off along the tangent toward the next ring. Land in the ring for a point, skip the… play
Tower to the Moon One button, an endless tower. Place the blocks dead-centre: a perfect hit builds a combo and doubles your points, a miss cuts a corner off and the… play
VERTIKA One button, one tower. Place the slabs precisely: a miss makes the slab slide off and the tower lose its symmetry. Perfect drops widen the slab and… play

Every build is also on itch.io with a Play on Playgama link, and the whole
catalog sits on Playgama itself.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.