An educational math game with a Matrix-themed interface where players solve algebra equations by clicking falling symbols. Features progressive lock animations and adversarial worm mechanics.
- Features
- Demo
- Installation
- How to Play
- Game Mechanics
- Technical Architecture
- Project Structure
- Development
- Contributing
- License
- Three Difficulty Levels: Beginner (Addition/Subtraction), Warrior (Multiplication), Master (Division)
- Step-by-Step Solutions: Visual revelation of algebraic problem-solving process
- Symbol Rain: Matrix-style falling symbols for interactive gameplay
- Progressive Lock System: Visual feedback that evolves as you progress (6 levels)
- Worm Adversaries: Enemy system that steals symbols - click to save them!
- Quick Access Console: 3x3 grid for storing frequently used symbols with keyboard shortcuts (1-9)
- Matrix Theme: Green cascading symbols with cyberpunk aesthetics
- Smooth Animations: CSS3-powered lock transformations and worm movements
- Responsive Design: Works on desktop, tablet, and mobile devices
- Orbitron Font: Sci-fi themed typography
- 150 Problems Total: 50 problems per difficulty level
- Multiple Operations: Addition, subtraction, multiplication, division
- Visual Learning: See each step of equation solving
- Instant Feedback: Visual cues for correct/incorrect answers
-
Clone the repository
git clone https://github.com/TeacherEvan/MathMasterHTML.git cd MathMasterHTML
-
Open in browser
# Simply open index.html in your browser # No build process required!
Visit the live version at: https://teachereven.github.io/MathMasterHTML/
-
Start the Game
- Open
index.html
in your browser - Click through the Matrix-themed welcome screen
- Open
-
Select Your Level
- Beginner: Master addition and subtraction
- Warrior: Tackle multiplication challenges
- Master: Conquer division problems
-
Solve the Problem
- Read the algebra problem displayed in Panel A (left)
- Watch symbols fall in Panel C (right)
- Click the correct symbols to reveal the solution in Panel B (middle)
-
Watch Your Progress
- The lock animation in Panel A evolves every 2 completed solution lines
- Complete all steps to solve the problem and move to the next one
-
Battle the Worms
- Worms spawn after each completed line (max 4)
- They steal hidden symbols from your solution
- Click worms to destroy them and save the symbols!
-
Use the Help Button
- Stuck? Click the HELP button in Panel B
- It reveals one random symbol from the current line
-
Quick Access Console (NEW!)
- After solving each problem, you can add symbols to your console
- Use keyboard shortcuts 1-9 to quickly click console symbols
- Console appears at the bottom of Panel B for easy access
- Solutions are revealed symbol-by-symbol, not character-by-character
- Each solution line must be completed before moving to the next
- Case-insensitive matching (X and x are treated identically)
- Cumulative Progress: Lock levels advance based on total completed lines across ALL problems
- Formula: Every 2 completed lines = 1 lock level advancement
- Level Caps:
- Beginner/Warrior: Maximum Level 3
- Master: All 6 levels unlocked
- Spawning: 1 worm per completed solution line (max 4 active)
- Behavior: Random ground-based movement
- Theft Cycle: Attempts to steal symbols every 10 seconds
- Defeat: Click worm to destroy and return stolen symbol
- Symbol Selection: After each problem, choose symbols to add to your 3x3 console grid
- Keyboard Shortcuts: Press 1-9 to activate console slots (matches numpad layout)
- Two-Step Process: Select symbol first, then choose position on grid
- Skip Option: Use "Skip" button for random placement
- Visual Feedback: Purple pulsate animation when console buttons are clicked
- Session Storage: Console resets on page reload
The game uses custom DOM events for communication:
symbolClicked
- Player clicked a falling symbolfirst-line-solved
- First correct answer triggers lock animationproblemLineCompleted
- Line finished โ spawn worm + progress lockwormSymbolSaved
- Player saved symbol by clicking wormproblemCompleted
- Problem finished โ show console modalconsoleSymbolAdded
- Symbol added to console โ continue to next problem
- HTML5 - Semantic structure
- CSS3 - Animations, gradients, responsive design
- Vanilla JavaScript - No frameworks or dependencies
- Google Fonts - Orbitron (monospace sci-fi)
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
โ Panel A โ Panel B โ Panel C โ
โโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโค
โ Problem โ Solution Area โ Symbol โ
โ Display โ + Worm Zone โ Rain โ
โ + โ + Help Button โ (Matrix) โ
โ Lock โ โ โ
โ Animation โ โ โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
File | Purpose | Lines |
---|---|---|
js/game.js |
Main game logic, problem parsing, symbol validation | 515 |
js/lock-manager.js |
Progressive lock animation system (LockManager class) | 634 |
js/worm.js |
Enemy mechanics system (WormSystem class) | 230 |
js/3rdDISPLAY.js |
Symbol rain rendering and click detection | ~200 |
js/console-manager.js |
Quick access console system (ConsoleManager class) | ~340 |
Problems are stored in Markdown files:
## Pattern 1: a + b - X = c
1. `5 + 3 - X = 6`
- 5 + 3 - X = 6
- 8 - X = 6
- X = 8 - 6
- X = 2
Parsing: Regex /(\d+)\.\s+
([^]+)
\s*\n((?:\s*-[^\n]+\n?)+)/g` extracts problem and solution steps.
MathMaster-Algebra/
โโโ index.html # Welcome screen
โโโ level-select.html # Difficulty selection
โโโ game.html # Main game interface
โโโ Assets/
โ โโโ Beginner_Lvl/
โ โ โโโ beginner_problems.md # 50 problems
โ โโโ Warrior_Lvl/
โ โ โโโ warrior_problems.md # 50 problems
โ โโโ Master_Lvl/
โ โโโ master_problems.md # 50 problems
โโโ js/
โ โโโ game.js # Core game logic
โ โโโ lock-manager.js # Lock animation system
โ โโโ worm.js # Worm mechanics
โ โโโ console-manager.js # Quick access console
โ โโโ 3rdDISPLAY.js # Symbol rain
โโโ css/
โ โโโ game.css # Three-panel layout
โ โโโ lock-responsive.css # Lock scaling
โ โโโ console.css # Console styling
โ โโโ worm-styles.css # Worm animations
โโโ lock-components/
โ โโโ Line-1-transformer.html
โ โโโ line-2-transformer.html
โ โโโ line-3-transformer.html
โ โโโ line-4-transformer.html
โ โโโ Line-5-transformer.html
โ โโโ line-6-transformer.html
โโโ Docs/
โโโ BugFix_Jobcard_Critical.md
โโโ Worm_System_Improvements.md
โโโ Lock animation audit.md
โโโ Console_Quick_Reference.md
โโโ Console_Feature_Implementation.md
โโโ Final_Code_Review.md
- Modern web browser (Chrome, Firefox, Edge, Safari)
- Text editor (VS Code recommended)
- No build tools or package managers required!
-
Open the project
code .
-
Start testing
- Open
index.html
in browser - Or use Live Server extension in VS Code
- Open
-
Debug with Console
- Extensive emoji-prefixed logging:
- ๐ฎ Game state
- ๐ Lock manager
- ๐ Worm system
- ๐ Problem loading
- ๐ฏ Symbol matching
- Extensive emoji-prefixed logging:
Testing Path: index.html
โ level-select.html
โ game.html?level=beginner
Lock Animation Testing:
// In browser console:
lockManager.forceLockLevel(3); // Jump to level 3
lockManager.getDebugInfo(); // Inspect state
Worm Spawn Testing:
// Manually trigger:
document.dispatchEvent(new CustomEvent('problemLineCompleted'));
Issue | Solution |
---|---|
Lock not appearing | Check first-line-solved event dispatch |
Lock stuck at level 1 | Verify completedLinesCount++ |
Symbols not revealing | Check X/x normalization |
Worms not spawning | Check event listener in WormSystem |
Multiple clicks needed | Symbol detection missing normalization |
Console not appearing | Ensure problemCompleted event fires after all symbols revealed |
Keyboard shortcuts not working | Console slot must be filled, game window must have focus |
Contributions are welcome! Here's how you can help:
- Check existing issues
- Create detailed bug report with:
- Browser and version
- Steps to reproduce
- Expected vs actual behavior
- Console errors (if any)
- Open an issue with
[FEATURE]
prefix - Describe the feature and use case
- Include mockups if applicable
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Follow existing code style (see
.github/copilot-instructions.md
) - Use emoji-prefixed console logging
- Test on multiple browsers
- Update documentation if needed
This project is licensed under the MIT License - see the LICENSE file for details.
Created by: Teacher Evan
Repository: MathMasterHTML
Purpose: Educational tool for teaching algebra through interactive gameplay
- Google Fonts for Orbitron typeface
- The Matrix (1999) for visual inspiration
- Students who tested and provided feedback
Planned features (see issue tracker):
- Sound effects and background music
- Leaderboard system
- Achievement badges
- More worm types with special abilities
- Custom problem creation tool
- Multiplayer mode
- Mobile app version
For questions, suggestions, or collaboration:
- GitHub Issues: Create an issue
- Email: Contact through GitHub profile
Made with โค๏ธ for math education