react-native-games 0.4.0 → 0.6.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 +121 -130
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +121 -422
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +30 -31
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +52 -124
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +12 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +102 -75
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +139 -30
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameBackground.js +2 -2
- package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +7 -6
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -3
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinja.js +93 -376
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +19 -22
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +25 -8
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +29 -4
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/GameArea.js +194 -29
- package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/GameBackground.js +107 -190
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +9 -30
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/index.js +0 -3
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunner.js +106 -109
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +19 -24
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerService.js +2 -1
- 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 +32 -15
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +8 -3
- 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 -1
- package/lib/module/games/maze-runner/components/index.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +113 -112
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +20 -23
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +0 -59
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +0 -27
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -1
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +24 -22
- package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -1
- package/lib/module/games/popit-fidget/components/GameBackground.js +4 -1
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -1
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +9 -2
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/popit-fidget/components/index.js +0 -2
- package/lib/module/games/popit-fidget/components/index.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighter.js +121 -369
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +21 -23
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +30 -11
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterStore.js +54 -2
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -1
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +7 -5
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -1
- package/lib/module/games/space-fighter/components/GameArea.js +234 -14
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -1
- package/lib/module/games/space-fighter/components/GameBackground.js +10 -65
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -1
- package/lib/module/games/space-fighter/components/ScoreBoard.js +9 -7
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +90 -250
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -1
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +42 -27
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -1
- package/lib/module/games/space-fighter/components/index.js +0 -3
- package/lib/module/games/space-fighter/components/index.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMole.js +63 -73
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +17 -19
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +20 -7
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/GameHole.js +2 -2
- package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +5 -1
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/index.js +0 -1
- package/lib/module/games/whack-a-mole/components/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +13 -21
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +30 -26
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/SoundsService.js +21 -21
- 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 +67 -58
- package/lib/module/shared/helpers/GameControlButton.js.map +1 -1
- package/lib/module/{games/whack-a-mole/components → shared/helpers}/GameOverModal.js +23 -13
- 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/index.js +7 -0
- package/lib/module/shared/helpers/index.js.map +1 -1
- 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 +10 -9
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +0 -2
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
- 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 -3
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +2 -14
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +5 -5
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts +8 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +1 -7
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +0 -3
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -8
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +4 -4
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -1
- 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/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 -1
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +2 -8
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +4 -4
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +0 -21
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +1 -5
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +2 -2
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +2 -2
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts +0 -2
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +3 -8
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +4 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +0 -1
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +1 -6
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/index.d.ts +0 -3
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +2 -11
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +2 -2
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +0 -1
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +47 -38
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +20 -3
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/SoundsService.d.ts +20 -20
- 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.map +1 -1
- package/lib/typescript/src/{games/balloon-blaster/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/index.d.ts +9 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/lib/module/games/balloon-blaster/components/GameOverModal.js +0 -133
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -55
- 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/fruit-ninja/components/GameOverModal.js +0 -189
- package/lib/module/games/fruit-ninja/components/GameOverModal.js.map +0 -1
- package/lib/module/games/fruit-ninja/components/ParticleSystem.js +0 -52
- package/lib/module/games/fruit-ninja/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/fruit-ninja/components/SliceTrail.js +0 -58
- package/lib/module/games/fruit-ninja/components/SliceTrail.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/popit-fidget/components/GameOverModal.js +0 -132
- package/lib/module/games/popit-fidget/components/GameOverModal.js.map +0 -1
- package/lib/module/games/popit-fidget/components/ParticleSystem.js +0 -89
- package/lib/module/games/popit-fidget/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/space-fighter/components/GameOverModal.js +0 -182
- package/lib/module/games/space-fighter/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-fighter/components/ParticleComponent.js +0 -34
- package/lib/module/games/space-fighter/components/ParticleComponent.js.map +0 -1
- package/lib/module/games/space-fighter/components/SettingsModal.js +0 -222
- package/lib/module/games/space-fighter/components/SettingsModal.js.map +0 -1
- package/lib/module/games/whack-a-mole/components/GameOverModal.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 -125
- package/lib/module/shared/settings/SettingsService.js.map +0 -1
- 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/fruit-ninja/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.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/popit-fidget/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts +0 -9
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts +0 -8
- package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts.map +0 -1
- package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.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 -33
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["gamesList","BALLOON_BLASTER_THEME","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","FRUIT_NINJA_THEME","FRUIT_NINJA_DIFFICULTY_DESCRIPTIONS","MAZE_RUNNER_THEME","MAZE_RUNNER_DIFFICULTY_DESCRIPTIONS","WHACK_A_MOLE_THEME","WHACK_A_MOLE_DIFFICULTY_DESCRIPTIONS","SPACE_FIGHTER_THEME","SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS","POPIT_FIDGET_THEME","POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS","GAME_THEMES","balloonBlaster","fruitNinja","mazeRunner","whackAMole","spaceFighter","popitFidget","GAME_DIFFICULTY_DESCRIPTIONS","
|
|
1
|
+
{"version":3,"names":["gamesList","GAME_IDS","BALLOON_BLASTER_THEME","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","FRUIT_NINJA_THEME","FRUIT_NINJA_DIFFICULTY_DESCRIPTIONS","MAZE_RUNNER_THEME","MAZE_RUNNER_DIFFICULTY_DESCRIPTIONS","WHACK_A_MOLE_THEME","WHACK_A_MOLE_DIFFICULTY_DESCRIPTIONS","SPACE_FIGHTER_THEME","SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS","POPIT_FIDGET_THEME","POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS","GAME_THEMES","balloonBlaster","fruitNinja","mazeRunner","whackAMole","spaceFighter","popitFidget","GAME_DIFFICULTY_DESCRIPTIONS","DIFFICULTY_LEVELS","GAME_NAMES","BALLOON_BLASTER","FRUIT_SLICER","MAZE_RUNNER","CAT_POPPER","SPACE_TRAVELLER","getGameTheme","gameId","FRUIT_NINJA","WHACK_A_MOLE","SPACE_FIGHTER","POPIT_FIDGET","getGameDifficultyDescriptions","getGameTitle","game","find","g","id","title"],"sourceRoot":"../../../src","sources":["services/GamesConstants.ts"],"mappings":";;AAAA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ME_SETTINGS = {
|
|
5
|
+
isVisible: false,
|
|
6
|
+
difficulty: 'medium',
|
|
7
|
+
enableSounds: true,
|
|
8
|
+
enableHaptics: true
|
|
9
|
+
};
|
|
10
|
+
export let GAME_IDS = /*#__PURE__*/function (GAME_IDS) {
|
|
11
|
+
GAME_IDS["WHACK_A_MOLE"] = "whack-a-mole";
|
|
12
|
+
GAME_IDS["POPIT_FIDGET"] = "popit-fidget";
|
|
13
|
+
GAME_IDS["FRUIT_NINJA"] = "fruit-ninja";
|
|
14
|
+
GAME_IDS["BALLOON_BLASTER"] = "balloon-blaster";
|
|
15
|
+
GAME_IDS["SPACE_FIGHTER"] = "space-fighter";
|
|
16
|
+
GAME_IDS["MAZE_RUNNER"] = "maze-runner";
|
|
17
|
+
return GAME_IDS;
|
|
18
|
+
}({});
|
|
19
|
+
;
|
|
4
20
|
export const gamesList = [{
|
|
5
|
-
id:
|
|
21
|
+
id: GAME_IDS.WHACK_A_MOLE,
|
|
6
22
|
title: 'Whack A Mole',
|
|
7
|
-
description: 'Whack cute cats popping from holes - fast reflexes needed!'
|
|
8
|
-
icon: 'hammer',
|
|
9
|
-
color: '#ff6b6b'
|
|
23
|
+
description: 'Whack cute cats popping from holes - fast reflexes needed!'
|
|
10
24
|
}, {
|
|
11
|
-
id:
|
|
25
|
+
id: GAME_IDS.POPIT_FIDGET,
|
|
12
26
|
title: 'Popit Fidget',
|
|
13
|
-
description: 'Pop satisfying bubbles in this relaxing fidget toy game'
|
|
14
|
-
icon: 'ellipse',
|
|
15
|
-
color: '#6c5ce7'
|
|
27
|
+
description: 'Pop satisfying bubbles in this relaxing fidget toy game'
|
|
16
28
|
}, {
|
|
17
|
-
id:
|
|
29
|
+
id: GAME_IDS.FRUIT_NINJA,
|
|
18
30
|
title: 'Fruit Ninja',
|
|
19
|
-
description: 'Slice flying fruits with finger swipes - avoid the bombs!'
|
|
20
|
-
icon: 'cut',
|
|
21
|
-
color: '#4ecdc4'
|
|
31
|
+
description: 'Slice flying fruits with finger swipes - avoid the bombs!'
|
|
22
32
|
}, {
|
|
23
|
-
id:
|
|
24
|
-
title: 'Space Fighter',
|
|
25
|
-
description: 'Pilot spaceship through asteroid fields in endless space',
|
|
26
|
-
icon: 'rocket',
|
|
27
|
-
color: '#45b7d1'
|
|
28
|
-
}, {
|
|
29
|
-
id: 'balloon-blaster',
|
|
33
|
+
id: GAME_IDS.BALLOON_BLASTER,
|
|
30
34
|
title: 'Balloon Blaster',
|
|
31
|
-
description: 'Pop rising balloons before they escape - quick taps win!'
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
description: 'Pop rising balloons before they escape - quick taps win!'
|
|
36
|
+
}, {
|
|
37
|
+
id: GAME_IDS.SPACE_FIGHTER,
|
|
38
|
+
title: 'Space Fighter',
|
|
39
|
+
description: 'Pilot spaceship through asteroid fields in endless space'
|
|
34
40
|
}, {
|
|
35
|
-
id:
|
|
41
|
+
id: GAME_IDS.MAZE_RUNNER,
|
|
36
42
|
title: 'Maze Runner',
|
|
37
|
-
description: 'Navigate ball through mazes using tilt and physics controls'
|
|
38
|
-
icon: 'trail-sign',
|
|
39
|
-
color: '#96ceb4'
|
|
43
|
+
description: 'Navigate ball through mazes using tilt and physics controls'
|
|
40
44
|
}];
|
|
41
45
|
export const immerMiddleware = config => (set, get, api) => config(fn => set(produce(fn)), get, api);
|
|
42
46
|
//# sourceMappingURL=GamesService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["produce","gamesList","id","title","description","
|
|
1
|
+
{"version":3,"names":["produce","DEFAULT_GAME_SETTINGS","isVisible","difficulty","enableSounds","enableHaptics","GAME_IDS","gamesList","id","WHACK_A_MOLE","title","description","POPIT_FIDGET","FRUIT_NINJA","BALLOON_BLASTER","SPACE_FIGHTER","MAZE_RUNNER","immerMiddleware","config","set","get","api","fn"],"sourceRoot":"../../../src","sources":["services/GamesService.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAc/B,OAAO,MAAMC,q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sounds
|
|
46
|
+
// Game state sounds - slower and more understandable
|
|
47
47
|
GAME_START: {
|
|
48
48
|
text: 'Game started!',
|
|
49
|
-
pitch: 1.
|
|
50
|
-
rate:
|
|
49
|
+
pitch: 1.1,
|
|
50
|
+
rate: 0.9
|
|
51
51
|
},
|
|
52
52
|
GAME_OVER: {
|
|
53
53
|
text: 'Game over!',
|
|
54
|
-
pitch:
|
|
55
|
-
rate:
|
|
54
|
+
pitch: 0.9,
|
|
55
|
+
rate: 0.8
|
|
56
56
|
},
|
|
57
57
|
TIME_UP: {
|
|
58
58
|
text: 'Time up! Game over!',
|
|
59
|
-
pitch:
|
|
60
|
-
rate:
|
|
59
|
+
pitch: 0.9,
|
|
60
|
+
rate: 0.8
|
|
61
61
|
},
|
|
62
62
|
WELL_DONE: {
|
|
63
63
|
text: 'Well done!',
|
|
64
|
-
pitch: 1.
|
|
65
|
-
rate: 1.
|
|
64
|
+
pitch: 1.2,
|
|
65
|
+
rate: 1.0
|
|
66
66
|
},
|
|
67
67
|
CONGRATULATIONS: {
|
|
68
68
|
text: 'Congratulations!',
|
|
69
|
-
pitch: 1.
|
|
70
|
-
rate:
|
|
69
|
+
pitch: 1.1,
|
|
70
|
+
rate: 0.9
|
|
71
71
|
},
|
|
72
72
|
// Specific game sounds
|
|
73
73
|
BUBBLE_POPPER: {
|
|
74
74
|
START: {
|
|
75
75
|
text: 'Bubble Popper started!',
|
|
76
|
-
pitch: 1.
|
|
77
|
-
rate:
|
|
76
|
+
pitch: 1.1,
|
|
77
|
+
rate: 0.9
|
|
78
78
|
},
|
|
79
79
|
COMPLETE: {
|
|
80
80
|
text: 'All bubbles popped! Well done!',
|
|
81
|
-
pitch: 1.
|
|
82
|
-
rate: 1.
|
|
81
|
+
pitch: 1.2,
|
|
82
|
+
rate: 1.0
|
|
83
83
|
},
|
|
84
84
|
POP: {
|
|
85
85
|
text: 'Pop!',
|
|
@@ -137,24 +137,24 @@ export const GAME_SOUNDS = {
|
|
|
137
137
|
START: {
|
|
138
138
|
text: 'Maze started! Navigate to the exit!',
|
|
139
139
|
pitch: 1.0,
|
|
140
|
-
rate:
|
|
140
|
+
rate: 0.9
|
|
141
141
|
},
|
|
142
142
|
COMPLETE: {
|
|
143
143
|
text: 'Congratulations! Maze completed!',
|
|
144
|
-
pitch: 1.
|
|
145
|
-
rate:
|
|
144
|
+
pitch: 1.1,
|
|
145
|
+
rate: 0.9
|
|
146
146
|
},
|
|
147
147
|
STOP: {
|
|
148
148
|
text: 'Maze stopped!',
|
|
149
|
-
pitch:
|
|
150
|
-
rate:
|
|
149
|
+
pitch: 0.9,
|
|
150
|
+
rate: 0.8
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
SPACE_FIGHTER: {
|
|
154
154
|
START: {
|
|
155
155
|
text: 'Mission started! Navigate through the asteroid field!',
|
|
156
156
|
pitch: 1.0,
|
|
157
|
-
rate:
|
|
157
|
+
rate: 0.9
|
|
158
158
|
},
|
|
159
159
|
SUCCESS: {
|
|
160
160
|
text: 'Nice!',
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Optimized animation frame utility for smooth game object cleanup and updates
|
|
7
|
+
* Uses requestAnimationFrame instead of setInterval for better performance
|
|
8
|
+
*/
|
|
9
|
+
export class AnimationFrameManager {
|
|
10
|
+
animationId = null;
|
|
11
|
+
isRunning = false;
|
|
12
|
+
lastTime = 0;
|
|
13
|
+
constructor(callback, interval = 100) {
|
|
14
|
+
this.callback = callback;
|
|
15
|
+
this.interval = interval;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Start the animation frame loop
|
|
20
|
+
*/
|
|
21
|
+
start() {
|
|
22
|
+
if (this.isRunning) return;
|
|
23
|
+
this.isRunning = true;
|
|
24
|
+
this.lastTime = performance.now();
|
|
25
|
+
this.loop();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Stop the animation frame loop
|
|
30
|
+
*/
|
|
31
|
+
stop() {
|
|
32
|
+
if (this.animationId) {
|
|
33
|
+
cancelAnimationFrame(this.animationId);
|
|
34
|
+
this.animationId = null;
|
|
35
|
+
}
|
|
36
|
+
this.isRunning = false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Internal animation frame loop
|
|
41
|
+
*/
|
|
42
|
+
loop = () => {
|
|
43
|
+
if (!this.isRunning) return;
|
|
44
|
+
const currentTime = performance.now();
|
|
45
|
+
const deltaTime = currentTime - this.lastTime;
|
|
46
|
+
if (deltaTime >= this.interval) {
|
|
47
|
+
this.callback();
|
|
48
|
+
this.lastTime = currentTime;
|
|
49
|
+
}
|
|
50
|
+
this.animationId = requestAnimationFrame(this.loop);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Update the callback function
|
|
55
|
+
*/
|
|
56
|
+
updateCallback(callback) {
|
|
57
|
+
this.callback = callback;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Update the interval
|
|
62
|
+
*/
|
|
63
|
+
updateInterval(interval) {
|
|
64
|
+
this.interval = interval;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* React hook for using optimized animation frame cleanup
|
|
70
|
+
*/
|
|
71
|
+
export function useAnimationFrame(callback, interval = 100, dependencies = []) {
|
|
72
|
+
const managerRef = useRef(null);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
// Create or update the manager
|
|
75
|
+
if (!managerRef.current) {
|
|
76
|
+
managerRef.current = new AnimationFrameManager(callback, interval);
|
|
77
|
+
} else {
|
|
78
|
+
managerRef.current.updateCallback(callback);
|
|
79
|
+
managerRef.current.updateInterval(interval);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Start the animation frame loop
|
|
83
|
+
managerRef.current.start();
|
|
84
|
+
|
|
85
|
+
// Cleanup on unmount or dependency change
|
|
86
|
+
return () => {
|
|
87
|
+
if (managerRef.current) {
|
|
88
|
+
managerRef.current.stop();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}, dependencies);
|
|
92
|
+
|
|
93
|
+
// Cleanup on unmount
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
return () => {
|
|
96
|
+
if (managerRef.current) {
|
|
97
|
+
managerRef.current.stop();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}, []);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* React hook for creating a reusable animation frame manager
|
|
105
|
+
*/
|
|
106
|
+
export function useAnimationFrameManager(interval = 100) {
|
|
107
|
+
const managerRef = useRef(null);
|
|
108
|
+
if (!managerRef.current) {
|
|
109
|
+
managerRef.current = new AnimationFrameManager(() => {}, interval);
|
|
110
|
+
}
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
return () => {
|
|
113
|
+
if (managerRef.current) {
|
|
114
|
+
managerRef.current.stop();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
return managerRef.current;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=AnimationFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","AnimationFrameManager","animationId","isRunning","lastTime","constructor","callback","interval","start","performance","now","loop","stop","cancelAnimationFrame","currentTime","deltaTime","requestAnimationFrame","updateCallback","updateInterval","useAnimationFrame","dependencies","managerRef","current","useAnimationFrameManager"],"sourceRoot":"../../../../src","sources":["shared/helpers/AnimationFrame.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEzC;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,CAAC;EACzBC,WAAW,GAAkB,IAAI;EACjCC,SAAS,GAAG,KAAK;EAGjBC,QAAQ,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CAAC,CAAC;MAC3B;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOS,UAAU,CAACC,OAAO;AAC3B","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Animation state interface for tracking game object animations
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Default animation state values
|
|
11
|
+
*/
|
|
12
|
+
export const DEFAULT_ANIMATION_STATE = {
|
|
13
|
+
scale: 1,
|
|
14
|
+
opacity: 1,
|
|
15
|
+
rotation: 0,
|
|
16
|
+
translateX: 0,
|
|
17
|
+
translateY: 0
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Animation tracker class for managing game object animations
|
|
22
|
+
* Extends Map to maintain compatibility with existing game services
|
|
23
|
+
*/
|
|
24
|
+
export class AnimationTracker extends Map {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Override set to merge with default animation state
|
|
31
|
+
*/
|
|
32
|
+
set(id, state) {
|
|
33
|
+
const currentState = super.get(id) || {
|
|
34
|
+
...DEFAULT_ANIMATION_STATE
|
|
35
|
+
};
|
|
36
|
+
const newState = {
|
|
37
|
+
...currentState,
|
|
38
|
+
...state
|
|
39
|
+
};
|
|
40
|
+
super.set(id, newState);
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Initialize animation for object if it doesn't exist
|
|
46
|
+
*/
|
|
47
|
+
initialize(id, initialState) {
|
|
48
|
+
if (!this.has(id)) {
|
|
49
|
+
const state = {
|
|
50
|
+
...DEFAULT_ANIMATION_STATE,
|
|
51
|
+
...initialState
|
|
52
|
+
};
|
|
53
|
+
super.set(id, state);
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
return this.get(id);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Update multiple objects at once
|
|
61
|
+
*/
|
|
62
|
+
updateBatch(updates) {
|
|
63
|
+
updates.forEach(({
|
|
64
|
+
id,
|
|
65
|
+
state
|
|
66
|
+
}) => {
|
|
67
|
+
this.set(id, state);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* React hook for creating and managing animation trackers
|
|
74
|
+
*/
|
|
75
|
+
export function useAnimationTracker() {
|
|
76
|
+
return useRef(new AnimationTracker()).current;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* React hook for creating multiple animation trackers
|
|
81
|
+
*/
|
|
82
|
+
export function useAnimationTrackers(trackerNames) {
|
|
83
|
+
const trackers = useRef(trackerNames.reduce((acc, name) => {
|
|
84
|
+
acc[name] = new AnimationTracker();
|
|
85
|
+
return acc;
|
|
86
|
+
}, {})).current;
|
|
87
|
+
return trackers;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=AnimationTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","DEFAULT_ANIMATION_STATE","scale","opacity","rotation","translateX","translateY","AnimationTracker","Map","constructor","set","id","state","currentState","get","newState","initialize","initialState","has","updateBatch","updates","forEach","useAnimationTracker","current","useAnimationTrackers","trackerNames","trackers","reduce","acc","name"],"sourceRoot":"../../../../src","sources":["shared/helpers/AnimationTracker.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,OAAO;;AAE9B;AACA;AACA;;AASA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuC,GAAG;EACrDC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,QAAQ,EAAE,CAAC;EACXC,UAAU,EAAE,CAAC;EACbC,UAAU,EAAE;AACd,CAAC;;AAED;AACA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AACC,GAAG,EAAEC,IAAI,KAAK;IACjCD,GAAG,CAACC,IAAI,CAAC,GAAG,IAAItB,gBAAgB,CAAC,CAAC;IAClC,OAAOqB,GAAG;EACZ,CAAC,EAAE,CAAC,CAAsC,CAC5C,CAAC,CAACL,OAAO;EAET,OAAOG,QAAQ;AACjB","ignoreList":[]}
|
|
@@ -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
|