{"slug": "i-vibe-coded-a-free-offline-math-game-for-kids", "title": "I vibe coded a free offline Math game for kids", "summary": "A developer created Escape Run, a free, open-source, offline math game for kids that uses adaptive difficulty and evidence-based skills while prioritizing privacy with no ads, sign-ins, or tracking. The game, built almost entirely by prompting an AI coding agent, runs in the browser as a PWA and stores all progress locally. It aims to provide a respectful, educational alternative to ad-filled children's apps.", "body_md": "A free, **open-source, privacy-first** learning game where kids drive a little car\nacross three lanes and steer into the lane with the right answer. Five\n**evidence-based** math skills, adaptive difficulty, spaced review — and\n**no ads, no sign-in, no tracking**. Everything runs in the browser and works\noffline.\n\n**▶ Play:** [https://abhas9.github.io/escape-run/](https://abhas9.github.io/escape-run/) · **~35 KB core code** (+ ~1.5 MB lazy-loaded audio) · **zero runtime dependencies** · installable PWA\n\n🤖\n\nVibe-coded— built almost entirely by prompting an AI coding agent, then kept honest with unit tests and headless-browser smoke tests. See[How it was built].\n\nMost \"free\" kids' math apps are stuffed with ads, upsells, accounts, and trackers pointed at children. I wanted the opposite: something my kid could open and play in one tap, that respects their attention and privacy, and that's actually grounded in how children learn math — with the whole thing open for other parents and teachers to read, fork, and improve.\n\n**Privacy by design.** No accounts, no analytics, no network calls. All progress is stored in`localStorage`\n\non the device. Nothing ever leaves the browser. (Verify it yourself — open DevTools → Network.)**Evidence-based content.** The eight skills are chosen because they're strong, well-replicated predictors of early-elementary math achievement, and they map onto the India NCERT primary-maths curriculum (see below).**It teaches, not just tests.** A friendly mascot (Pip) guides a hands-on tutorial, explains a wrong answer with a visual and a second chance, offers optional hints, and gives a quick modeled example when a skill levels up.**Ethical stickiness, no dark patterns.** Mastery-based progression, adaptive difficulty, spaced review, a Daily Challenge, rotating Quests, a Trophy Room, and collectible characters — all*earned*and local, with*flexible*streaks that never punish or guilt, and no purchases ever.**Tiny & hackable.** Vanilla JS + Canvas, no framework, no build step. Every skill is a ~40-line module.**Accessible.** Keyboard play, reduce-motion, high-contrast, colour-blind-safe cues (✓/✗, not colour alone), easy-read text, and large tap targets.**Warm audio, still private.** Calm background music, sound effects, and a voiced tutorial (generated with ElevenLabs) are baked in as local files at build time — the browser never calls any audio API, and a procedural WebAudio synth fallback keeps things working if the files are absent.\n\n| Skill | In game | Why it's here |\n|---|---|---|\nSubitizing / Counting |\nNumber Fuel — \"how many dots?\" |\nInstantly seeing \"how many\" is a unique predictor of later achievement beyond rote counting. |\nMagnitude comparison |\nBig & Small — tap the bigger/smaller number |\nNumerical magnitude is one of the strongest single predictors of math outcomes. |\nArithmetic fluency |\nSpeed Math — quick add/subtract |\nFluency frees working memory for harder math. |\nPatterning |\nWhat's Next? — extend the pattern |\nBuilds algebraic reasoning and executive function. |\nNumber bonds / make-10 |\nMake It Whole — part-whole composition |\nComposing/decomposing number is core number sense. |\nMultiplication & division |\nSuper Groups — equal groups, times tables, fair sharing |\nRepeated addition → multiplicative thinking; the gateway to Class 2–3 maths. |\nShape & space |\nShape Shadows — name shapes, corners, silhouettes, solids, equal parts |\nEarly geometry & spatial sense; a gentle on-ramp for the youngest players. |\nFractions |\nFair Share — halves, quarters, sharing a group |\nFair-share intuition is the foundation for rational number. |\n\nThe last three roads start **locked** and open as *mystery roads* on the\nAdventure Map when their prerequisites are met (e.g. Super Groups opens at Speed\nMath level 4), so a child meets one new idea at a time. Unlocking one is a little\ncelebration of its own.\n\n**Upper levels (6–7).** Each skill extends past its original cap for kids who\nmaster the basics: doubles & halves and missing-number equations (`? + 4 = 9`\n\n—\nearly algebraic reasoning) in *Speed Math*, bridging through ten and\nplace-value parts (`30 + ? = 34`\n\n) in *Make It Whole*, counting in rows of ten\nin *Number Fuel*, transposed-digit comparisons (34 vs 43) in *Big & Small*, and\ndescending & two-attribute patterns in *What's Next?*. Number-line estimation\n(Siegler & Booth) is on the roadmap but not yet in the game.\n\n**Curriculum mapping (India NCERT).** Each road maps onto a primary-maths strand,\nso the play is transparent to parents and teachers:\n\n| Road | NCERT strand |\n|---|---|\n| Number Fuel | Numbers 1–20 · Class 1 |\n| Big & Small | Comparing Numbers · Class 1–2 |\n| Speed Math | Addition & Subtraction · Class 1–2 |\n| What's Next? | Patterns · Class 1–3 |\n| Make It Whole | Making 10 / Number Bonds · Class 1–2 |\n| Super Groups | Grouping & Sharing (× ÷) · Class 2–3 |\n| Shape Shadows | Shapes & Space / Shadows · Class 1–3 |\n| Fair Share | Fair Share — halves & quarters · Class 3 |\n\nContent stays within the Class 3 ceiling on purpose: no remainders, no fractions beyond halves/quarters, tables to ten.\n\n**How difficulty, review & feedback work**\n\n**Adaptive difficulty (ZPD).** Each skill levels up after a short run of successes and gently eases back after repeated misses, keeping the child in the \"just-right\" zone (Vygotsky's zone of proximal development).**Mastery, not grinding.** Progress reflects demonstrated understanding (Bloom's mastery learning), not time spent.**Spaced review.** A Leitner-style scheduler resurfaces skills as they come*due*, distributing practice over time (the spacing effect).**Teach, don't just test.** Wrong answers get a friendly visual explanation and a second chance; an optional hint appears only when a child hesitates (not on every question); a quick modeled example appears when a skill levels up (\"I do / we do / you do\"; Shute's formative feedback).\n\n**Staying engaged (ethically)**\n\n**Onboarding** with a mascot (Pip) who then rides along and reacts.**\"Play\" rotates** through skills and shows which one is next.**Daily Challenge**— one date-seeded mission a day with a bonus.** Quests**— three rotating goals that refresh daily.** Balloon-pop bonus round**after every mission for extra stars.** Trophy Room**— sticky achievement badges.** Collectible characters, cars & worlds**with a celebratory earned reveal.** Grown-up controls**— adjustable car speed (Relaxed/Steady/Normal), break reminders, and accessibility toggles.- All\n*earned*and local; streaks never punish; nothing is ever purchasable.\n\n*Selected references:* Bloom, *Learning for Mastery* (1968); Vygotsky, *Mind in\nSociety* (1978); Cepeda et al., *Distributed practice* (Psych. Bulletin, 2006);\nSiegler & Booth on number-line estimation; Rittle-Johnson on patterning;\nSchneider et al. meta-analysis on magnitude comparison. Full write-up in the\nin-game **Grown-ups** panel.\n\n**Touch:** tap the left / middle / right of the screen to change lane, or swipe.**Keyboard:**`←`\n\n/`→`\n\n(or`A`\n\n/`D`\n\n) to move,`1`\n\n/`2`\n\n/`3`\n\nto jump to a lane,`P`\n\nor`Esc`\n\nto pause.- Collect ✦ sparks, dodge cones, and drive into the lane with the correct answer.\n\nNo build step. Any static server works:\n\n```\npython3 -m http.server 8000    # then open http://localhost:8000\n# or: npx serve .\n```\n\nMusic, SFX, and tutorial narration are pre-generated and committed under\n`assets/audio/`\n\n, so you don't need to regenerate them to play. To rebuild them\n(e.g. to tweak prompts), set `ELEVENLABS_API_KEY`\n\nin a local `.env`\n\n(git-ignored)\nand run:\n\n```\nnode tools/gen-audio.mjs           # regenerates only missing files\nnode tools/gen-audio.mjs --force sfx:correct   # force one asset\n```\n\nGeneration happens **at dev time only**; the shipped game plays local files.\n\nPure game logic (skill generators, mastery model, spaced-repetition scheduler)\nis covered by Node's built-in test runner — **no dependencies required**:\n\n```\nnode --test\n```\n\nOptional browser smoke tests live in `tests/smoke.mjs`\n\nand `tests/nav.mjs`\n\n(they drive a local Chrome via `puppeteer-core`\n\n, which is *not* a runtime\ndependency).\n\n```\nindex.html            entry point (canvas + DOM overlay)\nmanifest.webmanifest  PWA metadata\nsw.js                 service worker (offline)\nsrc/\n  engine/   loop · input · renderer · audio (files + WebAudio synth) · voice · particles\n  game/     runner · gates · hud · mascot · onboarding · teach · map · garage\n            goals · trophies · balloons · reveal · results · parent zone\n  skills/   counting · comparison · arithmetic · patterning · bonds\n  progress/ mastery (ZPD) · scheduler (Leitner) · daily · quests · achievements\n            save · settings\n  ui/       styles · DOM helpers\nassets/     icons · audio/ (music · sfx · voice, generated)\ntools/      gen-audio.mjs (dev-only ElevenLabs generator)\ntests/      unit tests (node --test) + optional browser smoke tests\n```\n\nEvery skill is a small pure module that returns a challenge. Create\n`src/skills/myskill.js`\n\n:\n\n``` js\nimport { randInt, makeOptions } from \"../util.js\";\n\nexport const meta = {\n  id: \"myskill\", name: \"My Skill\", short: \"My Skill\",\n  icon: \"?\", color: \"#0ea5e9\", maxLevel: 5, blurb: \"What this teaches.\",\n};\n\n// `rng` is a 0..1 function (seedable for tests). Return exactly 3 options.\nexport function generate(level, rng) {\n  const answer = randInt(rng, 1, level * 3);\n  const { options, correctIndex } = makeOptions(rng, answer, [answer + 1, answer - 1, answer + 2]);\n  return {\n    skillId: \"myskill\",\n    level,\n    prompt: { type: \"expr\", text: `${answer} = ?` }, // reuse a render type\n    optionKind: \"number\",\n    promptText: \"Pick the number\",\n    say: \"Pick the number\",\n    options,\n    correctIndex,\n  };\n}\n```\n\nRegister it in `src/skills/index.js`\n\n(add to `SKILLS`\n\nand `SKILL_ORDER`\n\n), give it\na default entry in `src/progress/save.js`\n\n(`SKILL_IDS`\n\n), and — so it's playable\nright away — add its id to `BASE_UNLOCKED`\n\nin `src/progress/unlocks.js`\n\n(or give\nit an unlock rule to make it a *mystery road*). It then automatically gets\nadaptive difficulty, spaced review, a map card, and results tracking.\n\nEscape Run was **vibe-coded** — designed and written almost entirely by\nprompting an AI coding agent in natural language, iterating feature by feature\n(gameplay, the eight skills, adaptive difficulty and spaced repetition, the\nmascot-guided tutorial, teaching feedback, the daily/quests/trophies loop, and\nthe ElevenLabs-generated audio).\n\nTo keep that honest rather than hand-wavy:\n\n- The game logic is covered by\nunit tests (skill generators, mastery model, spaced-repetition scheduler, skill rotation, quests, achievements).`node --test`\n\n- Whole-game flows are checked with\n**headless-Chrome smoke tests**. - It's deliberately\n**small, framework-free, and readable**— every skill is a ~40-line module — so you can audit or fork any part of it.\n\nJudge it on the result: tiny, tested, private, and hackable.\n\nEscape Run collects **nothing**. There are no accounts, no ads, no third-party\nscripts, and no network requests after the initial load (the service worker even\nlets it run fully offline). Progress lives only in this browser's\n`localStorage`\n\n, and the **Grown-ups → Reset progress** button clears it.\n\n[MIT](/abhas9/escape-run/blob/main/LICENSE) © abhas9. Built for kids and their grown-ups — fork away.", "url": "https://wpnews.pro/news/i-vibe-coded-a-free-offline-math-game-for-kids", "canonical_source": "https://github.com/abhas9/escape-run", "published_at": "2026-07-18 13:30:50+00:00", "updated_at": "2026-07-18 13:51:16.407787+00:00", "lang": "en", "topics": ["ai-tools", "ai-products", "developer-tools", "ai-ethics"], "entities": ["Escape Run", "ElevenLabs", "NCERT"], "alternates": {"html": "https://wpnews.pro/news/i-vibe-coded-a-free-offline-math-game-for-kids", "markdown": "https://wpnews.pro/news/i-vibe-coded-a-free-offline-math-game-for-kids.md", "text": "https://wpnews.pro/news/i-vibe-coded-a-free-offline-math-game-for-kids.txt", "jsonld": "https://wpnews.pro/news/i-vibe-coded-a-free-offline-math-game-for-kids.jsonld"}}