Features
- Puzzle Gameplay: Flip tiles to find numbers while avoiding Voltorbs
- Score Multipliers: Multiply your score by finding higher numbers
- Level Progression: Advance through increasingly difficult levels
- Volume Integration: Syncs with global volume control
- Focus Detection: Pauses when window loses focus
- PostMessage API: Two-way communication with iframe
- Screen Size Detection: Blocks on screens smaller than 570x670
Component Structure
Location:src/WinXP/apps/VoltorbFlip/index.jsx
Configuration
Fromapps/index.jsx:
Screen Size Detection
Voltorb Flip requires a minimum screen size:PostMessage Communication
The game uses PostMessage API for iframe communication:Getting Target Origin
Sending Focus Messages
Sending Volume Messages
Receiving Ready Message
Message Types
From Web XP to Game
Focus Change
Volume Change
From Game to Web XP
Ready Message
Game Implementation
The game inside the iframe should implement:Gameplay
Objective
Flip tiles on a 5x5 grid to find numbers (2 or 3) while avoiding Voltorbs (0). Multiply your points by the numbers you find.Rules
-
Each row and column shows:
- Sum of all numbers in that row/column
- Number of Voltorbs in that row/column
-
Flip tiles to reveal:
- 2 or 3: Multiplies your current score
- 1: No multiplication (safe)
- Voltorb: Game over, lose all points for this round
- Complete a level by finding all 2s and 3s without hitting a Voltorb
- Advance to higher levels with more Voltorbs and higher rewards
Strategy
- Start with rows/columns that have 0 Voltorbs
- Look for rows with high sums and few Voltorbs
- Use logic to eliminate impossible tile values
- Cash out before risking it all on uncertain tiles
Focus Behavior
When the window loses focus:- Game automatically pauses
- Audio mutes (if not already muted)
- Prevents accidental moves
- Resumes when window regains focus
Volume Integration
The game volume is controlled by:- Global Volume: Master volume from taskbar
- Local Mute: Mute button in Web XP
- Effective Volume:
globalVolume * (isMuted ? 0 : 1)
Overlay for Unfocused State
Styling
Usage Example
Security Considerations
The PostMessage implementation includes security checks:Local Hosting
The game files should be inpublic/voltorb_flip/:
