Class_generator/test-grammar-discovery.html
StillHammer e50dd624a0 Add comprehensive game suite with TTS integration and content modules
🎮 NEW GAMES:
- River Run: Endless runner with word collection and guaranteed target spawning
- Grammar Discovery: Focused grammar learning with 8-step rotation cycles
- Letter Discovery: Letter-first alphabet learning with progression system
- Enhanced Word Discovery: Shuffled practice mode with image support and auto-TTS

📚 NEW CONTENT MODULES:
- WTA1B-1: English letters U,V,T with pets vocabulary and Chinese translation
- SBS-1: English "To Be" introduction with comprehensive grammar lessons
- French Beginner Story: Story content for English speakers learning French

🔊 TTS ENHANCEMENTS:
- Story Reader: Multi-story support with TTS for sentences and individual words
- Adventure Reader: Auto-TTS for vocabulary popups and sentence modals
- Word Discovery: Immediate TTS playback with difficulty-based speed control
- Integrated SettingsManager compatibility across all games

🎯 GAMEPLAY IMPROVEMENTS:
- River Run: Target word guaranteed within 10 spawns, progressive spacing
- Story Reader: Story selector dropdown with independent progress tracking
- Adventure Reader: Fixed HUD overlap issue with proper viewport spacing
- Enhanced punctuation preservation in Story Reader word parsing

 SYSTEM UPDATES:
- Content scanner integration for all new modules
- Game loader mappings for seamless content discovery
- Simplified content titles: "WTA1B-1" and "SBS-1" for easy identification
- Comprehensive test files for isolated game development

🎉 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-20 09:15:01 +08:00

92 lines
3.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Grammar Discovery Test</title>
<style>
body { margin: 0; padding: 20px; font-family: Arial, sans-serif; }
#container { width: 100%; height: 80vh; border: 2px solid #ddd; border-radius: 10px; }
.controls { margin-bottom: 20px; }
button { padding: 10px 20px; margin: 5px; border: none; border-radius: 5px; background: #667eea; color: white; cursor: pointer; }
button:hover { background: #5a67d8; }
</style>
</head>
<body>
<h1>🎓 Grammar Discovery Game Test</h1>
<div class="controls">
<button onclick="startGame()">🚀 Start Game</button>
<button onclick="restartGame()">🔄 Restart</button>
</div>
<div id="container"></div>
<script>
// Mock dependencies
window.logSh = (msg, level) => console.log(`[${level}] ${msg}`);
window.Utils = { storage: { get: () => [], set: () => {} } };
window.GameModules = {};
window.ContentModules = {};
// Mock SettingsManager for TTS
window.SettingsManager = {
speak: (text, options = {}) => {
console.log(`🔊 TTS: "${text}" (${options.lang || 'auto'} at ${options.rate || 1.0}x)`);
return Promise.resolve();
}
};
</script>
<script src="js/content/grammar-lesson-le.js"></script>
<script src="js/games/grammar-discovery.js"></script>
<script>
let currentGame = null;
function startGame() {
try {
const container = document.getElementById('container');
const content = window.ContentModules.GrammarLessonLe;
if (!content) {
console.error('❌ Grammar lesson content not found');
return;
}
console.log('✅ Content loaded:', content.name);
console.log('📚 Grammar topics:', Object.keys(content.grammar || {}));
currentGame = new window.GameModules.GrammarDiscovery({
container: container,
content: content,
onScoreUpdate: score => console.log('📊 Score updated:', score),
onGameEnd: score => console.log('🏁 Game ended with score:', score)
});
console.log('🎮 Grammar Discovery game started!');
} catch (error) {
console.error('❌ Error starting game:', error);
}
}
function restartGame() {
if (currentGame && currentGame.restart) {
currentGame.restart();
console.log('🔄 Game restarted');
}
}
// Auto-start when page loads
window.addEventListener('load', () => {
console.log('🔧 Testing NEW CONCEPT SELECTOR Grammar Discovery...');
console.log('🎯 Features:');
console.log('- Dropdown to select specific grammar concept');
console.log('- Preview with statistics for selected concept');
console.log('- Laser focus on chosen concept only');
console.log('- 8-step rotation system for focused learning');
console.log('✅ Concept selector system ready!');
setTimeout(startGame, 500);
});
</script>
</body>
</html>