Class_generator/test-river-run.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

108 lines
4.0 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test River Run Game</title>
<style>
body { margin: 0; padding: 20px; font-family: Arial, sans-serif; }
#container { width: 100%; height: 85vh; border: 2px solid #ddd; border-radius: 10px; }
.controls { margin-bottom: 20px; }
button { padding: 10px 20px; margin: 5px; border: none; border-radius: 5px; background: #4682B4; color: white; cursor: pointer; }
button:hover { background: #5F9EA0; }
.info { background: #E6F7FF; padding: 15px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid #4682B4; }
</style>
</head>
<body>
<h1>🌊 Test: River Run Game</h1>
<div class="info">
<h3>🎯 Testing River Run with French Beginner Story</h3>
<p><strong>Gameplay:</strong></p>
<ul>
<li>🛶 Click anywhere to move your boat</li>
<li>🎯 Target word appears at top - find and catch it!</li>
<li>❌ Avoid all other floating words (obstacles)</li>
<li>⚡ Collect power-ups for bonuses</li>
<li>📈 Speed increases as you progress</li>
</ul>
<p><strong>Expected:</strong> Endless river runner with French vocabulary</p>
</div>
<div class="controls">
<button onclick="startGame()">🚀 Start River Run</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/french-beginner-story.js"></script>
<script src="js/games/river-run.js"></script>
<script>
let currentGame = null;
function startGame() {
try {
const container = document.getElementById('container');
const content = window.ContentModules.FrenchBeginnerStory;
if (!content) {
console.error('❌ French Beginner Story content not found');
return;
}
console.log('✅ Content loaded:', content.name);
console.log('🔤 Vocabulary available:', Object.keys(content.vocabulary || {}).length);
// Log some vocabulary examples
if (content.vocabulary) {
const words = Object.keys(content.vocabulary).slice(0, 5);
console.log('📝 Sample words:', words.join(', '));
}
currentGame = new window.GameModules.RiverRun({
container: container,
content: content,
onScoreUpdate: score => console.log('📊 Score updated:', score),
onGameEnd: score => console.log('🏁 Game ended with score:', score)
});
console.log('🌊 River Run started! Click to begin sailing!');
} catch (error) {
console.error('❌ Error starting game:', error);
console.error('Stack trace:', error.stack);
}
}
function restartGame() {
if (currentGame && currentGame.restart) {
currentGame.restart();
console.log('🔄 Game restarted');
}
}
// Auto-load when page loads
window.addEventListener('load', () => {
console.log('🔧 Testing River Run...');
console.log('💡 Instructions: Click anywhere on the river to move your boat!');
setTimeout(startGame, 500);
});
</script>
</body>
</html>