🧰 Game SDK
window.BRB
Every game gets a small helper called BRB. BRB.storage.get(key) and BRB.storage.set(key, value) save progress for each player. localStorage also works and is saved to the cloud.
BRB.score.submit(score) adds to the leaderboard (best score only). BRB.gameOver({won, score}) ends a round.
BRB.fx.confetti(), BRB.fx.shake(el), BRB.fx.flash(), BRB.sfx.play("jump"|"hit"|"win"|"lose"|"coin"), BRB.fx.tween(), BRB.fx.fit(canvas, w, h) add juice.
BRB.fullscreen() and BRB.orientation("landscape") ask the page politely.
BRB.user.lang is the player's language (like "fr" or "ar") and BRB.user.dir is "rtl" for right-to-left languages, so a game can speak the player's language.
Rules
Games cannot use the internet, cookies, forms, pop-ups or links. Fonts from Google Fonts and libraries from cdnjs are allowed. Keep each game under 2 MB.