react-native-games 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -130
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +116 -343
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +182 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +123 -101
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +119 -92
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +123 -113
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +137 -23
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameBackground.js +8 -83
- package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +15 -22
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -4
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinja.js +143 -0
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +148 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -0
- package/lib/module/games/{fruit-slicer/FruitSlicerService.js → fruit-ninja/FruitNinjaService.js} +43 -21
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +191 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.js +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js +215 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameBackground.js +250 -304
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.js +17 -47
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/index.js +7 -0
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +184 -169
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +100 -0
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunnerService.js +37 -14
- package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +20 -15
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
- package/lib/module/games/maze-runner/components/GameBackground.js +151 -192
- package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +15 -25
- package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
- package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/index.js +0 -2
- package/lib/module/games/maze-runner/components/index.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +294 -0
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +113 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js +132 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +163 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +198 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +165 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js.map +1 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js +177 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +75 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/popit-fidget/components/index.js +7 -0
- package/lib/module/games/popit-fidget/components/index.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighter.js +169 -0
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +108 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -0
- package/lib/module/games/{space-traveller/SpaceTravellerService.js → space-fighter/SpaceFighterService.js} +48 -21
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js +195 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/AsteroidComponent.js +7 -5
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameArea.js +295 -0
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/GameBackground.js +10 -65
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/ScoreBoard.js +20 -26
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/Spacecraft3D.js +72 -111
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +52 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/index.js +0 -4
- package/lib/module/games/space-fighter/components/index.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js +263 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +115 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +120 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +172 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameBackground.js +31 -91
- package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js +97 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameHole.js +67 -54
- package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -0
- package/lib/module/games/{cat-popper/components/CatCharacter.js → whack-a-mole/components/MoleCharacter.js} +75 -115
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/ScoreBoard.js +13 -17
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/index.js +1 -3
- package/lib/module/games/whack-a-mole/components/index.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +41 -519
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +35 -23
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +77 -0
- package/lib/module/services/HapticsService.js.map +1 -0
- package/lib/module/services/SoundsService.js +171 -0
- package/lib/module/services/SoundsService.js.map +1 -0
- package/lib/module/shared/helpers/AnimationFrame.js +120 -0
- package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
- package/lib/module/shared/helpers/AnimationTracker.js +89 -0
- package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
- package/lib/module/shared/helpers/ErrorHandler.js +269 -0
- package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
- package/lib/module/shared/helpers/GameControlButton.js +219 -0
- package/lib/module/shared/helpers/GameControlButton.js.map +1 -0
- package/lib/module/{games/balloon-blaster/components → shared/helpers}/GameOverModal.js +25 -17
- package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
- package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
- package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
- package/lib/module/shared/helpers/ParticleBlast.js +133 -0
- package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js +81 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js.map +1 -0
- package/lib/module/shared/helpers/index.js +12 -0
- package/lib/module/shared/helpers/index.js.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +144 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +12 -2
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -4
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +4 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +112 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerService.d.ts → fruit-ninja/FruitNinjaService.d.ts} +13 -5
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerStore.d.ts → fruit-ninja/FruitNinjaStore.d.ts} +13 -4
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.d.ts +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/FruitComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +5 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -16
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +41 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +4 -2
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +2 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -2
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +45 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +33 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +36 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +9 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +4 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +71 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerService.d.ts → space-fighter/SpaceFighterService.d.ts} +7 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerStore.d.ts → space-fighter/SpaceFighterStore.d.ts} +12 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +8 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/Spacecraft3D.d.ts +1 -1
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/index.d.ts +0 -4
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +4 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +79 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts +33 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts +41 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameGrid.d.ts +2 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameHole.d.ts +3 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameHole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts +7 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +6 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +61 -340
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +21 -3
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/HapticsService.d.ts +16 -0
- package/lib/typescript/src/services/HapticsService.d.ts.map +1 -0
- package/lib/typescript/src/services/SoundsService.d.ts +154 -0
- package/lib/typescript/src/services/SoundsService.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts +17 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -0
- package/lib/typescript/src/{games/cat-popper/components → shared/helpers}/GameOverModal.d.ts +5 -0
- package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts +42 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/index.d.ts +13 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -0
- package/package.json +9 -6
- package/lib/module/games/balloon-blaster/components/GameControls.js +0 -229
- package/lib/module/games/balloon-blaster/components/GameControls.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -52
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
- package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopper.js +0 -230
- package/lib/module/games/cat-popper/CatPopper.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperService.js +0 -100
- package/lib/module/games/cat-popper/CatPopperService.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperStore.js +0 -113
- package/lib/module/games/cat-popper/CatPopperStore.js.map +0 -1
- package/lib/module/games/cat-popper/components/CatCharacter.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameBackground.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameControls.js +0 -230
- package/lib/module/games/cat-popper/components/GameControls.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameGrid.js +0 -66
- package/lib/module/games/cat-popper/components/GameGrid.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameHole.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameOverModal.js +0 -131
- package/lib/module/games/cat-popper/components/GameOverModal.js.map +0 -1
- package/lib/module/games/cat-popper/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/cat-popper/components/index.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicer.js +0 -411
- package/lib/module/games/fruit-slicer/FruitSlicer.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js +0 -156
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameArea.js +0 -50
- package/lib/module/games/fruit-slicer/components/GameArea.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameBackground.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameControls.js +0 -230
- package/lib/module/games/fruit-slicer/components/GameControls.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameOverModal.js +0 -189
- package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js +0 -52
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/SliceTrail.js +0 -58
- package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/index.js +0 -11
- package/lib/module/games/fruit-slicer/components/index.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameControls.js +0 -129
- package/lib/module/games/maze-runner/components/GameControls.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
- package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTraveller.js +0 -393
- package/lib/module/games/space-traveller/SpaceTraveller.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerService.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerStore.js +0 -139
- package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +0 -1
- package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameArea.js +0 -75
- package/lib/module/games/space-traveller/components/GameArea.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameBackground.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameControls.js +0 -177
- package/lib/module/games/space-traveller/components/GameControls.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameOverModal.js +0 -182
- package/lib/module/games/space-traveller/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/ParticleComponent.js +0 -34
- package/lib/module/games/space-traveller/components/ParticleComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/space-traveller/components/SettingsModal.js +0 -222
- package/lib/module/games/space-traveller/components/SettingsModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +0 -1
- package/lib/module/games/space-traveller/components/SpacecraftPath.js +0 -37
- package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +0 -1
- package/lib/module/games/space-traveller/components/index.js.map +0 -1
- package/lib/module/shared/settings/GameSettings.js +0 -295
- package/lib/module/shared/settings/GameSettings.js.map +0 -1
- package/lib/module/shared/settings/SettingsService.js +0 -119
- package/lib/module/shared/settings/SettingsService.js.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +0 -13
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +0 -32
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +0 -21
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +0 -7
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/index.d.ts +0 -8
- package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +0 -16
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
- package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -32
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
- /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → space-fighter}/components/SpacecraftPath.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → whack-a-mole}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/ScoreBoard.d.ts +0 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Error types for game-specific error handling
|
|
7
|
+
*/
|
|
8
|
+
export let GameErrorType = /*#__PURE__*/function (GameErrorType) {
|
|
9
|
+
GameErrorType["INITIALIZATION_ERROR"] = "INITIALIZATION_ERROR";
|
|
10
|
+
GameErrorType["ANIMATION_ERROR"] = "ANIMATION_ERROR";
|
|
11
|
+
GameErrorType["STORAGE_ERROR"] = "STORAGE_ERROR";
|
|
12
|
+
GameErrorType["SOUND_ERROR"] = "SOUND_ERROR";
|
|
13
|
+
GameErrorType["HAPTIC_ERROR"] = "HAPTIC_ERROR";
|
|
14
|
+
GameErrorType["GESTURE_ERROR"] = "GESTURE_ERROR";
|
|
15
|
+
GameErrorType["PERFORMANCE_ERROR"] = "PERFORMANCE_ERROR";
|
|
16
|
+
GameErrorType["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
17
|
+
GameErrorType["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
18
|
+
return GameErrorType;
|
|
19
|
+
}({});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Game error interface
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Error handler configuration
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Default error handler configuration
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_ERROR_CONFIG = {
|
|
33
|
+
enableLogging: __DEV__,
|
|
34
|
+
enableConsoleOutput: __DEV__,
|
|
35
|
+
maxErrorHistory: 50,
|
|
36
|
+
enableCrashRecovery: true
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Game error handler class
|
|
41
|
+
*/
|
|
42
|
+
export class GameErrorHandler {
|
|
43
|
+
errorHistory = [];
|
|
44
|
+
errorCounts = new Map();
|
|
45
|
+
constructor(config = {}) {
|
|
46
|
+
this.config = {
|
|
47
|
+
...DEFAULT_ERROR_CONFIG,
|
|
48
|
+
...config
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Handle a game error
|
|
54
|
+
*/
|
|
55
|
+
handleError(type, message, gameId, context) {
|
|
56
|
+
const error = {
|
|
57
|
+
type,
|
|
58
|
+
message,
|
|
59
|
+
gameId,
|
|
60
|
+
timestamp: Date.now(),
|
|
61
|
+
stack: new Error().stack,
|
|
62
|
+
context
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Add to error history
|
|
66
|
+
this.errorHistory.push(error);
|
|
67
|
+
if (this.errorHistory.length > this.config.maxErrorHistory) {
|
|
68
|
+
this.errorHistory.shift();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Update error counts
|
|
72
|
+
const currentCount = this.errorCounts.get(type) || 0;
|
|
73
|
+
this.errorCounts.set(type, currentCount + 1);
|
|
74
|
+
|
|
75
|
+
// Log error if enabled
|
|
76
|
+
if (this.config.enableLogging && this.config.enableConsoleOutput) {
|
|
77
|
+
this.logError(error);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Call custom error handler if provided
|
|
81
|
+
if (this.config.onError) {
|
|
82
|
+
try {
|
|
83
|
+
this.config.onError(error);
|
|
84
|
+
} catch (handlerError) {
|
|
85
|
+
console.error('Error in custom error handler:', handlerError);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Wrap a function with error handling
|
|
92
|
+
*/
|
|
93
|
+
wrapFunction(fn, errorType, gameId) {
|
|
94
|
+
return (...args) => {
|
|
95
|
+
try {
|
|
96
|
+
const result = fn(...args);
|
|
97
|
+
|
|
98
|
+
// Handle async functions
|
|
99
|
+
if (result && typeof result.catch === 'function') {
|
|
100
|
+
return result.catch(error => {
|
|
101
|
+
this.handleError(errorType, error.message || 'Async function error', gameId, {
|
|
102
|
+
functionName: fn.name,
|
|
103
|
+
args
|
|
104
|
+
});
|
|
105
|
+
throw error;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
} catch (error) {
|
|
110
|
+
this.handleError(errorType, error instanceof Error ? error.message : 'Unknown error', gameId, {
|
|
111
|
+
functionName: fn.name,
|
|
112
|
+
args
|
|
113
|
+
});
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Safe execution with error recovery
|
|
121
|
+
*/
|
|
122
|
+
safeExecute(fn, fallback, errorType, gameId) {
|
|
123
|
+
try {
|
|
124
|
+
return fn();
|
|
125
|
+
} catch (error) {
|
|
126
|
+
this.handleError(errorType, error instanceof Error ? error.message : 'Safe execution failed', gameId, {
|
|
127
|
+
fallback
|
|
128
|
+
});
|
|
129
|
+
return fallback;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Safe async execution with error recovery
|
|
135
|
+
*/
|
|
136
|
+
async safeExecuteAsync(fn, fallback, errorType, gameId) {
|
|
137
|
+
try {
|
|
138
|
+
return await fn();
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.handleError(errorType, error instanceof Error ? error.message : 'Safe async execution failed', gameId, {
|
|
141
|
+
fallback
|
|
142
|
+
});
|
|
143
|
+
return fallback;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Get error statistics
|
|
149
|
+
*/
|
|
150
|
+
getErrorStats() {
|
|
151
|
+
const errorsByType = {};
|
|
152
|
+
for (const [type, count] of this.errorCounts.entries()) {
|
|
153
|
+
errorsByType[type] = count;
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
totalErrors: this.errorHistory.length,
|
|
157
|
+
errorsByType,
|
|
158
|
+
recentErrors: this.errorHistory.slice(-10)
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Clear error history
|
|
164
|
+
*/
|
|
165
|
+
clearHistory() {
|
|
166
|
+
this.errorHistory = [];
|
|
167
|
+
this.errorCounts.clear();
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Update configuration
|
|
172
|
+
*/
|
|
173
|
+
updateConfig(config) {
|
|
174
|
+
this.config = {
|
|
175
|
+
...this.config,
|
|
176
|
+
...config
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Log error to console
|
|
182
|
+
*/
|
|
183
|
+
logError(error) {
|
|
184
|
+
const prefix = error.gameId ? `[${error.gameId}]` : '[Game]';
|
|
185
|
+
console.error(`${prefix} ${error.type}: ${error.message}`, {
|
|
186
|
+
timestamp: new Date(error.timestamp).toISOString(),
|
|
187
|
+
context: error.context,
|
|
188
|
+
stack: error.stack
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Global error handler instance
|
|
195
|
+
*/
|
|
196
|
+
export const globalErrorHandler = new GameErrorHandler();
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* React hook for error handling in game components
|
|
200
|
+
*/
|
|
201
|
+
export function useGameErrorHandler(gameId, config = {}) {
|
|
202
|
+
const handlerRef = useRef(null);
|
|
203
|
+
|
|
204
|
+
// Initialize handler
|
|
205
|
+
if (!handlerRef.current) {
|
|
206
|
+
handlerRef.current = new GameErrorHandler(config);
|
|
207
|
+
}
|
|
208
|
+
const handleError = useCallback((type, message, context) => {
|
|
209
|
+
handlerRef.current?.handleError(type, message, gameId, context);
|
|
210
|
+
}, [gameId]);
|
|
211
|
+
const wrapFunction = useCallback((fn, errorType) => {
|
|
212
|
+
return handlerRef.current?.wrapFunction(fn, errorType, gameId) || fn;
|
|
213
|
+
}, [gameId]);
|
|
214
|
+
const safeExecute = useCallback((fn, fallback, errorType) => {
|
|
215
|
+
return handlerRef.current?.safeExecute(fn, fallback, errorType, gameId) || fallback;
|
|
216
|
+
}, [gameId]);
|
|
217
|
+
const safeExecuteAsync = useCallback((fn, fallback, errorType) => {
|
|
218
|
+
return handlerRef.current?.safeExecuteAsync(fn, fallback, errorType, gameId) || Promise.resolve(fallback);
|
|
219
|
+
}, [gameId]);
|
|
220
|
+
return {
|
|
221
|
+
handleError,
|
|
222
|
+
wrapFunction,
|
|
223
|
+
safeExecute,
|
|
224
|
+
safeExecuteAsync,
|
|
225
|
+
errorStats: handlerRef.current?.getErrorStats() || {
|
|
226
|
+
totalErrors: 0,
|
|
227
|
+
errorsByType: {},
|
|
228
|
+
recentErrors: []
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Error boundary utility for wrapping functions with error handling
|
|
235
|
+
*/
|
|
236
|
+
export function withErrorHandling(fn, gameId, errorType = GameErrorType.UNKNOWN_ERROR) {
|
|
237
|
+
return globalErrorHandler.wrapFunction(fn, errorType, gameId);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Utility functions for common error scenarios
|
|
242
|
+
*/
|
|
243
|
+
export const ErrorUtils = {
|
|
244
|
+
/**
|
|
245
|
+
* Handle animation errors safely
|
|
246
|
+
*/
|
|
247
|
+
safeAnimate: (animationFn, gameId, fallback) => {
|
|
248
|
+
globalErrorHandler.safeExecute(animationFn, fallback ? fallback() : undefined, GameErrorType.ANIMATION_ERROR, gameId);
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
* Handle sound errors safely
|
|
252
|
+
*/
|
|
253
|
+
safePlaySound: (soundFn, gameId) => {
|
|
254
|
+
globalErrorHandler.safeExecute(soundFn, undefined, GameErrorType.SOUND_ERROR, gameId);
|
|
255
|
+
},
|
|
256
|
+
/**
|
|
257
|
+
* Handle haptic errors safely
|
|
258
|
+
*/
|
|
259
|
+
safeHaptic: (hapticFn, gameId) => {
|
|
260
|
+
globalErrorHandler.safeExecute(hapticFn, undefined, GameErrorType.HAPTIC_ERROR, gameId);
|
|
261
|
+
},
|
|
262
|
+
/**
|
|
263
|
+
* Handle gesture errors safely
|
|
264
|
+
*/
|
|
265
|
+
safeGesture: (gestureFn, gameId) => {
|
|
266
|
+
globalErrorHandler.safeExecute(gestureFn, undefined, GameErrorType.GESTURE_ERROR, gameId);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
//# sourceMappingURL=ErrorHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useRef","GameErrorType","DEFAULT_ERROR_CONFIG","enableLogging","__DEV__","enableConsoleOutput","maxErrorHistory","enableCrashRecovery","GameErrorHandler","errorHistory","errorCounts","Map","constructor","config","handleError","type","message","gameId","context","error","timestamp","Date","now","stack","Error","push","length","shift","currentCount","get","set","logError","onError","handlerError","console","wrapFunction","fn","errorType","args","result","catch","functionName","name","safeExecute","fallback","safeExecuteAsync","getErrorStats","errorsByType","count","entries","totalErrors","recentErrors","slice","clearHistory","clear","updateConfig","prefix","toISOString","globalErrorHandler","useGameErrorHandler","handlerRef","current","Promise","resolve","errorStats","withErrorHandling","UNKNOWN_ERROR","ErrorUtils","safeAnimate","animationFn","undefined","ANIMATION_ERROR","safePlaySound","soundFn","SOUND_ERROR","safeHaptic","hapticFn","HAPTIC_ERROR","safeGesture","gestureFn","GESTURE_ERROR"],"sourceRoot":"../../../../src","sources":["shared/helpers/ErrorHandler.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,OAAO;;AAE3C;AACA;AACA;AACA,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;;AAYzB;AACA;AACA;;AAUA;AACA;AACA;;AASA;AACA;AACA;AACA,OAAO,MAAMC,oBAAwC,GAAG;EACtDC,aAAa,EAAEC,OAAO;EACtBC,mBAAmB,EAAED,OAAO;EAC5BE,eAAe,EAAE,EAAE;EACnBC,mBAAmB,EAAE;AACvB,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,CAAC;EAEpBC,YAAY,GAAgB,EAAE;EAC9BC,WAAW,GAA+B,IAAIC,GAAG,CAAC,CAAC;EAE3DC,WAAWA,CAACC,MAAmC,GAAG,CAAC,CAAC,EAAE;IACpD,IAAI,CAACA,MAAM,GAAG;MAAE,GAAGX,oBAAoB;MAAE,GAAGW;IAAO,CAAC;EACtD;;EAEA;AAC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SAAqB,EACrB9D,MAAc,KACL;IACTyC,kBAAkB,CAACf,WAAW,CAC5BoC,SAAS,EACTT,SAAS,EACTrE,aAAa,CAAC+E,aAAa,EAC3B/D,MACF,CAAC;EACH;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useEffect, useMemo } from 'react';
|
|
4
|
+
import { View, TouchableOpacity, Text, StyleSheet, Animated } from 'react-native';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const GameControlButton = /*#__PURE__*/React.memo(({
|
|
7
|
+
isPlaying,
|
|
8
|
+
gameOver,
|
|
9
|
+
onStartGame,
|
|
10
|
+
onStopGame,
|
|
11
|
+
startButtonText = 'START GAME',
|
|
12
|
+
stopButtonText = 'STOP GAME',
|
|
13
|
+
startButtonSubtext = 'Begin playing!',
|
|
14
|
+
stopButtonSubtext = 'End current game',
|
|
15
|
+
startButtonColor = '#10b981',
|
|
16
|
+
stopButtonColor = '#dc2626',
|
|
17
|
+
startButtonBorderColor = '#34d399',
|
|
18
|
+
stopButtonBorderColor = '#f87171'
|
|
19
|
+
}) => {
|
|
20
|
+
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
21
|
+
const pulseAnim = useRef(new Animated.Value(1)).current;
|
|
22
|
+
const glowAnim = useRef(new Animated.Value(0)).current;
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!isPlaying) {
|
|
25
|
+
const pulseAnimation = Animated.loop(Animated.sequence([Animated.timing(pulseAnim, {
|
|
26
|
+
toValue: 1.05,
|
|
27
|
+
duration: 1000,
|
|
28
|
+
useNativeDriver: true
|
|
29
|
+
}), Animated.timing(pulseAnim, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 1000,
|
|
32
|
+
useNativeDriver: true
|
|
33
|
+
})]));
|
|
34
|
+
pulseAnimation.start();
|
|
35
|
+
return () => pulseAnimation.stop();
|
|
36
|
+
}
|
|
37
|
+
return () => {};
|
|
38
|
+
}, [isPlaying, gameOver, pulseAnim]);
|
|
39
|
+
|
|
40
|
+
// Glow animation for stop button
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (isPlaying) {
|
|
43
|
+
const glowAnimation = Animated.loop(Animated.sequence([Animated.timing(glowAnim, {
|
|
44
|
+
toValue: 1,
|
|
45
|
+
duration: 800,
|
|
46
|
+
useNativeDriver: false
|
|
47
|
+
}), Animated.timing(glowAnim, {
|
|
48
|
+
toValue: 0,
|
|
49
|
+
duration: 800,
|
|
50
|
+
useNativeDriver: false
|
|
51
|
+
})]));
|
|
52
|
+
glowAnimation.start();
|
|
53
|
+
return () => glowAnimation.stop();
|
|
54
|
+
}
|
|
55
|
+
return () => {};
|
|
56
|
+
}, [isPlaying, glowAnim]);
|
|
57
|
+
const handlePressIn = () => {
|
|
58
|
+
Animated.spring(scaleAnim, {
|
|
59
|
+
toValue: 0.95,
|
|
60
|
+
useNativeDriver: true
|
|
61
|
+
}).start();
|
|
62
|
+
};
|
|
63
|
+
const handlePressOut = () => {
|
|
64
|
+
Animated.spring(scaleAnim, {
|
|
65
|
+
toValue: 1,
|
|
66
|
+
friction: 3,
|
|
67
|
+
tension: 40,
|
|
68
|
+
useNativeDriver: true
|
|
69
|
+
}).start();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Memoize glow color interpolation to prevent continuous re-renders
|
|
73
|
+
const glowColor = useMemo(() => glowAnim.interpolate({
|
|
74
|
+
inputRange: [0, 1],
|
|
75
|
+
outputRange: [`${stopButtonColor}30`, `${stopButtonColor}CC`]
|
|
76
|
+
}), [glowAnim, stopButtonColor]);
|
|
77
|
+
return /*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: styles.controlButtonContainer,
|
|
79
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
80
|
+
style: styles.gameControls,
|
|
81
|
+
children: [!isPlaying && /*#__PURE__*/_jsx(Animated.View, {
|
|
82
|
+
style: [{
|
|
83
|
+
transform: [{
|
|
84
|
+
scale: pulseAnim
|
|
85
|
+
}]
|
|
86
|
+
}],
|
|
87
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
88
|
+
style: [styles.button, styles.startButton, {
|
|
89
|
+
backgroundColor: startButtonColor,
|
|
90
|
+
borderColor: startButtonBorderColor
|
|
91
|
+
}],
|
|
92
|
+
onPress: onStartGame,
|
|
93
|
+
onPressIn: handlePressIn,
|
|
94
|
+
onPressOut: handlePressOut,
|
|
95
|
+
activeOpacity: 0.8,
|
|
96
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
97
|
+
style: [styles.buttonContent, {
|
|
98
|
+
transform: [{
|
|
99
|
+
scale: scaleAnim
|
|
100
|
+
}]
|
|
101
|
+
}],
|
|
102
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
103
|
+
style: styles.buttonText,
|
|
104
|
+
children: startButtonText
|
|
105
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
106
|
+
style: styles.buttonSubtext,
|
|
107
|
+
children: startButtonSubtext
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
}), isPlaying && /*#__PURE__*/_jsx(Animated.View, {
|
|
112
|
+
style: [styles.stopButtonContainer, {
|
|
113
|
+
shadowColor: glowColor
|
|
114
|
+
}],
|
|
115
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
116
|
+
style: [styles.button, styles.stopButton, {
|
|
117
|
+
backgroundColor: stopButtonColor,
|
|
118
|
+
borderColor: stopButtonBorderColor
|
|
119
|
+
}],
|
|
120
|
+
onPress: onStopGame,
|
|
121
|
+
onPressIn: handlePressIn,
|
|
122
|
+
onPressOut: handlePressOut,
|
|
123
|
+
activeOpacity: 0.8,
|
|
124
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
125
|
+
style: [styles.buttonContent, {
|
|
126
|
+
transform: [{
|
|
127
|
+
scale: scaleAnim
|
|
128
|
+
}]
|
|
129
|
+
}],
|
|
130
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
131
|
+
style: styles.buttonText,
|
|
132
|
+
children: stopButtonText
|
|
133
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
134
|
+
style: styles.buttonSubtext,
|
|
135
|
+
children: stopButtonSubtext
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
const styles = StyleSheet.create({
|
|
144
|
+
controlButtonContainer: {
|
|
145
|
+
position: 'absolute',
|
|
146
|
+
bottom: 0,
|
|
147
|
+
left: 20,
|
|
148
|
+
right: 20,
|
|
149
|
+
zIndex: 100,
|
|
150
|
+
pointerEvents: 'box-none' // Allow touches on button but pass through elsewhere
|
|
151
|
+
},
|
|
152
|
+
gameControls: {
|
|
153
|
+
justifyContent: 'center',
|
|
154
|
+
alignItems: 'center',
|
|
155
|
+
paddingVertical: 20,
|
|
156
|
+
paddingHorizontal: 20
|
|
157
|
+
},
|
|
158
|
+
button: {
|
|
159
|
+
paddingHorizontal: 32,
|
|
160
|
+
paddingVertical: 20,
|
|
161
|
+
borderRadius: 30,
|
|
162
|
+
shadowColor: '#000',
|
|
163
|
+
shadowOffset: {
|
|
164
|
+
width: 0,
|
|
165
|
+
height: 8
|
|
166
|
+
},
|
|
167
|
+
shadowOpacity: 0.4,
|
|
168
|
+
shadowRadius: 12,
|
|
169
|
+
elevation: 8,
|
|
170
|
+
justifyContent: 'center',
|
|
171
|
+
alignItems: 'center',
|
|
172
|
+
minHeight: 70,
|
|
173
|
+
minWidth: 200,
|
|
174
|
+
borderWidth: 3,
|
|
175
|
+
position: 'relative',
|
|
176
|
+
overflow: 'hidden'
|
|
177
|
+
},
|
|
178
|
+
startButton: {
|
|
179
|
+
// Colors will be applied via props
|
|
180
|
+
},
|
|
181
|
+
stopButton: {
|
|
182
|
+
// Colors will be applied via props
|
|
183
|
+
},
|
|
184
|
+
stopButtonContainer: {
|
|
185
|
+
shadowOffset: {
|
|
186
|
+
width: 0,
|
|
187
|
+
height: 0
|
|
188
|
+
},
|
|
189
|
+
shadowOpacity: 0.6,
|
|
190
|
+
shadowRadius: 20,
|
|
191
|
+
elevation: 10
|
|
192
|
+
},
|
|
193
|
+
buttonContent: {
|
|
194
|
+
alignItems: 'center',
|
|
195
|
+
justifyContent: 'center'
|
|
196
|
+
},
|
|
197
|
+
buttonText: {
|
|
198
|
+
fontSize: 20,
|
|
199
|
+
fontWeight: '800',
|
|
200
|
+
color: '#ffffff',
|
|
201
|
+
textAlign: 'center',
|
|
202
|
+
textShadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
203
|
+
textShadowOffset: {
|
|
204
|
+
width: 1,
|
|
205
|
+
height: 1
|
|
206
|
+
},
|
|
207
|
+
textShadowRadius: 2,
|
|
208
|
+
letterSpacing: 1
|
|
209
|
+
},
|
|
210
|
+
buttonSubtext: {
|
|
211
|
+
fontSize: 12,
|
|
212
|
+
fontWeight: '600',
|
|
213
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
214
|
+
textAlign: 'center',
|
|
215
|
+
marginTop: 4,
|
|
216
|
+
letterSpacing: 0.5
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
//# sourceMappingURL=GameControlButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","useEffect","useMemo","View","TouchableOpacity","Text","StyleSheet","Animated","jsx","_jsx","jsxs","_jsxs","GameControlButton","memo","isPlaying","gameOver","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","scaleAnim","Value","current","pulseAnim","glowAnim","pulseAnimation","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","glowAnimation","handlePressIn","spring","handlePressOut","friction","tension","glowColor","interpolate","inputRange","outputRange","style","styles","controlButtonContainer","children","gameControls","transform","scale","button","startButton","backgroundColor","borderColor","onPress","onPressIn","onPressOut","activeOpacity","buttonContent","buttonText","buttonSubtext","stopButtonContainer","shadowColor","stopButton","create","position","bottom","left","right","zIndex","pointerEvents","justifyContent","alignItems","paddingVertical","paddingHorizontal","borderRadius","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","minHeight","minWidth","borderWidth","overflow","fontSize","fontWeight","color","textAlign","textShadowColor","textShadowOffset","textShadowRadius","letterSpacing","marginTop"],"sourceRoot":"../../../../src","sources":["shared/helpers/GameControlButton.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACzD,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBlF,OAAO,MAAMC,iBAAmD,gBAAGb,KAAK,CAACc,IAAI,CAAC,CAAC;EAC7EC,SAAS;EACTC,QAAQ;EACRC,WAAW;EACXC,UAAU;EACVC,eAAe,GAAG,YAAY;EAC9BC,cAAc,GAAG,WAAW;EAC5BC,kBAAkB,GAAG,gBAAgB;EACrCC,iBAAiB,GAAG,kBAAkB;EACtCC,gBAAgB,GAAG,SAAS;EAC5BC,eAAe,GAAG,SAAS;EAC3BC,sBAAsB,GAAG,SAAS;EAClCC,qBAAqB,GAAG;AAC1B,CAAC,KAAK;EACJ,MAAMC,SAAS,GAAG1B,MAAM,CAAC,IAAIO,QAAQ,CAACoB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACvD,MAAMC,SAAS,GAAG7B,MAAM,CAAC,IAAIO,QAAQ,CAACoB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACvD,MAAME,QAAQ,GAAG9B,MAAM,CAAC,IAAIO,QAAQ,CAACoB,KAAK,CAAC,CAAC,CAA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AAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,GAAG;IAClBC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE;EACb,CAAC;EACDvB,aAAa,EAAE;IACbc,UAAU,EAAE,QAAQ;IACpBD,cAAc,EAAE;EAClB,CAAC;EACDZ,UAAU,EAAE;IACV2B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE,SAAS;IAChBC,SAAS,EAAE,QAAQ;IACnBC,eAAe,EAAE,oBAAoB;IACrCC,gBAAgB,EAAE;MAAEd,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCc,gBAAgB,EAAE,CAAC;IACnBC,aAAa,EAAE;EACjB,CAAC;EACDjC,aAAa,EAAE;IACb0B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE,0BAA0B;IACjCC,SAAS,EAAE,QAAQ;IACnBK,SAAS,EAAE,CAAC;IACZD,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View, TouchableOpacity, Text, StyleSheet, Modal } from 'react-native';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
export const GameOverModal = ({
|
|
6
|
+
export const GameOverModal = /*#__PURE__*/React.memo(({
|
|
7
7
|
isVisible,
|
|
8
8
|
score,
|
|
9
|
-
onPlayAgain
|
|
9
|
+
onPlayAgain,
|
|
10
|
+
buttonText = "Play Again",
|
|
11
|
+
primaryColor = "rgba(59, 130, 246, 0.8)",
|
|
12
|
+
// Default blue
|
|
13
|
+
borderColor = "rgba(59, 130, 246, 0.9)",
|
|
14
|
+
buttonColor = "#10b981",
|
|
15
|
+
// Default green
|
|
16
|
+
buttonBorderColor = "#34d399"
|
|
10
17
|
}) => {
|
|
11
18
|
return /*#__PURE__*/_jsx(Modal, {
|
|
12
19
|
visible: isVisible,
|
|
@@ -16,14 +23,19 @@ export const GameOverModal = ({
|
|
|
16
23
|
children: /*#__PURE__*/_jsx(View, {
|
|
17
24
|
style: styles.gameOverOverlay,
|
|
18
25
|
children: /*#__PURE__*/_jsx(View, {
|
|
19
|
-
style: styles.gameOverModal,
|
|
26
|
+
style: [styles.gameOverModal, {
|
|
27
|
+
backgroundColor: primaryColor,
|
|
28
|
+
borderColor: borderColor
|
|
29
|
+
}],
|
|
20
30
|
children: /*#__PURE__*/_jsxs(View, {
|
|
21
31
|
style: styles.modalContent,
|
|
22
32
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
23
33
|
style: styles.gameOverTitle,
|
|
24
34
|
children: "Game Over!"
|
|
25
35
|
}), /*#__PURE__*/_jsxs(View, {
|
|
26
|
-
style: styles.finalScoreContainer,
|
|
36
|
+
style: [styles.finalScoreContainer, {
|
|
37
|
+
backgroundColor: borderColor // Use border color for inner panel
|
|
38
|
+
}],
|
|
27
39
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
28
40
|
style: styles.finalScoreLabel,
|
|
29
41
|
children: "Final Score"
|
|
@@ -34,11 +46,14 @@ export const GameOverModal = ({
|
|
|
34
46
|
}), /*#__PURE__*/_jsx(View, {
|
|
35
47
|
style: styles.playAgainContainer,
|
|
36
48
|
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
37
|
-
style: styles.playAgainButton,
|
|
49
|
+
style: [styles.playAgainButton, {
|
|
50
|
+
backgroundColor: buttonColor,
|
|
51
|
+
borderColor: buttonBorderColor
|
|
52
|
+
}],
|
|
38
53
|
onPress: onPlayAgain,
|
|
39
54
|
children: /*#__PURE__*/_jsx(Text, {
|
|
40
55
|
style: styles.buttonText,
|
|
41
|
-
children:
|
|
56
|
+
children: buttonText
|
|
42
57
|
})
|
|
43
58
|
})
|
|
44
59
|
})]
|
|
@@ -46,7 +61,7 @@ export const GameOverModal = ({
|
|
|
46
61
|
})
|
|
47
62
|
})
|
|
48
63
|
});
|
|
49
|
-
};
|
|
64
|
+
});
|
|
50
65
|
const styles = StyleSheet.create({
|
|
51
66
|
gameOverOverlay: {
|
|
52
67
|
flex: 1,
|
|
@@ -55,8 +70,6 @@ const styles = StyleSheet.create({
|
|
|
55
70
|
backgroundColor: 'rgba(0, 0, 0, 0.5)' // Semi-transparent overlay
|
|
56
71
|
},
|
|
57
72
|
gameOverModal: {
|
|
58
|
-
backgroundColor: '#87CEEB',
|
|
59
|
-
// Sky blue background for balloon theme
|
|
60
73
|
borderRadius: 24,
|
|
61
74
|
minWidth: '80%',
|
|
62
75
|
shadowColor: '#000',
|
|
@@ -67,8 +80,7 @@ const styles = StyleSheet.create({
|
|
|
67
80
|
shadowOpacity: 0.4,
|
|
68
81
|
shadowRadius: 12,
|
|
69
82
|
elevation: 12,
|
|
70
|
-
borderWidth: 3
|
|
71
|
-
borderColor: 'rgba(59, 130, 246, 0.8)' // Blue border for balloon theme
|
|
83
|
+
borderWidth: 3
|
|
72
84
|
},
|
|
73
85
|
modalContent: {
|
|
74
86
|
padding: 40,
|
|
@@ -84,8 +96,6 @@ const styles = StyleSheet.create({
|
|
|
84
96
|
finalScoreContainer: {
|
|
85
97
|
alignItems: 'center',
|
|
86
98
|
marginBottom: 32,
|
|
87
|
-
backgroundColor: '#1e40af',
|
|
88
|
-
// Blue background for balloon theme
|
|
89
99
|
borderRadius: 16,
|
|
90
100
|
padding: 20,
|
|
91
101
|
minWidth: 150
|
|
@@ -99,6 +109,7 @@ const styles = StyleSheet.create({
|
|
|
99
109
|
finalScoreValue: {
|
|
100
110
|
fontSize: 48,
|
|
101
111
|
color: '#facc15',
|
|
112
|
+
// Golden yellow for score
|
|
102
113
|
fontWeight: 'bold',
|
|
103
114
|
textAlign: 'center'
|
|
104
115
|
},
|
|
@@ -106,8 +117,6 @@ const styles = StyleSheet.create({
|
|
|
106
117
|
alignItems: 'center'
|
|
107
118
|
},
|
|
108
119
|
playAgainButton: {
|
|
109
|
-
backgroundColor: '#3b82f6',
|
|
110
|
-
// Blue for balloon theme
|
|
111
120
|
paddingHorizontal: 40,
|
|
112
121
|
paddingVertical: 20,
|
|
113
122
|
borderRadius: 24,
|
|
@@ -119,8 +128,7 @@ const styles = StyleSheet.create({
|
|
|
119
128
|
shadowOpacity: 0.25,
|
|
120
129
|
shadowRadius: 3.84,
|
|
121
130
|
elevation: 5,
|
|
122
|
-
borderWidth: 2
|
|
123
|
-
borderColor: '#60a5fa' // Light blue border
|
|
131
|
+
borderWidth: 2
|
|
124
132
|
},
|
|
125
133
|
buttonText: {
|
|
126
134
|
fontSize: 18,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","TouchableOpacity","Text","StyleSheet","Modal","jsx","_jsx","jsxs","_jsxs","GameOverModal","memo","isVisible","score","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","visible","animationType","transparent","onRequestClose","children","style","styles","gameOverOverlay","gameOverModal","backgroundColor","modalContent","gameOverTitle","finalScoreContainer","finalScoreLabel","finalScoreValue","playAgainContainer","playAgainButton","onPress","create","flex","justifyContent","alignItems","borderRadius","minWidth","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","padding","fontSize","fontWeight","color","marginBottom","textAlign","paddingHorizontal","paddingVertical","lineHeight"],"sourceRoot":"../../../../src","sources":["shared/helpers/GameOverModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAa/E,OAAO,MAAMC,aAA2C,gBAAGV,KAAK,CAACW,IAAI,CAAC,CAAC;EACrEC,SAAS;EACTC,KAAK;EACLC,WAAW;EACXC,UAAU,GAAG,YAAY;EACzBC,YAAY,GAAG,yBAAyB;EAAE;EAC1CC,WAAW,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