Making a Mini-game

Making a Mini-game

These guidelines are for anyone who builds a new mini-game for Rollick, by hand or with an AI assistant (ChatGPT, Claude, Gemini…). A mini-game that follows them:

  • passes the upload checks in the Rollick Studio,
  • runs inside the Rollick app on phones and tablets,
  • can be configured by any game designer and plugged into a task's success condition,
  • looks and behaves like the other mini-games in the Rollick library, so it can be shared there.

Starter Kit

Start from the starter template: a small, complete mini-game (tap the numbered tiles in order) that already does everything on this page. Replace its game, keep its plumbing.

DownloadWhat it is
rollick-mini-game-starter.zipEverything below in one zip: the guidelines and the starter template
rollick-mini-game-guidelines.mdThis page as one Markdown file, to attach to your AI assistant
index.htmlThe starter template's game: HTML, CSS and JavaScript in one file
rollick.jsonIts manifest, with every input and result field described
thumbnail.pngIts 512×512 library picture

Try it: open the template in English or in Greek. Use your browser's mobile view.

Working with an AI assistant? Download the starter kit, attach GUIDELINES.md, starter-template/index.html and starter-template/rollick.json to the chat, then paste the brief at the end of this page.

Rules marked MUST are checked or enforced by the platform: break them and the mini-game is refused, blocked or broken. Rules marked SHOULD are the house style of the Rollick library: an admin reviewing a shared mini-game expects them.

The 12 Rules at a Glance

  1. MUST be one folder with an index.html at its top, plus a rollick.json, zipped.
  2. MUST include every file it uses (scripts, fonts, images, sounds). Nothing is loaded from the internet unless its host is declared.
  3. MUST call window.rollick.onComplete(result) exactly once, when the game is over, with a small JSON object.
  4. SHOULD report the standard result fields: game, completed, success, score, maxScore (100), lang.
  5. MUST read its settings from window.rollick.input, and SHOULD fall back to URL query parameters and to sensible defaults when they are missing or wrong.
  6. SHOULD speak Greek and English, choosing from the lang input, then the language input, then Greek.
  7. SHOULD end with a popup that shows the outcome and a «Ολοκλήρωση αποστολής» / “Complete mission” button; tapping it sends the result.
  8. SHOULD fit a phone screen in portrait without the page scrolling, and follow the layout rules.
  9. MUST be touch-first: no keyboard, no mouse hover, no right click required.
  10. MUST NOT collect personal data, open other websites, show ads or track players.
  11. SHOULD keep the zip small (ideally under 5 MB) so it loads quickly on mobile data.
  12. MUST document every input and every result field in rollick.json, so other designers can use it without reading the code.

Package

my-mini-game/              ← folder name in kebab-case; also the `game` value in the result
├── index.html             ← the game (HTML, CSS and JS; one file is best)
├── rollick.json           ← the manifest: settings and library description
├── thumbnail.png          ← 512×512 picture for the library
└── (optional) assets: images, sounds, fonts, data

Limits checked on upload:

Limit
Zip50 MB, at most 2000 files and folders, at most 10 folders deep, paths up to 200 characters
Unpacked150 MB in all, 50 MB per file
Imagesat most 16384 px on a side
File typesthe ones listed in What a Mini-game May Contain
Refusedprograms, archives inside the zip, symbolic links, password-protected zips, a .well-known folder, text files not in UTF-8
  • Files whose names start with a dot (.DS_Store, .git/) are left out.
  • Use relative paths (img/sun.png, not /img/sun.png and not C:\…).
  • File names: lowercase, no spaces, no accents, no two names that differ only by upper/lower case.
  • Zip the folder that holds index.html: right-click → compress works.

The Manifest: rollick.json

Every field is optional for the upload, but the library needs them all. What a designer sets in the Studio wins over the file. Copy the starter template's rollick.json and edit it.

FieldWhat to putLimits
entry"index.html"an HTML file in the zip
allowedHosts[], unless the game must call a server: ["api.example.org"]https host names only, at most 5, no wildcards, no IPs, no Rollick hosts. Cannot change once the mini-game is shared
permissions[], or some of "camera", "microphone", "fullscreen"cannot change once shared
orientation"portrait" (recommended), "landscape" or "any"the app turns the screen for landscape
titleshort, catchy, in English200 characters
descriptionwhat the student does, how the game ends, what it teaches, which inputs change it, and the language sentence3000 characters
tagstopic, skill, mechanic, and "mobile"8 tags, 30 characters each, lowercase
creditsauthors, organisation, licences of third-party assets500 characters
languages["el-Gr", "en-Us"]only el-Gr, en-Us, or "none" for a game without text
languagethe default, one of languages: "el-Gr"
thumbnail"thumbnail.png"PNG, JPEG, GIF or WebP in the zip, at most 2 MB. Not SVG
inputsa list of name, description, example20 inputs; names are letters, digits and _, starting with a letter; description 300 characters
resulta description and a list of fields, each with name, type, description20 fields; type is number, string, boolean, object or array

Write descriptions for a game designer who will never read your code. End the description with:

The interface is in Greek or English: the game's language, unless the lang input sets one.

For each input, say its range, default, and what happens to bad values, for example:

Time limit in seconds (0–600, default 60). 0 means no time limit. The clock stops while a popup is open. Invalid values fall back to 60; values out of range are clamped.

Talking to Rollick

Rollick creates window.rollick before your page's scripts run: in the app, in the Studio preview, and on the Rollick server. When you open index.html straight from your disk it does not exist, and your game must still work.

const ROLLICK = window.rollick || null;
const INPUT = (ROLLICK && ROLLICK.input) || {};
const QS = new URLSearchParams(location.search); // fallback for local testing
 
// … at the very end, once:
if (ROLLICK && typeof ROLLICK.onComplete === 'function') ROLLICK.onComplete(result);
APIWhat it does
rollick.inputAn object with the task's settings (your inputs) and a few values Rollick always adds (below).
rollick.onComplete(result)Reports the result. Call it once. The app records it, evaluates the task's success condition and closes the mini-game straight away, so show your results screen before calling it. A second call is ignored.
rollick.close()Leaves without a result (optional; rarely needed).
rollick.environment"app", "preview" (Studio) or "browser". Do not change the game's behaviour based on it.

Values Rollick always puts in rollick.input:

NameMeaning
languageThe language to run in: el-Gr or en-Us
playerNameThe player's avatar name (may be empty)
userId, gameId, instanceIdIdentifiers. Do not show them, do not send them anywhere
⚠️

Do not declare inputs named userEmail, userId, gameId, instanceId or language (userEmail is refused). Use lang and playerName with the meaning they have in every other mini-game.

Inputs

Inputs let one mini-game serve many games: easier or harder, shorter or longer, a different topic.

  • Parse everything. Values may arrive as strings ("6", "true") or as numbers and booleans. Use Number(...), check isFinite, round integers.
  • Validate and clamp. Missing or invalid → the default. Out of range → the nearest allowed value. Never crash, never show NaN.
  • Booleans: "false", "0", "no", "off" mean false; anything else true.
  • Lists: comma-separated strings, e.g. topics=water,food,energy; ignore unknown items.
  • Every input is optional. With no inputs at all, the game must be playable and sensible.
  • Use the common names when they fit: seconds (time limit, 0 = none), tries (attempts), levels, rounds, difficulty (easy / medium / hard), hints, pass (score needed to succeed), lang, playerName.
  • Log the resolved values once at start, so a designer can debug in the Studio preview:
console.log('[my-mini-game] input params:', { rollickInput: INPUT, url: location.search, resolved: { seconds, tries, lang } });

The starter template has num(), bool() and text() helpers that do all of this.

Language

const LANG = /^en/i.test(String(INPUT.lang || INPUT.language || QS.get('lang') || 'el')) ? 'en' : 'el';
  • lang (set by the designer) wins over language (the game's language, set by Rollick); the default is Greek.
  • Keep all visible text in one dictionary per language (T.el, T.en); no text baked into images.
  • Greek is the first language of most players: write it natively, with correct accents and final sigma (ς), not as a word-by-word translation.
  • Set document.documentElement.lang.
  • Report the language used as lang: "el" or "en" in the result.

The Result

The result is how a game designer connects your mini-game to their game. In the task they write a success condition on it, such as success equals true or score greater than or equal 60, and may store it for later. Make it predictable.

Always send these fields:

FieldTypeMeaning
gamestringThe folder name, e.g. "mix-and-build"
completedbooleanAlways true (the game ran to its end)
successbooleanDid the player achieve the goal? Win → true; out of time or tries → false
scorenumber0–100, a whole number. Explain the formula in rollick.json. 0 on failure is the usual choice
maxScorenumberAlways 100
langstring"el" or "en"

Then add what is useful for this game: attempts or mistakes used, timeUsed (seconds, one decimal), timedOut, hints used, level reached, and the resolved inputs (e.g. seconds, tries) so the result explains itself.

  • Plain JSON only: numbers, strings, booleans, null, flat objects and arrays. No functions, dates, DOM elements or undefined.
  • Small: under 4 KB once serialised (a larger result is not stored), at most 8 levels deep, 50 keys per object, 100 items per array. Prefer a flat object.
  • Stable names: once published, do not rename or remove fields; other games' conditions depend on them. Add new ones instead.
  • No secrets and no personal data: never include answers, codes, the player's name, or anything typed by the player that could identify them.
  • Field names: camelCase, letters and digits only.
  • Log it before sending: console.log('[my-mini-game] result:', result).

Layout and Mobile

The mini-game runs full screen in a phone's web view, usually held in portrait, sometimes on a tablet.

Layout rules (all of Rollick's own mini-games follow them, and so does the starter template):

  • Portrait: content in one column of cards, at most 520 px wide, centred.
  • Landscape (any height): two cards side by side, both filling 100% of the screen height:
    • body { height: 100dvh }, .app { height: 100%; grid-template-rows: minmax(0, 1fr) };
    • each card has min-height: 0 and overflow: auto: it scrolls inside itself if needed. The page itself never scrolls;
    • the part that should grow (board, canvas, list) fills the leftover space of its card. Size canvases from their box (ResizeObserver, getBoundingClientRect), never from window.innerHeight;
    • an extra @media (orientation: landscape) and (max-height: 520px) block holds compact sizes for phones.
  • Use 100dvh, not 100vh (mobile browser bars).
  • Respect the notch: viewport-fit=cover and env(safe-area-inset-*) padding.
  • Check at 390×844 (phone portrait), 844×390 (phone landscape), 768×1024 and 1024×768 (tablet).

Touch:

  • Tap targets at least 44×44 px; primary buttons bigger.
  • Everything works with taps and drags. Use pointer events (pointerdown, pointermove, pointerup) so mouse and touch both work; set touch-action: none on dragged areas so the page does not scroll or zoom.
  • No hover-only information, no keyboard-only controls, no double-tap or long-press as the only way to do something.
  • Disable text selection and the tap highlight on the game area.
  • Use this viewport tag:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />

Look and feel:

  • Bold, high contrast, readable at arm's length: body text at least 16 px.
  • Respect prefers-reduced-motion.
  • Sound is optional, never required to play, and starts only after a tap (browsers block autoplay). Offer a mute button if you use it.

Game Flow

Every library mini-game follows the same shape, so players know what to do:

  1. Start popup: a greeting (with playerName if given), a one-paragraph “how to play”, and a «Ξεκίνα» / “Start” button. The clock starts only after it.
  2. Play: the goal and the status (time left, tries, score) are always visible. A help button that reopens the instructions is welcome.
  3. Clocks stop while any popup is open (help, fact cards, pause).
  4. End: win, or lose (time out, no tries left). Pause briefly (about half a second) so the last move is seen, then show the end popup: a clear outcome, the score, one encouraging sentence, and a «Ολοκλήρωση αποστολής» / “Complete mission” button.
  5. Complete mission → rollick.onComplete(result). The app then closes the mini-game.
  • Always reach an end. Every path (win, lose, give up) must lead to the end popup and a result. Never leave the player stuck.
  • Optional retries happen inside the game, before the result; once onComplete is called, the game is over.
  • Short sessions: 1–5 minutes with the default inputs.
  • Randomise boards and questions where it makes sense, but every generated puzzle must be solvable.
  • Be kind on failure: explain what went wrong and what the idea was. The player is learning.
  • Don't save progress between sessions: each launch is a fresh game.

The Sandbox: What Is Blocked

Rollick serves each mini-game from its own isolated address with a strict security policy. These are blocked:

BlockedWhat to do instead
Loading scripts, styles, fonts or images from the internet (CDNs, Google Fonts, unpkg…)Put the files in the zip. Use system fonts or include .woff2 files
Calling an APIDeclare its host in allowedHosts (https only); the game must still end gracefully when offline
<iframe>, embedded videos (YouTube…)Include short media files in the zip
Opening links, window.open, navigating to another siteDon't. Show the information inside the game
Service workers; Rollick's cookies and APINot available
Camera, microphone, fullscreen without declaring themAdd them to permissions, and provide a fallback (e.g. tap instead of blow) for when the player refuses or the device has none
Forms posting to other sitesNot available

Allowed: inline <script> and <style>, eval, WebAssembly, web workers, canvas, WebGL, Web Audio, and localStorage (but don't rely on it).

Libraries are fine (Phaser, PixiJS, Three.js, Matter.js…) as long as their files are inside the zip. For small games, plain HTML, CSS and JavaScript in one index.html is preferred: it is the easiest to review and fix.

Content, Privacy and Accessibility

  • Audience: children and teenagers in schools, and visitors in museums and cities. Content must be age-appropriate, accurate, inclusive, and free of violence, gambling mechanics and brand advertising.
  • Educational value: say in the description what it teaches. Facts shown in the game must be correct and, where possible, sourced in credits.
  • Privacy: collect nothing. No analytics, trackers, ads, external fonts or pixels. Don't ask for names, emails or photos; don't upload camera or microphone data anywhere.
  • Original or licensed assets only. Credit third-party art, sounds and fonts, and their licences, in credits. Do not copy characters, art, music or levels from existing commercial games.
  • Accessibility: good colour contrast; never use colour alone to carry meaning (add a shape, number or label); readable fonts; aria-label on icon-only buttons; nothing that flashes more than 3 times per second.

Performance

  • The app waits about 8 seconds for a page to load (longer for big mini-games, up to 60 s). Aim for under 5 MB and a first screen in under 2 seconds on a mid-range phone.
  • Compress images (WebP, sensible sizes: a 4000 px photo for a 400 px card is waste). Use .mp3 or .ogg for sound.
  • Keep animation at 60 fps on a mid-range phone; stop requestAnimationFrame loops when the game ends.
  • Release the camera and microphone when done (track.stop()).

Testing Checklist

Before uploading, open index.html in a desktop browser with the developer tools' device toolbar (mobile view), and check that:

  • it opens with no query parameters, in Greek, and is playable;
  • ?lang=en switches every text to English: no Greek left, no text cut off;
  • each input changes the game as described, and nonsense values (?seconds=abc, ?tries=-5) fall back to defaults without errors;
  • the win path and every lose path reach the end popup, and “Complete mission” logs the result once (tap it twice: still once);
  • the result matches rollick.json's result.fields, has game, completed, success, score, maxScore and lang, and is under 4 KB;
  • there are no errors in the console, and no requests to other sites in the Network tab;
  • in portrait 390×844 and landscape 844×390 nothing is cut off, the page does not scroll, and every button is reachable;
  • it works with touch only (turn on touch simulation);
  • the clock stops while popups are open;
  • rollick.json is valid JSON, and every input and result field is documented;
  • thumbnail.png is 512×512, bold, readable at 64 px, and has no text.

Then, in the Rollick Studio, upload the zip to your game, open the preview, check the console and the result it shows, and finally play it inside the Rollick app on a real phone.

Submitting to the Library

  1. Zip the folder.
  2. In the Studio, upload it to your game (Game Library → Mini-games → This game). Fix every error the upload report lists, and read the warnings.
  3. Use it in an interactive External Task of your game and test it in the app.
  4. Share it to the library. An admin reviews it before it appears in the Rollick library.
⚠️

Once other games use a shared mini-game, its files, allowed hosts and permissions are fixed: a new version is a new upload. Get the inputs and the result right before sharing.

Brief for Your AI Assistant

Copy everything in the box below into your AI assistant, attach GUIDELINES.md, starter-template/index.html and starter-template/rollick.json from the starter kit, and replace the parts in <…>.

You are building a mini-game for the Rollick platform, an educational location-based game
platform. The mini-game runs inside the Rollick mobile app (a WebView) on phones and tablets.

GAME IDEA
- Name (kebab-case folder name): <my-mini-game>
- Topic and learning goal: <e.g. the water cycle, for students aged 10–14>
- What the player does: <core mechanic in 2–3 sentences>
- How it is won and how it is lost: <…>
- Settings a designer should be able to change (inputs): <e.g. seconds, tries, difficulty>

HARD REQUIREMENTS (follow the attached GUIDELINES.md exactly)
1. Start from the attached starter-template: keep its structure for input parsing (num/bool/text
   helpers with defaults and clamping), language selection, start popup, end popup, layout CSS
   and the single rollick.onComplete call. Replace only the game itself.
2. Output exactly two files: a self-contained index.html (all HTML, CSS and JS inline, no external
   URLs, no CDNs, no web fonts, no iframes, no links out) and rollick.json.
3. Read settings from window.rollick.input, falling back to URL query parameters, then defaults.
   Every input is optional. Values may be strings: parse, validate and clamp them.
4. Language: lang input, else language input, else Greek. Values starting with "en" select
   English. All visible text in a T.el / T.en dictionary. Write natural, correct Greek.
5. Flow: start popup with greeting (playerName) and how-to-play → play (clock starts after
   Start, pauses while popups are open) → end popup with outcome and score and a
   «Ολοκλήρωση αποστολής» / "Complete mission" button → that button calls
   window.rollick.onComplete(result) exactly once (guard against double taps; skip if
   window.rollick is missing). Every path must end there.
6. Result: a flat, JSON-safe object under 4 KB with game (= folder name), completed (true),
   success (boolean), score (integer 0–100), maxScore (100), lang ("el"|"en"), plus useful
   stats (attempts, timeUsed, timedOut…) and the resolved inputs. No answers or personal data.
7. Mobile-first: portrait one column max 520px; landscape two cards side by side at 100dvh,
   cards scroll inside, page never scrolls; compact block for landscape max-height 520px.
   Touch only (pointer events), targets ≥ 44px, safe-area insets, prefers-reduced-motion.
8. Log "[<my-mini-game>] input params:" at start and "[<my-mini-game>] result:" at the end.
9. Any generated puzzle must be solvable. Default inputs give a 1–5 minute session.
10. rollick.json: copy the template's shape; describe every input (range, default, fallback)
    and every result field (type and meaning, including the score formula). Languages
    ["el-Gr","en-Us"], default "el-Gr", orientation "portrait", thumbnail "thumbnail.png",
    empty allowedHosts and permissions unless the idea needs camera/microphone (then add a
    touch fallback).

When done, list how to test it locally with example query parameters, e.g.
<my-mini-game>/index.html?seconds=60&tries=3&lang=en

After the assistant answers, go through the testing checklist yourself. AI assistants often forget the double-tap guard on “Complete mission”, pausing the clock in popups, clamping inputs, the landscape layout, and Greek accents.