Developer: Aslam Sujah ๐ค Client: Mahthi Hassan
A fully responsive, mobile-optimized educational web game that challenges children's memory and pattern recognition skills through themed object categories. Perfect for learning while having fun!
Magic Tray is an educational memory-based puzzle game where children:
- Choose from different themed categories (Shapes, Fruits, Vegetables, Animals, Body Parts, Family)
- Watch a sequence of items from their chosen category appear on the magic tray
- Remember the exact order of appearance
- Recreate the sequence by selecting items in the correct order
- Progress through increasingly challenging levels with bonus lives and scoring
Magic_Tray_Game/
โโโ index.html # Main game HTML structure and UI components
โโโ styles.css # Responsive styling, animations, and mobile optimization
โโโ game.js # Complete game logic, mechanics, and interactions
โโโ README.md # This comprehensive documentation
- โฆ Shapes: Circle, Square, Triangle, Diamond, Heart, Oval, Rectangle, Star
- ๐ Fruits: Apple, Banana, Orange, Grapes, Strawberry, Watermelon, Pineapple, Avocado
- ๐ฅ Vegetables: Carrot, Hot Pepper, Tomato, Corn, Eggplant, Cucumber, Onion, Potato
- ๐ Animals: Dog, Cat, Rabbit, Bear, Lion, Elephant, Monkey, Panda
- ๐๏ธ Body Parts: Eye, Nose, Mouth, Ear, Hand, Leg, Heart, Brain
- ๐จโ๐ฉโ๐งโ๐ฆ Family: Mom, Dad, Sister, Brother, Grandma, Grandpa, Baby, Family
- Category Selection: Choose your preferred learning theme
- Memory Challenge: Watch and recreate themed item sequences
- Progressive Difficulty: Sequences get longer and faster as you advance
- Lives System: 3 lives per game with bonus lives on level up (max 5 lives)
- Educational Scoring: Points based on sequence length, level, and speed bonuses
- Large Touch Targets: Easy for small fingers to tap (44px minimum)
- Bright Colors: Engaging visual design with color-coded items
- Simple Navigation: Intuitive interface suitable for kids
- ๐ฃ๏ธ English Pronunciation: Each object is pronounced clearly to improve language skills
- Safe Content: All content appropriate for children
- Haptic Feedback: Vibration support on compatible devices
- Themed Categories: Each category has distinct visual identity
- Smooth Animations: Item appearances, selections, and transitions
- Sound Effects: Audio feedback for interactions and results
- Visual Feedback: Highlighting, pulsing, and celebration animations
- Responsive Design: Works perfectly on all screen sizes (320px to 4K)
- Difficulty Levels: Easy (3-4 items), Medium (4-6 items), Hard (6-8 items)
- Speed Settings: Slow, Medium, Fast sequence display
- Sound Toggle: Enable/disable audio feedback
- ๐ฃ๏ธ Pronunciation: Enable/disable English pronunciation of object names
- Settings Persistence: Preferences saved locally in browser
Option 1: Hosted Deployment (AWS Apache Web Server)
This instance is hosted on an AWS Ubuntu VM running the Apache Web Server.
Simply open index.html in any modern web browser - no server required!
For enhanced features and testing, use any web server:
# Using Python 3
python3 -m http.server 8080
# Using Node.js (if you have http-server installed)
npx http-server -p 8080
# Using PHP
php -S localhost:8080Then open your browser to http://localhost:8080
- Base Score: 100 points per correct sequence
- Level Bonus: +10 points ร current level
- Length Bonus: +5 points ร sequence length
- Speed Bonus: Fast (+20), Medium (+10), Slow (+0)
- 5 sequences per level before advancing
- Bonus life awarded on level up (maximum 5 lives)
- Increasing difficulty with longer sequences
- Speed increases at higher levels for added challenge
- 3 lives to start the game
- Lose 1 life for incorrect sequences
- Gain 1 life on level up (capped at 5 lives)
- Game over when all lives are lost
- Open
index.htmlin any modern web browser - Read the welcome message and game instructions
- Tap "๐ Choose Category" to see available themes
- Browse through 6 different themed categories
- Tap on a category card to select it
- Preview the items in your chosen category
- Tap "๐ฎ Start Game" to begin playing
- Watch Phase: Items from your chosen category appear in sequence on the magic tray
- Listen Phase: Each item name is pronounced clearly in English (if enabled)
- Memory Phase: Items disappear - remember the order and names!
- Recreation Phase: Tap items in the correct sequence (hear pronunciation again)
- Evaluation Phase: Get feedback and advance or try again
- Category Cards: Tap to select your preferred theme
- Item Selection: Tap items to select them in sequence
- ๐๏ธ Clear Button: Reset your current selection
- โ Submit Button: Check your sequence (auto-submits when complete)
- โธ๏ธ Pause Button: Pause during sequence display
- ๐ก Hint Button: Get helpful clues when stuck
- โ๏ธ Settings: Adjust difficulty, speed, and audio preferences
- Desktop: Optimized for mouse interaction and larger screens
- Tablet: Perfect touch targets and medium-sized interface
- Mobile: Large buttons and touch-friendly design
- All Screen Sizes: Works from 320px to 4K displays
- Special Optimization: Enhanced for common mobile dimensions
- Large Touch Targets: Minimum 44px for accessibility compliance
- Visual Feedback: Clear indication of all interactions
- Haptic Vibration: Physical feedback on supported devices
- Gesture Prevention: Avoids accidental actions during gameplay
- Enhanced Touch Events: Smooth mobile experience with proper event handling
- Smooth Animations: Optimized for mobile GPUs using CSS transforms
- Efficient Rendering: Minimal DOM manipulation and reflows
- Memory Management: Optimized for long play sessions
- Battery Optimization: Reduced motion options for power saving
- โ Chrome 60+ - Full support with all features
- โ Firefox 55+ - Full support with all features
- โ Safari 12+ - Full support with all features
- โ Edge 79+ - Full support with all features
- โ Mobile Browsers - iOS Safari, Chrome Mobile, Samsung Internet
- Pure HTML5/CSS3/JavaScript - No external dependencies
- CSS Grid & Flexbox - Modern responsive layouts
- CSS Animations - Hardware-accelerated transitions and effects
- Web Audio API - Sound effects with graceful fallbacks
- ๐ฃ๏ธ Web Speech API - Text-to-speech for pronunciation learning
- Local Storage API - Settings and preferences persistence
- Vibration API - Haptic feedback on compatible mobile devices
- CSS-only animations where possible for better performance
- Efficient DOM manipulation with minimal reflows and repaints
- Event delegation for better memory usage
- Optimized touch events specifically for mobile devices
- Responsive images and scalable vector graphics
This game helps develop:
- Working Memory - Holding sequences in mind while processing
- Pattern Recognition - Identifying relationships between items
- Attention & Focus - Concentrating during sequence displays
- Visual Processing - Quick identification of different objects
- Sequential Thinking - Understanding order and progression
- ๐ฃ๏ธ English Language Skills - Learning correct pronunciation and vocabulary
- Vocabulary Building - Expanding knowledge of themed categories
- Cognitive Flexibility - Switching between different categories and strategies
Perfect for:
- Early childhood education (ages 4-12)
- Brain training and cognitive exercise
- Memory improvement practice
- English language learning for children
- Special needs education with customizable difficulty
- Family fun and bonding activities
Game doesn't load properly:
- Ensure all files (
index.html,styles.css,game.js) are in the same directory - Try refreshing the browser (Ctrl+F5 or Cmd+Shift+R)
- Check browser console for errors (F12 Developer Tools)
- Verify JavaScript is enabled in browser settings
Buttons not working on mobile:
- Ensure you're using a modern mobile browser (Chrome/Firefox recommended)
- Try clearing browser cache and cookies
- Check if JavaScript is enabled
- Test in different browsers for compatibility
Sound/Pronunciation not working:
- Check if browser supports Web Audio API and Speech Synthesis
- Ensure sound is enabled in game settings (โ๏ธ Settings)
- Try a different browser (Chrome/Firefox have best support)
- Check device volume and browser audio permissions
Performance issues:
- Close other browser tabs to free up memory
- Try reducing animation settings in game options
- Use a newer device/browser for better performance
- Clear browser cache and restart browser
Touch controls not responsive:
- Ensure touch events are supported on your device
- Try tapping more firmly or holding slightly longer
- Check if screen protector is interfering with touch
- Test with different fingers or a stylus
Edit the objectPools object in game.js. For example, to add a new shape:
magic: {
name: 'โฆ Shapes',
description: 'Different Shapes',
items: [
// existing items...
{ id: 'hexagon', emoji: 'โฌก', color: 'item-custom', name: 'Hexagon' }
]
}- Add a new category to the
objectPoolsobject ingame.js - Include exactly 8 items with unique IDs, emojis, colors, and names
- Test the category thoroughly across different devices
- Update this README with the new category information
Modify sequence length ranges in the getSequenceLength() function:
const baseLengths = {
easy: { min: 2, max: 3 }, // Easier for young children
medium: { min: 4, max: 6 }, // Default balanced difficulty
hard: { min: 6, max: 8 } // Challenging for older kids
};- Colors: Modify CSS custom properties in
styles.css - Animations: Adjust keyframes and transition durations
- Layout: Change grid templates and spacing values
- Themes: Add new color schemes and visual styles
index.html- Main game interface, UI components, and structurestyles.css- All styling, animations, responsive design, and mobile optimizationgame.js- Complete game logic, state management, and user interactionsREADME.md- Comprehensive documentation and setup guide
MagicTrayGame- Main game class handling all game logic and stateobjectPools- Contains all category data and themed itemspronounceWord()- Text-to-speech functionality for educational purposesshowSequence()- Displays the sequence for players to memorizecheckSequence()- Validates player input against correct sequencesetupEventListeners()- Handles all user interactions and events
- Mobile-first approach with progressive enhancement
- Multiple breakpoints for different screen sizes and orientations
- Touch-optimized event handling with proper touch/click separation
- Flexible grid systems that adapt seamlessly to any screen size
- Focus intensely during the sequence display phase
- Use visualization techniques to remember item order
- Practice regularly to improve memory capacity and speed
- Start with easier settings and gradually increase difficulty
- Take breaks to avoid mental fatigue and maintain focus
- Use hints strategically when stuck on difficult sequences
- Pay attention to patterns in item selection and categories
- Practice pronunciation along with the game for language learning
- Try different categories to keep the game fresh and engaging
- Challenge family members for competitive fun and bonding
- โ Fixed responsive design issues at various mobile dimensions
- โ Improved touch event handling for better mobile interaction
- โ Enhanced button touch targets (minimum 44px for accessibility)
- โ Optimized CSS breakpoints for all screen sizes
- โ Better visual feedback for touch interactions
- โ Improved accessibility features and compliance
- โ Performance optimizations specifically for mobile devices
- Touch Events: Fixed interference between touch and click events
- Responsive Design: Added specific breakpoints for common mobile sizes
- Button Interaction: Enhanced touch targets and visual feedback systems
- Cross-Platform: Consistent experience across all devices and browsers
- Performance: Optimized animations and rendering for mobile hardware
If you encounter any issues or have suggestions for improvements:
- Check the troubleshooting section above for common solutions
- Test with the latest version of Chrome or Firefox
- Ensure JavaScript is enabled in your browser settings
- Try clearing browser cache and cookies
- Test on different devices to isolate device-specific issues
- Fork or download the project files
- Create a feature branch for your improvements
- Make your changes and test thoroughly on multiple devices
- Test across different browsers and screen sizes
- Update documentation as needed
- Submit your improvements with detailed descriptions
Enjoy your magical memory adventure! ๐ชโจ
Magic Tray Game - Where Learning Meets Fun!
Happy Learning and Playing! ๐ฎ๐ง โจ
This game is designed with love for children's education and cognitive development. Every feature has been carefully crafted to provide both entertainment and learning value.