diff --git a/README.md b/README.md
index 398116d..93e87e6 100644
--- a/README.md
+++ b/README.md
@@ -160,6 +160,7 @@ Playing never needs an account. In the online edition, an account unlocks Play T
- **The username is private:** it's only for logging in. Other players only ever see your picked colour-and-animal name.
- **Passwords are hashed** (scrypt), and logins are kept in secure, HttpOnly cookies.
- **Delete your account any time** from the account screen. It's removed straight away, and your worlds on the device stay.
+- **Signing up:** players agree to the [Terms of Use](terms.html) and [Privacy Policy](privacy.html), and the version they agreed to is recorded. The game asks for a birth year only to decide whether a grown-up must help. The year never leaves the device, and players under 13 need a parent or guardian to confirm.
- Kids: ask a grown-up to help you make one.
## ⚔️ Adventure mode (for older players)
diff --git a/ROADMAP.md b/ROADMAP.md
index 6734ac6..fd1fe23 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -106,6 +106,8 @@ The game stays public on our own site, and the GitHub Pages copy is retired late
- [x] The relay only accepts our own site
- [x] **Accounts** (register / log in / log out / delete) with our own Postgres database: a private username and a password only. Playing the game needs no account.
- [x] Play Together requires a login (the relay checks it)
+- [x] Privacy Policy and Terms of Use pages; sign-up records agreement, with a grown-up step for under-13s
+- [ ] Optional parent email for verifiable parental consent, if legal review asks for it
- [ ] Cloud saves across devices; classroom mode and a teacher dashboard
## ⚔️ Adventure track (opt-in, for older players)
diff --git a/index.html b/index.html
index fd6e242..f0a77e2 100644
--- a/index.html
+++ b/index.html
@@ -151,6 +151,7 @@
MiniCrafter
Touch: left stick walks, drag to look, tap to place or flip, hold to mine or attack. Holding a bow or shield? Hold to draw or block.
Your world is saved automatically in this browser.
🛡️ Make up a username, don't use your real name. Your username is private: other players only see your colour-and-animal name. We don't ask for an email address or anything else about you. Kids: ask a grown-up to help you.
+
🛡️ Make up a username, don't use your real name. Your username is private: other players only see your colour-and-animal name. We don't ask for an email address or anything else about you. Kids: ask a grown-up to help you. Privacy · Terms
Version 2026-11-10 · Last updated 10 November 2026
+
+
+
🧒 The short version (for kids)
+
+
We don't know who you are. We never ask for your real name, email, address, phone number, school or photos.
+
Your worlds stay on your device unless you choose to play online.
+
If you make an account, we keep only a made-up username and your password (scrambled so nobody can read it). Never use your real name as your username!
+
No ads, no tracking, nothing to buy. We never sell anything about you.
+
In Play Together other players only see a colour-and-animal name like "Blue Fox". There's no chat, just emoji.
+
You can delete your account any time, and it's gone straight away.
+
Under 13? Ask a grown-up to help you make an account.
+
+
+
+
1. Who we are
+
MiniCrafter is made by Dynamic Web Lab FZE LLC, a Free Zone Establishment licensed by Sharjah Publishing City Free Zone Authority (License No. 4426361.01), Business Centre, Sharjah Publishing City Free Zone, Sharjah, United Arab Emirates. We are responsible for the information described here.
Free edition and playing without an account: everything happens in your browser. We receive nothing about you or your game.
+
Online edition with an account: adds features that need our server, such as Play Together. Only then do we keep the small amount of information below.
+
+
+
3. What is stored on your device
+
The game saves these in your browser's storage on your device, so it can work offline. We can't see them.
+
+
Your worlds, quest stars, settings and hotbar.
+
Your Play Together colour-and-animal name.
+
For Adventure mode, a note that the grown-up check was passed, which is cleared when the browser is closed.
+
A copy of the game's files, so it works without internet.
+
+
You can remove all of this by clearing the site's data in your browser settings.
+
+
4. What we keep if you make an account
+
+
Information
Why
How long
+
Your username (private, never shown to other players)
So you can log in
Until you delete your account
+
Your password, stored only as a scrambled "hash" (scrypt) that can't be turned back into the password
To check it's really you
Until you delete your account
+
Login sessions: a random code in a secure cookie on your device, and a scrambled copy on our server
To keep you logged in
30 days, or until you log out
+
When your account was made and last used
To keep the service working and safe
Until you delete your account
+
That you agreed to these rules, which version, when, and (for players under 13) that a grown-up confirmed
To show the right people agreed
Until you delete your account
+
+
We don't keep your birth year. We ask for it when you sign up only to decide whether a grown-up needs to help, and then we throw it away.
+
We do not collect: email addresses, real names, birthdays, addresses, phone numbers, photos, voice, location, contacts, or anything for advertising.
+
+
5. Play Together
+
+
Players connect through our server, never directly to each other, so your internet address isn't shared with other players.
+
Rooms exist only while the game is running. We don't record or store what happens in a room.
+
Other players see only your colour-and-animal name, your character and the emoji you send. Your username stays private.
+
The host lets each player in and can remove players.
+
+
+
6. Keeping things safe
+
+
To stop people guessing passwords or flooding the service, our server briefly remembers internet addresses in memory only, for up to one hour. They are never written to disk.
+
We switch off request logs for the game. Technical error logs may briefly contain an internet address while we fix a problem.
+
Our account database is backed up every night in encrypted cloud storage. Backups are kept for up to 30 days, so a deleted account fully disappears from backups within 30 days.
+
+
+
7. Services that help us run MiniCrafter
+
We don't sell or share your information for advertising, ever. These providers process data only to run the service for us:
+
+
Cloudflare delivers the website and protects it from attacks. It handles internet addresses and may set a short-lived security cookie.
+
Our hosting provider runs the servers where the game and accounts live.
+
Microsoft Azure stores our encrypted nightly backups.
+
GitHub hosts the free edition, if you play that version.
+
+
These providers may be located outside your country. We use them with protections required by law.
+
+
8. Children
+
+
MiniCrafter is made for children, so we collect as little as possible and never use anything for advertising or profiling.
+
Players under 13 can make an account only with a parent or guardian, who confirms when the account is made.
+
Grown-ups can ask us to see or delete a child's account at info@dynamicweblab.com. Please include the username.
+
+
+
9. Your rights
+
+
Delete: open the 👤 account screen in the game, choose "Delete my account" and enter your password. Your account, sessions and agreement record are deleted straight away.
+
See, correct or ask questions: email info@dynamicweblab.com. Depending on where you live (for example the UAE, the EU, the UK or the US), you may have more rights. We'll help with all of them.
+
You can also complain to your local data protection authority.
+
+
+
10. Changes
+
If we change this policy, we'll update the date at the top. If a change is important, we'll show a notice in the game before it applies.
+
+
+
diff --git a/server/accounts.mjs b/server/accounts.mjs
index 48e7a80..5313d0e 100644
--- a/server/accounts.mjs
+++ b/server/accounts.mjs
@@ -6,6 +6,8 @@
// picked colour-and-animal name from Play Together.
// - Passwords are hashed with scrypt; sessions are random tokens stored only as SHA-256 hashes,
// sent as HttpOnly, Secure, SameSite=Lax cookies.
+// - At sign-up the player agrees to the Terms / Privacy Policy (version recorded), and players
+// under 13 need a grown-up to confirm. The birth year itself never reaches the server.
// - Deleting an account deletes everything about it straight away.
//
// Storage: Postgres when DATABASE_URL is set (production), otherwise in memory (development, tests).
@@ -20,6 +22,8 @@ const SESSION_DAYS = 30;
const MAX_BODY = 4096;
const USERNAME = /^[a-z0-9_]{3,20}$/;
const COOKIE = 'mc_session';
+/** Must match TERMS_VERSION in src/account.js and the version on privacy.html / terms.html. */
+export const TERMS_VERSION = '2026-11-10';
// ---------- passwords ----------
const SCRYPT = { N: 16384, r: 8, p: 1, maxmem: 64 * 1024 * 1024 };
@@ -40,9 +44,9 @@ const sha = (t) => crypto.createHash('sha256').update(t).digest('hex');
export class MemoryStore {
constructor() { this.users = new Map(); this.byName = new Map(); this.sessions = new Map(); this.next = 1; }
async init() {}
- async createUser(username, hash) {
+ async createUser(username, hash, consent = {}) {
if (this.byName.has(username)) return null;
- const u = { id: this.next++, username, pass_hash: hash, created_at: new Date() };
+ const u = { id: this.next++, username, pass_hash: hash, created_at: new Date(), terms_version: consent.terms || null, agreed_at: new Date(), grownup_confirmed: !!consent.grownup };
this.users.set(u.id, u); this.byName.set(username, u);
return u;
}
@@ -81,11 +85,17 @@ export class PgStore {
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
expires_at TIMESTAMPTZ NOT NULL
);
- CREATE INDEX IF NOT EXISTS sessions_user ON sessions(user_id);`);
+ CREATE INDEX IF NOT EXISTS sessions_user ON sessions(user_id);
+ -- Consent record: which Terms / Privacy Policy version was agreed, when, and (under 13) that a grown-up confirmed.
+ ALTER TABLE users ADD COLUMN IF NOT EXISTS terms_version TEXT;
+ ALTER TABLE users ADD COLUMN IF NOT EXISTS agreed_at TIMESTAMPTZ;
+ ALTER TABLE users ADD COLUMN IF NOT EXISTS grownup_confirmed BOOLEAN NOT NULL DEFAULT false;`);
setInterval(() => this.pool.query('DELETE FROM sessions WHERE expires_at < now()').catch(() => {}), 3600_000).unref();
}
- async createUser(username, hash) {
- const r = await this.pool.query('INSERT INTO users (username, pass_hash) VALUES ($1, $2) ON CONFLICT (username) DO NOTHING RETURNING id, username', [username, hash]);
+ async createUser(username, hash, consent = {}) {
+ const r = await this.pool.query(
+ 'INSERT INTO users (username, pass_hash, terms_version, agreed_at, grownup_confirmed) VALUES ($1, $2, $3, now(), $4) ON CONFLICT (username) DO NOTHING RETURNING id, username',
+ [username, hash, consent.terms || null, !!consent.grownup]);
return r.rows[0] || null;
}
async userByName(username) { return (await this.pool.query('SELECT id, username, pass_hash FROM users WHERE username = $1', [username])).rows[0] || null; }
@@ -171,8 +181,12 @@ export function createAccounts(o) {
if (route === 'register') {
if (!USERNAME.test(username)) return json(res, 400, { error: 'bad-username' }), true;
if (password.length < 8 || password.length > 200) return json(res, 400, { error: 'bad-password' }), true;
+ // Agreeing to the current Terms / Privacy Policy is required; players under 13 need a grown-up.
+ if (body.agree !== true || body.terms !== TERMS_VERSION) return json(res, 400, { error: 'terms' }), true;
+ if (body.under13 === true && body.grownup !== true) return json(res, 400, { error: 'grownup' }), true;
if (!regLimit.hit(ip)) return json(res, 429, { error: 'slow-down' }), true;
- const user = await store.createUser(username, await hashPassword(password));
+ const consent = { terms: TERMS_VERSION, grownup: body.under13 === true && body.grownup === true };
+ const user = await store.createUser(username, await hashPassword(password), consent);
if (!user) return json(res, 409, { error: 'taken' }), true;
return startSession(res, user, 201), true;
}
diff --git a/server/dev.mjs b/server/dev.mjs
index e3027ce..3614493 100644
--- a/server/dev.mjs
+++ b/server/dev.mjs
@@ -10,7 +10,7 @@ import { attachRelay } from './rooms.mjs';
const ROOT = fileURLToPath(new URL('..', import.meta.url));
const TYPES = { '.html': 'text/html', '.js': 'text/javascript', '.mjs': 'text/javascript', '.css': 'text/css', '.json': 'application/json', '.webmanifest': 'application/manifest+json', '.png': 'image/png', '.jpg': 'image/jpeg', '.svg': 'image/svg+xml' };
-const SERVE = ['index.html', 'style.css', 'sw.js', 'manifest.webmanifest', 'icons', 'src', 'vendor'];
+const SERVE = ['index.html', 'style.css', 'privacy.html', 'terms.html', 'legal.css', 'sw.js', 'manifest.webmanifest', 'icons', 'src', 'vendor'];
/** Starts the dev server. Returns { server, port, url }. */
export async function startDevServer(port = 8770) {
diff --git a/src/account.js b/src/account.js
index 36b6b88..a561667 100644
--- a/src/account.js
+++ b/src/account.js
@@ -2,6 +2,8 @@
// Only a private username and a password: no email, no real name. Other players never see
// the username; in Play Together everyone still has a picked colour-and-animal name.
const HEADERS = { 'Content-Type': 'application/json', 'X-Minicrafter': '1' };
+/** Version of the Terms of Use and Privacy Policy (privacy.html / terms.html) a player agrees to. */
+export const TERMS_VERSION = '2026-11-10';
const MESSAGES = {
'bad-username': 'Usernames are 3–20 letters, numbers or _ (no spaces).',
@@ -10,6 +12,8 @@ const MESSAGES = {
wrong: "That username and password don't match.",
'slow-down': 'Too many tries. Wait a few minutes and try again.',
'not-logged-in': 'Please log in first.',
+ terms: 'Please agree to the Terms of Use and Privacy Policy.',
+ grownup: 'Players under 13 need a parent or guardian to agree.',
network: "Couldn't reach the server. Are you online?",
};
export const accountMessage = (code) => MESSAGES[code] || 'Something went wrong. Try again.';
@@ -41,7 +45,12 @@ export class Account {
} catch { return { ok: false, error: 'network' }; }
}
- async register(username, password) { const r = await this.post('register', { username, password }); if (r.ok) this.set(r.username); return r; }
+ /** consent: { under13, grownup }. The birth year itself never leaves the device. */
+ async register(username, password, consent = {}) {
+ const r = await this.post('register', { username, password, agree: true, terms: TERMS_VERSION, under13: !!consent.under13, grownup: !!consent.grownup });
+ if (r.ok) this.set(r.username);
+ return r;
+ }
async login(username, password) { const r = await this.post('login', { username, password }); if (r.ok) this.set(r.username); return r; }
async logout() { const r = await this.post('logout'); this.set(null); return r; }
async remove(password) { const r = await this.post('delete', { password }); if (r.ok) this.set(null); return r; }
diff --git a/src/main.js b/src/main.js
index f99a061..ee8d002 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1010,23 +1010,56 @@ function renderAccount() {
const creating = accMode === 'new';
$('acc-tab-login').classList.toggle('on', !creating);
$('acc-tab-new').classList.toggle('on', creating);
- $('acc-pass2-row').classList.toggle('hidden', !creating);
+ $('acc-new-extra').classList.toggle('hidden', !creating);
$('acc-pass').autocomplete = creating ? 'new-password' : 'current-password';
$('acc-submit').textContent = creating ? 'Create my account' : 'Log in';
+ renderGrownup();
}
+
+// Sign-up: a birth year (only used here, never sent or kept) decides whether a grown-up must help.
+const THIS_YEAR = new Date().getFullYear();
+{
+ const sel = $('acc-year');
+ for (let y = THIS_YEAR - 3; y >= THIS_YEAR - 100; y--) { const o = document.createElement('option'); o.value = String(y); o.textContent = String(y); sel.appendChild(o); }
+}
+let grownupQ = { a: 7, b: 8 };
+/** True when the player may be under 13 (by birth year alone we can't tell, so be careful). */
+const maybeUnder13 = () => { const y = Number($('acc-year').value); return y > 0 && THIS_YEAR - y <= 13; };
+function renderGrownup() {
+ const show = accMode === 'new' && maybeUnder13();
+ if (show && $('acc-grownup').classList.contains('hidden')) {
+ grownupQ = { a: 6 + Math.floor(Math.random() * 7), b: 6 + Math.floor(Math.random() * 7) };
+ $('acc-q').textContent = `${grownupQ.a} × ${grownupQ.b}`;
+ $('acc-a').value = ''; $('acc-parent').checked = false;
+ }
+ $('acc-grownup').classList.toggle('hidden', !show);
+}
+$('acc-year').addEventListener('change', renderGrownup);
account.onChange = () => { renderAccount(); renderTogether(); };
$('btn-account').addEventListener('click', () => openAccount(account.user ? 'login' : 'login'));
$('acc-tab-login').addEventListener('click', () => { accMode = 'login'; $('acc-msg').textContent = ''; renderAccount(); });
$('acc-tab-new').addEventListener('click', () => { accMode = 'new'; $('acc-msg').textContent = ''; renderAccount(); });
$('acc-done').addEventListener('click', closeAccount);
-for (const id of ['acc-user', 'acc-pass', 'acc-pass2', 'acc-del-pass']) $(id).addEventListener('keydown', (e) => e.stopPropagation());
+for (const id of ['acc-user', 'acc-pass', 'acc-pass2', 'acc-del-pass', 'acc-a']) $(id).addEventListener('keydown', (e) => e.stopPropagation());
$('acc-form').addEventListener('submit', async (e) => {
e.preventDefault();
const user = $('acc-user').value.trim(), pass = $('acc-pass').value;
- if (accMode === 'new' && pass !== $('acc-pass2').value) { $('acc-msg').textContent = "The two passwords don't match."; return; }
+ const say = (t) => { $('acc-msg').textContent = t; };
+ let consent = null;
+ if (accMode === 'new') {
+ if (pass !== $('acc-pass2').value) return say("The two passwords don't match.");
+ if (!$('acc-year').value) return say('Please choose the year you were born.');
+ const under13 = maybeUnder13();
+ if (under13) {
+ if (!$('acc-parent').checked) return say('A parent or guardian needs to tick the grown-up box.');
+ if (Number($('acc-a').value) !== grownupQ.a * grownupQ.b) return say("The grown-up check answer isn't right. Ask a grown-up!");
+ }
+ if (!$('acc-agree').checked) return say('Please tick the box to agree to the Terms of Use and Privacy Policy.');
+ consent = { under13, grownup: under13 };
+ }
$('acc-submit').disabled = true;
- $('acc-msg').textContent = accMode === 'new' ? 'Creating your account…' : 'Logging in…';
- const r = accMode === 'new' ? await account.register(user, pass) : await account.login(user, pass);
+ say(accMode === 'new' ? 'Creating your account…' : 'Logging in…');
+ const r = accMode === 'new' ? await account.register(user, pass, consent) : await account.login(user, pass);
$('acc-submit').disabled = false;
$('acc-pass').value = ''; $('acc-pass2').value = '';
if (!r.ok) { $('acc-msg').textContent = accountMessage(r.error); return; }
diff --git a/style.css b/style.css
index 865dba3..d2463f9 100644
--- a/style.css
+++ b/style.css
@@ -439,3 +439,14 @@ body.touch #quest-tracker .q-card ~ .q-card ~ .q-card { display: none; }
#craft .slot-grid .slot .count { font-size: 11px; right: 2px; bottom: 0; }
}
#game-version { white-space: nowrap; }
+
+/* Sign-up: birth year, agreement and the grown-up step */
+#acc-new-extra { display: grid; gap: 10px; }
+#acc-new-extra select { font: inherit; padding: 8px 10px; border-radius: 6px; border: 2px solid #4b556b; background: #121622; color: #fff; }
+label.check { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 8px; line-height: 1.35; }
+label.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: #66b043; }
+.acc-grownup { display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(230, 195, 92, .12); border: 2px solid #e6c35c; }
+.acc-grownup p { margin: 0; font-size: .9rem; line-height: 1.4; }
+.legal-links a, .acc-privacy a { color: #9cc3ff; }
+#account a { color: #9cc3ff; }
+#account .hint { color: #9aa3b5; font-size: .85em; }
diff --git a/sw.js b/sw.js
index e39b47b..cd41f84 100644
--- a/sw.js
+++ b/sw.js
@@ -1,8 +1,8 @@
// Service worker: caches the whole game so it works offline once loaded.
// Bump VERSION whenever files change so players get the update.
-const VERSION = 'minicrafter-v23';
+const VERSION = 'minicrafter-v24';
const CORE = [
- './', './index.html', './style.css', './manifest.webmanifest', './site-config.json',
+ './', './index.html', './style.css', './privacy.html', './terms.html', './legal.css', './manifest.webmanifest', './site-config.json',
'./icons/icon-192.png', './icons/icon-512.png', './icons/icon-maskable-512.png', './icons/apple-touch-icon.png', './icons/favicon-32.png',
'./vendor/three.module.js', './vendor/blockly.min.js', './vendor/media/sprites.png',
'./src/adventure.js',
diff --git a/terms.html b/terms.html
new file mode 100644
index 0000000..89179fc
--- /dev/null
+++ b/terms.html
@@ -0,0 +1,79 @@
+
+
+
+
+
+ Terms of Use · MiniCrafter
+
+
+
+
+
+
+ ← Back to the game
+
📜 Terms of Use
+
Version 2026-11-10 · Last updated 10 November 2026
+
+
+
🧒 The short version (for kids)
+
+
Be kind. Don't wreck other people's builds in Play Together without asking.
+
Make up a username. Never use your real name or anything that tells people who you are.
+
Keep your password secret. Only share it with your grown-up.
+
Under 13? A grown-up must help you make an account.
+
MiniCrafter is free. You never have to pay for anything in it.
+
+
+
+
1. Who we are and what these terms cover
+
MiniCrafter is provided by Dynamic Web Lab FZE LLC, a Free Zone Establishment licensed by Sharjah Publishing City Free Zone Authority (License No. 4426361.01), Business Centre, Sharjah Publishing City Free Zone, Sharjah, United Arab Emirates ("we"). These terms cover the game and its online features, such as accounts and Play Together. By making an account or using the online features, you agree to them. Our Privacy Policy explains what we keep and why.
+
+
2. Who can make an account
+
+
Anyone can play without an account.
+
Players under 13 may make an account only with a parent or guardian, who confirms they agree to these terms and the Privacy Policy for the child.
+
Grown-ups who help a child make an account are responsible for that account.
+
+
+
3. Your account
+
+
Choose a made-up username. Usernames must not contain real names, contact details, or anything rude or hurtful.
+
Keep your password safe. If you think someone else knows it, change it by making a new account, and delete the old one.
+
You can delete your account at any time from the account screen.
+
+
+
4. Playing fairly and kindly
+
Please don't:
+
+
use rude, hurtful or scary usernames, or build such things to upset others in Play Together;
+
try to find out who other players are, or share personal information about anyone;
+
cheat, attack, overload or break the game or our servers, or try to get into other people's accounts;
+
use automated tools to create accounts or join rooms.
+
+
If someone breaks these rules, we may remove them from a game, or suspend or delete their account.
+
+
5. The game and your creations
+
+
MiniCrafter's code is open source under the MIT License. Your worlds and builds are yours.
+
Worlds are saved on your device. Clearing your browser's data deletes them, so download a backup from "My worlds" if a world matters to you.
+
+
+
6. Changes and availability
+
+
MiniCrafter is free and provided "as is". We work hard to keep it running, but we can't promise it will always be available or free of mistakes. Online features may change or stop.
+
We may update these terms. We'll change the date at the top, and show a notice in the game for important changes.
+
+
+
7. Responsibility
+
As far as the law allows, we are not responsible for lost worlds, or for anything indirect that happens because of using MiniCrafter. Nothing in these terms takes away rights you have under the law where you live.
+
+
8. Law
+
These terms are governed by the laws of the Emirate of Sharjah and the federal laws of the United Arab Emirates. If you live elsewhere, you also keep any protections your local law gives you.
+
+
9. Contact
+
Questions, reports about other players, or requests about an account: info@dynamicweblab.com.