Times Table Animals is a browser-based educational math game built around animal habitats, short problem loops, and progressive unlocks. Players help animal characters by solving age-appropriate math questions across themed environments such as Bunny Meadow, Penguin Arctic, Dragon Sanctuary, and Rainbow Reserve.
The project runs as a static HTML5 application with JavaScript managers for gameplay, rendering, audio, language switching, and timers.
- 12 themed habitats with progressive unlocking
- Multiple math domains, from addition to mixed challenge problems
- Local progress saving with
localStorage - English, Spanish, and Italian language support
- Music, SFX, voice, and volume settings
- Canvas-based habitat gameplay with DOM-based menus and overlays
- Automated browser tests with Puppeteer
The game is implemented and runnable today.
Core runtime pieces currently in use:
index.htmlas the main HTML shelljs/main.jsas the effective application entry pointjs/gameEngine.jsfor canvas rendering and animation statejs/mathEngine.jsfor problem generation and validationjs/audioManager.jsfor music and sound effectsjs/languageManager.jsfor UI localizationjs/timerManager.jsfor countdowns and failure eventsjs/habitats/for habitat-specific gameplay controllers
There is also a js/sceneManager.js, but the active runtime currently routes directly from GameController into habitat classes.
- Node.js 14+
- A modern browser
- Python is optional, but useful for the local static server script
Install dependencies:
npm installStart the local server:
npm run serveThen open:
http://localhost:8080
If Python is not available, you can also open index.html directly in a browser.
From the project root:
npm run serveStarts a simple local HTTP server.
npm testRuns the main Puppeteer-based automated test suite.
npm run test:quickRuns a smaller smoke test for development.
npm run test:installInstalls Puppeteer explicitly if needed.
npm run deploy:checkRuns repository and deployment sanity checks.
npm run deploy:testRuns the automated test suite and the deployment check.
- Launch from the main menu.
- Choose an unlocked habitat.
- Solve multiple-choice math problems.
- Complete the habitat target to earn progress and badges.
- Unlock the next habitat and continue.
The game currently starts with:
Bunny MeadowunlockedPenguin Pairs Arcticunlocked
Further habitats unlock as the player completes earlier ones.
Current habitat lineup:
- Bunny Meadow
- Penguin Pairs Arctic
- Penguin Arctic
- Elephant Savanna
- Monkey Jungle
- Lion Pride
- Dolphin Cove
- Bear Forest
- Giraffe Plains
- Owl Observatory
- Dragon Sanctuary
- Rainbow Reserve
- Mouse or touch-style click interaction for buttons and habitat cards
- Click one of the four answer buttons
- Keyboard shortcuts:
qwer
🏠return/home control⏸️pause button⚙️settings button
Times-Table-Animals/
├── index.html
├── package.json
├── GAME_IMPLEMENTATION_STATUS.md
├── assets/
├── css/
│ ├── animations.css
│ ├── styles.css
│ └── timer.css
├── js/
│ ├── audioManager.js
│ ├── gameEngine.js
│ ├── languageManager.js
│ ├── main.js
│ ├── mathEngine.js
│ ├── questionTemplates.js
│ ├── sceneManager.js
│ ├── timerManager.js
│ └── habitats/
└── tests/
The app is loaded as a static browser application using ordered global script tags in index.html.
-
js/main.js- bootstraps the app
- wires DOM events
- manages save state, screen switching, habitat entry, progression, and timer polling
-
js/mathEngine.js- selects problem types per habitat
- generates problems and distractors
- validates answers
- supports language-aware templates
-
js/gameEngine.js- manages the canvas loop
- handles sprites, particles, and animation state
-
js/timerManager.js- runs habitat timers
- updates warning states
- controls catastrophic timeout overlays
-
js/audioManager.js- handles music and synthesized/fallback sound effects
-
js/languageManager.js- manages UI translation strings and language switching
-
js/habitats/*.js- implement each themed habitat experience directly
Automated tests live in tests/.
Coverage currently focuses on:
- loading the game
- menu and habitat navigation
- answer interaction
- progression flow
- keyboard input
- deployment sanity checks
For test-specific details, see tests/README.md.
Progress is stored locally in the browser using localStorage.
Current tracked state includes:
- badge count
- unlocked habitats
- per-habitat completion progress
- settings such as language, difficulty, music, SFX, voice, and volume
SceneManagerexists but is not the canonical runtime navigation path.- Some game systems still carry architectural duplication from earlier iterations.
- Habitat files are large and contain repeated lifecycle patterns.
- Automated tests are useful but remain browser-flow oriented rather than deep unit coverage.
If you are extending the game, the safest source of truth is the runtime code itself:
index.htmljs/main.jsjs/habitats/js/mathEngine.jsjs/timerManager.jsjs/audioManager.js
The repository also includes GAME_IMPLEMENTATION_STATUS.md, which summarizes the current implementation state at a higher level.
MIT