Free Fall is an innovative 3D educational multiplayer game built with the Hytopia SDK where players fall through the air and must navigate to numbered blocks showing correct answers to math problems. Players complete 10 questions per game session with progressive difficulty and physics-based challenges.
- 3D Physics-Based Gameplay: Players free-fall through a numbered tunnel environment
- Educational Focus: Mental math problems with adaptive difficulty
- Progressive Challenge: Gravity increases as players answer correctly
- Cross-Platform Support: Desktop and mobile device compatibility
- Multiplayer Ready: Multiple players can play simultaneously
class FallingPlayerController extends BaseEntityController- Downward-facing camera for optimal falling perspective
- Movement constraints preventing upward movement during fall
- Platform detection for answer block interactions
- Cross-platform input handling (desktop keyboard + mobile touch)
class AnswerBlocksManager- Intelligent wrong answer generation using mathematical algorithms
- Block destruction effects with realistic fragment physics
- Position-based collision detection for precise interactions
- Visual feedback system with particle effects
- Beginner: Addition/Subtraction (1-20)
- Moderate: Extended range (1-50)
- Hard: All operations including multiplication/division (1-100)
- Adaptive gravity scaling increases challenge with progress
- Device detection system automatically identifies mobile vs desktop
- Responsive UI loading with appropriate control schemes
- Unified codebase with platform-specific optimizations
class NumberTunnelSystem- Procedural tunnel generation with 75 vertical segments
- Rotating decorative elements using Hytopia logo textures
- Optimized block placement for performance
class CloudSystem- Scattered cloud formations for atmospheric depth
- Sensor-based colliders for non-blocking decoration
- Configurable density and distribution
- Game Logic: Complete 10-question math game cycle
- Physics System: Gravity manipulation and collision detection
- Audio System: Background music with context-aware playback
- UI System: Device detection and responsive interfaces
- Fragment Effects: Realistic block destruction physics
- Multiplayer Support: Multiple simultaneous players
- Educational Content: Progressive difficulty math problems
- Entity cleanup prevents memory leaks
- Music state management based on active players
- Efficient collision detection using sensor colliders
- Reduced tunnel complexity for optimal performance
All enhancements below have been verified as feasible within the Hytopia SDK capabilities.
enum PowerUpType {
SLOW_TIME = "slow_time", // Reduces gravity temporarily
EXTRA_LIFE = "extra_life", // Forgives one wrong answer
SCORE_MULTIPLIER = "multiplier", // 2x points for next 3 answers
HINT_REVEAL = "hint" // Shows one wrong answer to eliminate
}SDK Features Used: Entity creation, collision detection, timers, custom properties
class FragmentPool {
private static _fragments: Entity[] = [];
static getFragment(): Entity
static returnFragment(fragment: Entity): void
}SDK Features Used: Entity management, spawning/despawning, object lifecycle
- Particle trails during player fall using
world.createParticleEffect() - Enhanced fragment effects with varied textures and physics
- Score visualization with floating damage numbers SDK Features Used: Particle effects, entity positioning, visual feedback
interface CurriculumLevel {
grade: number;
topics: MathTopic[];
progressionRequirements: ProgressionCriteria;
}
enum MathTopic {
BASIC_ARITHMETIC = "arithmetic",
FRACTIONS = "fractions",
DECIMALS = "decimals",
WORD_PROBLEMS = "word_problems"
}SDK Features Used: Event system, data management, UI communication
- Performance tracking across different math topics
- Adaptive difficulty based on individual player progress
- Progress visualization in UI SDK Features Used: UI system, data persistence, player tracking
enum Achievement {
SPEED_DEMON = "speed_demon", // Answer 5 questions in under 30 seconds
PERFECTIONIST = "perfectionist", // Complete a round with no wrong answers
STREAK_MASTER = "streak_master" // Achieve 20 consecutive correct answers
}SDK Features Used: Event system, player data, UI notifications
- Simultaneous player falling with shared question sets
- Real-time leaderboards using UI system
- Race-specific scoring with time bonuses SDK Features Used: Multiplayer support, UI system, entity management
- Collaborative problem-solving where teams share questions
- Team score aggregation and victory conditions
- Communication tools using chat system SDK Features Used: Player grouping, chat system, shared game state
interface LeaderboardEntry {
username: string;
bestScore: number;
averageTime: number;
gamesPlayed: number;
rank: number;
}SDK Features Used: UI system, data management, player tracking
- Gesture-based movement for more intuitive mobile play
- Haptic feedback integration where supported
- Optimized touch targets for mobile interfaces SDK Features Used: Input system, UI responsiveness, device detection
class PerformanceMonitor {
private _frameTime: number = 0;
private _entityCount: number = 0;
public trackPerformance(deltaTimeMs: number): void
public getMetrics(): PerformanceMetrics
}SDK Features Used: Tick event system, entity counting, custom metrics
- Colorblind-friendly UI with alternative visual indicators
- Adjustable text sizes for better readability
- Audio cues for important game events SDK Features Used: UI customization, audio system, event handling
Free-fall/
├── assets/
│ ├── audio/ # Comprehensive sound library
│ │ ├── music/ # Background music tracks
│ │ └── sfx/ # Sound effects organized by category
│ ├── blocks/ # Block textures including numbered blocks
│ ├── models/ # 3D models for entities and environment
│ └── ui/ # User interface files
├── index.ts # Main game server (1,969 lines)
├── mobile.ts # Mobile-specific implementation
├── package.json # Project dependencies
└── README.md # This file
- Music: 11 themed background tracks
- SFX: 200+ sound effects organized by category
- Entity sounds: 50+ creature/NPC sounds
- Environmental: Weather, ambient, material-specific sounds
- Player actions: Movement, combat, interaction sounds
- UI feedback: Button clicks, notifications, game state sounds
- Spatial audio for 3D sound positioning
- Context-aware music that starts/stops based on player activity
- Volume management with proper audio cleanup
- Multiple audio channels for music, SFX, and ambient sounds
- Block Textures: 100+ including numbered blocks (0-15)
- 3D Models: Player, NPCs, items, environment, projectiles
- UI Elements: Icons, fonts, logos, interface components
- Environmental: Skyboxes, particle textures, effect materials
- Texture atlasing for better performance
- LOD system for distant objects
- Asset preloading for smoother gameplay
- Bun: Runtime and package manager
- TypeScript: Primary development language
- Hytopia SDK: Game engine and framework
# Install dependencies
bun install
# Run the game (avoid watch mode on Windows due to Bun issue)
bun run index.ts
# For mobile testing
bun run mobile.ts- Bun Watch Mode: Use
bun run index.tsinstead ofbun --watchon Windows - Mobile Detection: Comprehensive device detection with fallback timeout
- Performance: Fragment pooling recommended for better optimization
- Progressive Difficulty: Adapts to player skill level
- Immediate Feedback: Visual and audio confirmation of answers
- Engagement Mechanics: Game-like elements maintain interest
- Skill Building: Mental math practice with time pressure
- Elementary Math: Addition, subtraction fundamentals
- Intermediate Skills: Multiplication, division, larger numbers
- Advanced Applications: Word problems, mixed operations
- AI-Powered Tutoring: Personalized learning paths
- VR Integration: Immersive falling experience
- Parent/Teacher Dashboard: Progress monitoring tools
- Classroom Integration: Shared sessions for schools
- Custom Content Creator: User-generated math problems
- Advanced Physics: More realistic falling mechanics
- Procedural Generation: Infinite tunnel variations
- Machine Learning: Adaptive difficulty algorithms
- Analytics Integration: Detailed learning metrics
- Modular Architecture: Separated systems for maintainability
- Error Handling: Comprehensive try-catch blocks
- TypeScript: Strong typing for reliability
- Documentation: Clear code comments and structure
- 60 FPS Target: Optimized for smooth gameplay
- Memory Management: Proper cleanup and pooling
- Network Efficiency: Minimal bandwidth usage
- Cross-Platform: Consistent experience across devices
- Feature Branches: Separate branches for each enhancement
- Code Review: Peer review for all changes
- Testing: Comprehensive testing on desktop and mobile
- Documentation: Update README for significant changes
- TypeScript: Strict typing enabled
- Naming: Clear, descriptive variable and function names
- Comments: Explain complex logic and game mechanics
- Performance: Consider impact on frame rate and memory
- Framework: Hytopia SDK
- Language: TypeScript
- Platform: Cross-platform (Desktop/Mobile)
- Type: Educational Game
- Audio Library: Comprehensive game audio collection
- 3D Models: Player, environment, and entity models
- Textures: High-quality block and UI textures
Free Fall represents a sophisticated implementation of educational gaming principles using modern 3D web technology. The combination of engaging gameplay mechanics, comprehensive educational content, and robust technical architecture makes it an excellent foundation for expanding educational game development.
For technical questions or contribution inquiries, please refer to the codebase documentation and SDK guides.