An educational tower defense game designed for grade 4 students that combines curriculum-aligned math questions with engaging gameplay mechanics.
Math Tower Defense is a two-phase educational game:
- Math Quiz Phase: Complete 5 grade 4 math questions to unlock tower defense gameplay
- Tower Defense Phase: Defend against waves of lava chicken enemies while solving bonus math problems
- Regular Lava Chickens: Fiery chickens with glowing lava effects and animated drips
- Shielded Variants: Rare enemies (5% spawn chance after wave 3) with protective energy shields
- Grade 4 curriculum-aligned questions covering:
- Addition & Subtraction
- Multiplication & Division
- Fractions
- Geometry
- Word Problems
- Performance-based unlock system
- Immediate feedback with explanations
- Appear every 3rd wave during tower defense
- Earn extra gold for correct answers
- Encourage continued learning during gameplay
- Optional - can be skipped to continue playing
- 🗼 Basic Tower (20 gold): Standard damage, balanced stats
- ❄️ Ice Tower (40 gold): Slows enemies, moderate damage
- 🔥 Fire Tower (60 gold): High damage with splash effect
- Basic Lava Chicken: Standard HP and speed
- Fast Lava Chicken: Lower HP but increased speed
- Strong Lava Chicken: High HP but slower movement
- Shielded Variants: Any type can spawn with protective shields
- Waves increase in difficulty and enemy count
- Performance unlocks determine available towers and abilities
- Local progress tracking maintains unlocks between sessions
- Modern web browser with JavaScript enabled
- No additional installations required
- Open
index.htmlin your web browser - Complete the 5-question math quiz
- Enjoy tower defense gameplay!
# Clone the repository
git clone [repository-url]
cd math_tower_defense
# Open in browser
open index.html- Background Music: Disabled by default, can be enabled in settings
- Sound Effects: Comprehensive audio feedback for all game actions
- Dynamic Audio: Dramatic countdown effects and contextual sounds
- Volume Controls: Separate controls for music, SFX, and master volume
math_tower_defense/
├── index.html # Main game interface
├── app.js # Application controller
├── style.css # Global styles
├── quiz/
│ ├── QuizSystem.js # Math quiz logic
│ └── questions.js # Question database
├── game/
│ ├── GameEngine.js # Core tower defense mechanics
│ └── GameEngine3D.js # 3D rendering extension
├── math/
│ └── BonusSystem.js # Bonus question system
├── progress/
│ └── ProgressTracker.js # Local storage & analytics
└── ui/
└── audio/
└── AudioSystem.js # Sound effects & music
- Answer 5 grade 4 math questions
- Review explanations for each answer
- Your performance determines tower unlocks
- Place Towers: Click a tower type, then click on the game field
- Start Waves: Click "Start Wave" or wait for auto-countdown
- Defend: Towers automatically target and shoot enemies
- Bonus Questions: Solve 3 math problems every 3rd wave for extra gold
- Survive: Don't let enemies reach the end!
- Mouse: Place towers and interact with UI
- Space: Pause/resume game
- Click: Select towers and answer questions
Quiz performance determines starting advantages:
- Excellent (90%+): All towers, abilities, hard difficulty
- Great (80-89%): Basic + Ice + Fire towers, speed boost, normal difficulty
- Good (70-79%): Basic + Ice towers, normal difficulty
- Fair (60-69%): Basic + Ice towers, easy difficulty
- Needs Practice (<60%): Basic tower only, easy difficulty
- Canvas-based Rendering: Smooth 60fps gameplay
- Responsive Design: Adapts to different screen sizes
- Local Storage: Progress persists between sessions
- Modular Architecture: ES6 modules for maintainability
- No Dependencies: Pure JavaScript implementation
- Lava Chicken Enemies: Custom-drawn animated creatures with:
- Glowing lava effects
- Animated dripping lava
- Evil red eyes
- Chicken anatomy (beak, comb, tail feathers, claws)
- Energy Shields: Rare enemies with animated hexagonal shields
- Dynamic Countdown: Visual and audio countdown effects
- Particle Effects: Smooth projectiles and impact feedback
Aligned with Grade 4 mathematics curriculum:
- Number Operations: Multi-digit addition, subtraction, multiplication, division
- Fractions: Basic fraction concepts and equivalence
- Geometry: Shape properties, perimeter calculations
- Problem Solving: Real-world application word problems
- Procedurally Generated: All sounds created using Web Audio API
- Contextual Audio: Different sounds for each tower type and action
- Musical Elements: Background music with melody and bass lines
- Dramatic Effects: Escalating countdown sounds and victory fanfares
- Educational First: Game mechanics support learning objectives
- Age-Appropriate: Visual design and difficulty suitable for grade 4
- Local-Only: No external servers, works offline
- Performance Optimized: Efficient rendering for smooth gameplay
- Additional grade levels
- Multiplayer functionality
- Teacher dashboard
- Extended curriculum integration
This is an educational project designed for grade 4 students. When contributing:
- Maintain age-appropriate content
- Follow curriculum alignment
- Ensure accessibility
- Test on various devices
- Keep educational value central
Educational use encouraged. Please maintain attribution and educational focus in any derivatives.
Built with ❤️ for young mathematicians and tower defense enthusiasts!