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,376 +1,153 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useEffect,
|
|
4
|
-
import { View,
|
|
5
|
-
import {
|
|
6
|
-
import { playSound, stopAllSounds, GAME_SOUNDS } from "../../services/SoundsService.js";
|
|
7
|
-
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
3
|
+
import React, { useEffect, useCallback, useMemo } from 'react';
|
|
4
|
+
import { View, StyleSheet, Dimensions } from 'react-native';
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
8
6
|
import { useSpaceFighterStore } from "./SpaceFighterStore.js";
|
|
9
7
|
import { createSpaceFighterService } from "./SpaceFighterService.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { getDifficultySettings } from "./SpaceFighterConstants.js";
|
|
9
|
+
import { ScoreBoard, GameArea, GameBackground } from "./components/index.js";
|
|
10
|
+
import { GameControlButton, GameOverModal, useGameErrorHandler, GameErrorType } from "../../shared/helpers/index.js";
|
|
11
|
+
import { GameSettingsModal } from "../../shared/helpers/index.js";
|
|
12
|
+
import { GAME_IDS } from "../../services/GamesService.js";
|
|
15
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
14
|
const {
|
|
17
15
|
width,
|
|
18
16
|
height
|
|
19
17
|
} = Dimensions.get('window');
|
|
20
18
|
export const SpaceFighter = ({
|
|
21
|
-
|
|
22
|
-
onToggleSettingsModal,
|
|
23
|
-
settings: externalSettings,
|
|
19
|
+
settings,
|
|
24
20
|
onSettingsChange
|
|
25
21
|
}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Create unified game settings store
|
|
29
|
-
const settingsStore = useMemo(() => {
|
|
30
|
-
const defaultSettings = {
|
|
31
|
-
...DEFAULT_SPACE_FIGHTER_SETTINGS,
|
|
32
|
-
...externalSettings
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Wrapper function to handle the callback type mismatch
|
|
36
|
-
const handleSettingsChange = onSettingsChange ? newSettings => {
|
|
37
|
-
const spaceFighterSettings = {
|
|
38
|
-
...DEFAULT_SPACE_FIGHTER_SETTINGS,
|
|
39
|
-
...externalSettings,
|
|
40
|
-
difficulty: newSettings.difficulty,
|
|
41
|
-
soundEnabled: newSettings.soundEnabled,
|
|
42
|
-
hapticEnabled: newSettings.hapticEnabled,
|
|
43
|
-
gameDuration: newSettings.gameDuration
|
|
44
|
-
};
|
|
45
|
-
onSettingsChange(spaceFighterSettings);
|
|
46
|
-
} : undefined;
|
|
47
|
-
return createGameSettingsStore(defaultSettings, handleSettingsChange);
|
|
48
|
-
}, [externalSettings, onSettingsChange]);
|
|
49
|
-
|
|
50
|
-
// Add infinite loop prevention
|
|
51
|
-
const prevSettingsRef = useRef(externalSettings);
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
const prev = prevSettingsRef.current;
|
|
54
|
-
const current = externalSettings;
|
|
55
|
-
if (!prev && !current) return;
|
|
56
|
-
const hasChanged = prev?.difficulty !== current?.difficulty || prev?.soundEnabled !== current?.soundEnabled || prev?.hapticEnabled !== current?.hapticEnabled || prev?.gameDuration !== current?.gameDuration;
|
|
57
|
-
if (hasChanged) {
|
|
58
|
-
const commonSettings = {
|
|
59
|
-
difficulty: current?.difficulty || 'medium',
|
|
60
|
-
soundEnabled: current?.soundEnabled ?? true,
|
|
61
|
-
hapticEnabled: current?.hapticEnabled ?? true
|
|
62
|
-
};
|
|
63
|
-
settingsStore().updateSettings(commonSettings);
|
|
64
|
-
prevSettingsRef.current = current;
|
|
65
|
-
}
|
|
66
|
-
}, [externalSettings, settingsStore]);
|
|
67
|
-
const settings = settingsStore();
|
|
22
|
+
// Memoize settings destructuring to prevent unnecessary re-renders
|
|
68
23
|
const {
|
|
69
|
-
soundEnabled,
|
|
70
|
-
hapticEnabled,
|
|
71
24
|
difficulty
|
|
72
|
-
} = settings;
|
|
25
|
+
} = useMemo(() => settings, [settings]);
|
|
73
26
|
|
|
74
|
-
//
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
asteroidSpawnInterval: difficultySettings.asteroidSpawnInterval,
|
|
79
|
-
asteroidSpeed: difficultySettings.asteroidSpeed,
|
|
80
|
-
gameDuration: difficultySettings.gameDuration
|
|
81
|
-
};
|
|
82
|
-
}, [difficulty]);
|
|
83
|
-
const {
|
|
84
|
-
score,
|
|
85
|
-
timeLeft,
|
|
86
|
-
isPlaying,
|
|
87
|
-
gameOver,
|
|
88
|
-
asteroids,
|
|
89
|
-
spacecraft,
|
|
90
|
-
spacecraftPath,
|
|
91
|
-
isControllingSpacecraft,
|
|
92
|
-
startGame,
|
|
93
|
-
stopGame,
|
|
94
|
-
resetGame,
|
|
95
|
-
decrementTime,
|
|
96
|
-
addAsteroids,
|
|
97
|
-
removeAsteroid,
|
|
98
|
-
updateAsteroid,
|
|
99
|
-
updateSpacecraft,
|
|
100
|
-
setSpacecraftPath,
|
|
101
|
-
setIsControllingSpacecraft,
|
|
102
|
-
markAsteroidPassed,
|
|
103
|
-
loseLife
|
|
104
|
-
} = useSpaceFighterStore();
|
|
105
|
-
const currentSpacecraftPath = useRef([]);
|
|
106
|
-
const dragOffset = useRef(null);
|
|
107
|
-
const initialSpacecraftPosition = useRef(null);
|
|
108
|
-
const initialTouchPosition = useRef(null);
|
|
109
|
-
const pendingSpacecraftUpdate = useRef(null);
|
|
110
|
-
const animationFrameId = useRef(null);
|
|
111
|
-
const lastCollisionTime = useRef(0);
|
|
112
|
-
const handleSpacecraftControlStart = (x, y) => {
|
|
113
|
-
const currentSpacecraft = useSpaceFighterStore.getState().spacecraft;
|
|
114
|
-
const controlledSpacecraft = gameService.controlSpacecraft({
|
|
115
|
-
...currentSpacecraft
|
|
116
|
-
}, x, y);
|
|
117
|
-
updateSpacecraft(controlledSpacecraft);
|
|
118
|
-
setIsControllingSpacecraft(true);
|
|
119
|
-
currentSpacecraftPath.current = [{
|
|
120
|
-
x,
|
|
121
|
-
y
|
|
122
|
-
}];
|
|
123
|
-
setSpacecraftPath([{
|
|
124
|
-
x,
|
|
125
|
-
y
|
|
126
|
-
}]);
|
|
127
|
-
};
|
|
128
|
-
const processPendingSpacecraftUpdate = () => {
|
|
129
|
-
if (pendingSpacecraftUpdate.current) {
|
|
130
|
-
const {
|
|
131
|
-
x,
|
|
132
|
-
y
|
|
133
|
-
} = pendingSpacecraftUpdate.current;
|
|
134
|
-
const currentSpacecraft = useSpaceFighterStore.getState().spacecraft;
|
|
135
|
-
const controlledSpacecraft = gameService.controlSpacecraft({
|
|
136
|
-
...currentSpacecraft
|
|
137
|
-
}, x, y);
|
|
138
|
-
updateSpacecraft(controlledSpacecraft);
|
|
139
|
-
currentSpacecraftPath.current.push({
|
|
140
|
-
x,
|
|
141
|
-
y
|
|
142
|
-
});
|
|
143
|
-
if (currentSpacecraftPath.current.length > 10) {
|
|
144
|
-
currentSpacecraftPath.current.shift();
|
|
145
|
-
}
|
|
146
|
-
setSpacecraftPath([...currentSpacecraftPath.current]);
|
|
147
|
-
pendingSpacecraftUpdate.current = null;
|
|
148
|
-
}
|
|
149
|
-
animationFrameId.current = null;
|
|
150
|
-
};
|
|
151
|
-
const handleSpacecraftControlMove = (x, y) => {
|
|
152
|
-
pendingSpacecraftUpdate.current = {
|
|
153
|
-
x,
|
|
154
|
-
y
|
|
155
|
-
};
|
|
156
|
-
if (animationFrameId.current === null) {
|
|
157
|
-
animationFrameId.current = requestAnimationFrame(processPendingSpacecraftUpdate);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
const handleSpacecraftControlEnd = () => {
|
|
161
|
-
if (animationFrameId.current !== null) {
|
|
162
|
-
cancelAnimationFrame(animationFrameId.current);
|
|
163
|
-
animationFrameId.current = null;
|
|
164
|
-
}
|
|
165
|
-
if (pendingSpacecraftUpdate.current) {
|
|
166
|
-
processPendingSpacecraftUpdate();
|
|
167
|
-
}
|
|
168
|
-
const currentSpacecraft = useSpaceFighterStore.getState().spacecraft;
|
|
169
|
-
const releasedSpacecraft = gameService.releaseSpacecraft({
|
|
170
|
-
...currentSpacecraft
|
|
171
|
-
});
|
|
172
|
-
updateSpacecraft(releasedSpacecraft);
|
|
173
|
-
setIsControllingSpacecraft(false);
|
|
174
|
-
dragOffset.current = null;
|
|
175
|
-
initialSpacecraftPosition.current = null;
|
|
176
|
-
setTimeout(() => {
|
|
177
|
-
currentSpacecraftPath.current = [];
|
|
178
|
-
setSpacecraftPath([]);
|
|
179
|
-
}, 500);
|
|
180
|
-
};
|
|
27
|
+
// Read UI-critical state independently to minimize re-renders
|
|
28
|
+
const isPlaying = useSpaceFighterStore(state => state.isPlaying);
|
|
29
|
+
const gameOver = useSpaceFighterStore(state => state.gameOver);
|
|
30
|
+
const score = useSpaceFighterStore(state => state.score);
|
|
181
31
|
|
|
182
|
-
//
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const playGameOverSound = () => {
|
|
192
|
-
playSound(GAME_SOUNDS.GAME_OVER, soundEnabled);
|
|
193
|
-
playHaptic(HapticType.HEAVY, hapticEnabled);
|
|
194
|
-
};
|
|
195
|
-
const handleStartGame = async () => {
|
|
196
|
-
startGame(); // Store uses fixed 60s duration internally
|
|
32
|
+
// Get store actions independently (these don't cause re-renders)
|
|
33
|
+
const startGame = useSpaceFighterStore(state => state.startGame);
|
|
34
|
+
const stopGame = useSpaceFighterStore(state => state.stopGame);
|
|
35
|
+
const resetGame = useSpaceFighterStore(state => state.resetGame);
|
|
36
|
+
const decrementTime = useSpaceFighterStore(state => state.decrementTime);
|
|
37
|
+
const addAsteroids = useSpaceFighterStore(state => state.addAsteroids);
|
|
38
|
+
const removeAsteroid = useSpaceFighterStore(state => state.removeAsteroid);
|
|
39
|
+
const updateAsteroid = useSpaceFighterStore(state => state.updateAsteroid);
|
|
40
|
+
const updateSpacecraft = useSpaceFighterStore(state => state.updateSpacecraft);
|
|
197
41
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
const handleStopGame = () => {
|
|
211
|
-
stopGame();
|
|
212
|
-
gameService.cleanup();
|
|
213
|
-
currentSpacecraftPath.current = [];
|
|
214
|
-
setSpacecraftPath([]);
|
|
215
|
-
setIsControllingSpacecraft(false);
|
|
216
|
-
};
|
|
217
|
-
const handleResetGame = () => {
|
|
218
|
-
resetGame();
|
|
219
|
-
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
220
|
-
updateSpacecraft(initialSpacecraft);
|
|
221
|
-
gameService.cleanup();
|
|
222
|
-
currentSpacecraftPath.current = [];
|
|
223
|
-
setSpacecraftPath([]);
|
|
224
|
-
setIsControllingSpacecraft(false);
|
|
225
|
-
};
|
|
42
|
+
// Error handling for the game
|
|
43
|
+
const {
|
|
44
|
+
wrapFunction,
|
|
45
|
+
safeExecute
|
|
46
|
+
} = useGameErrorHandler(GAME_IDS.SPACE_FIGHTER);
|
|
47
|
+
|
|
48
|
+
// Memoize game service to prevent recreation
|
|
49
|
+
const gameService = useMemo(() => safeExecute(() => createSpaceFighterService(width, height),
|
|
50
|
+
// Use actual screen dimensions
|
|
51
|
+
createSpaceFighterService(width, height),
|
|
52
|
+
// Fallback to direct creation
|
|
53
|
+
GameErrorType.INITIALIZATION_ERROR), [safeExecute]);
|
|
226
54
|
|
|
227
|
-
//
|
|
55
|
+
// Game service cleanup on unmount
|
|
228
56
|
useEffect(() => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
const collision = gameService.checkCollision(currentSpacecraft, currentAsteroids);
|
|
234
|
-
const now = Date.now();
|
|
235
|
-
if (collision.collision && now - lastCollisionTime.current > 1000) {
|
|
236
|
-
lastCollisionTime.current = now;
|
|
237
|
-
playCollisionSound();
|
|
238
|
-
gameService.createCollisionParticles(currentSpacecraft.x, currentSpacecraft.y);
|
|
239
|
-
loseLife();
|
|
240
|
-
const resetSpacecraft = gameService.getInitialSpacecraft();
|
|
241
|
-
updateSpacecraft(resetSpacecraft);
|
|
242
|
-
return;
|
|
57
|
+
return () => {
|
|
58
|
+
handleResetGame();
|
|
59
|
+
if (gameService) {
|
|
60
|
+
gameService.cleanup();
|
|
243
61
|
}
|
|
62
|
+
};
|
|
63
|
+
}, [gameService]);
|
|
244
64
|
|
|
245
|
-
|
|
246
|
-
const passedAsteroids = gameService.checkAsteroidPass(currentSpacecraft, currentAsteroids);
|
|
247
|
-
passedAsteroids.forEach(pairId => {
|
|
248
|
-
markAsteroidPassed(pairId);
|
|
249
|
-
playSuccessSound();
|
|
250
|
-
});
|
|
251
|
-
}, 50);
|
|
252
|
-
return () => clearInterval(interval);
|
|
253
|
-
}, [isPlaying]);
|
|
254
|
-
|
|
255
|
-
// Game over effect
|
|
65
|
+
// Auto-stop physics when game over state changes
|
|
256
66
|
useEffect(() => {
|
|
257
|
-
if (gameOver) {
|
|
258
|
-
|
|
67
|
+
if (gameOver && gameService) {
|
|
68
|
+
// Stop all timers and physics when game over
|
|
259
69
|
gameService.cleanup();
|
|
260
70
|
}
|
|
261
|
-
}, [gameOver]);
|
|
71
|
+
}, [gameOver, gameService]);
|
|
262
72
|
|
|
263
|
-
//
|
|
264
|
-
|
|
265
|
-
gameService.updateDifficultySettings(gameConstants.asteroidSpeed, gameConstants.asteroidSpawnInterval);
|
|
266
|
-
}, [gameConstants.asteroidSpeed, gameConstants.asteroidSpawnInterval]);
|
|
73
|
+
// Memoize difficulty settings to prevent recalculation
|
|
74
|
+
const difficultySettings = useMemo(() => getDifficultySettings(difficulty), [difficulty]);
|
|
267
75
|
|
|
268
|
-
//
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
76
|
+
// Game control functions with error handling and memoization
|
|
77
|
+
const handleStartGame = useCallback(() => wrapFunction(() => {
|
|
78
|
+
startGame(); // Store uses fixed 60s duration internally
|
|
79
|
+
if (gameService) {
|
|
80
|
+
gameService.updateDifficultySettings(difficultySettings.asteroidSpeed, difficultySettings.asteroidSpawnInterval);
|
|
81
|
+
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
82
|
+
updateSpacecraft(initialSpacecraft);
|
|
83
|
+
gameService.startGameTimer(decrementTime);
|
|
84
|
+
gameService.startAsteroidSpawning(addAsteroids);
|
|
85
|
+
gameService.startPhysicsLoop(updateSpacecraft, updateAsteroid, removeAsteroid, () => useSpaceFighterStore.getState().spacecraft, () => useSpaceFighterStore.getState().asteroids);
|
|
86
|
+
}
|
|
87
|
+
}, GameErrorType.INITIALIZATION_ERROR)(), [wrapFunction, startGame, gameService, difficultySettings, updateSpacecraft, decrementTime, addAsteroids, updateAsteroid, removeAsteroid]);
|
|
88
|
+
const handleStopGame = useCallback(() => wrapFunction(() => {
|
|
89
|
+
stopGame();
|
|
90
|
+
if (gameService) {
|
|
273
91
|
gameService.cleanup();
|
|
274
|
-
};
|
|
275
|
-
}, []);
|
|
276
|
-
const panGesture = Gesture.Pan().onStart(event => {
|
|
277
|
-
const currentSpacecraft = useSpaceFighterStore.getState().spacecraft;
|
|
278
|
-
initialSpacecraftPosition.current = {
|
|
279
|
-
x: currentSpacecraft.x,
|
|
280
|
-
y: currentSpacecraft.y
|
|
281
|
-
};
|
|
282
|
-
initialTouchPosition.current = {
|
|
283
|
-
x: event.absoluteX,
|
|
284
|
-
y: event.absoluteY
|
|
285
|
-
};
|
|
286
|
-
handleSpacecraftControlStart(currentSpacecraft.x, currentSpacecraft.y);
|
|
287
|
-
}).onUpdate(event => {
|
|
288
|
-
if (!initialSpacecraftPosition.current || !initialTouchPosition.current) {
|
|
289
|
-
return;
|
|
290
92
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
})
|
|
93
|
+
}, GameErrorType.UNKNOWN_ERROR)(), [wrapFunction, stopGame, gameService]);
|
|
94
|
+
const handleResetGame = useCallback(() => wrapFunction(() => {
|
|
95
|
+
if (gameService) {
|
|
96
|
+
gameService.cleanup();
|
|
97
|
+
}
|
|
98
|
+
resetGame();
|
|
99
|
+
if (gameService) {
|
|
100
|
+
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
101
|
+
updateSpacecraft(initialSpacecraft);
|
|
102
|
+
}
|
|
103
|
+
}, GameErrorType.UNKNOWN_ERROR)(), [wrapFunction, gameService, resetGame, updateSpacecraft]);
|
|
104
|
+
|
|
105
|
+
// Memoize component props to prevent unnecessary re-renders
|
|
106
|
+
const gameControlButtonProps = useMemo(() => ({
|
|
107
|
+
isPlaying,
|
|
108
|
+
gameOver,
|
|
109
|
+
onStartGame: handleStartGame,
|
|
110
|
+
onStopGame: handleStopGame,
|
|
111
|
+
startButtonText: "START FLYING",
|
|
112
|
+
stopButtonText: "STOP GAME",
|
|
113
|
+
startButtonSubtext: "Navigate through space!",
|
|
114
|
+
stopButtonSubtext: "End current game",
|
|
115
|
+
startButtonColor: "#9370db",
|
|
116
|
+
stopButtonColor: "#dc2626",
|
|
117
|
+
startButtonBorderColor: "#ba68c8",
|
|
118
|
+
stopButtonBorderColor: "#f87171"
|
|
119
|
+
}), [isPlaying, gameOver, handleStartGame, handleStopGame]);
|
|
120
|
+
const gameOverModalProps = useMemo(() => ({
|
|
121
|
+
isVisible: gameOver,
|
|
122
|
+
score,
|
|
123
|
+
onPlayAgain: handleResetGame,
|
|
124
|
+
buttonText: "Fly Again!",
|
|
125
|
+
primaryColor: "rgba(147, 112, 219, 0.8)",
|
|
126
|
+
borderColor: "rgba(147, 112, 219, 0.9)",
|
|
127
|
+
buttonColor: "#9370db",
|
|
128
|
+
buttonBorderColor: "#ba68c8"
|
|
129
|
+
}), [gameOver, score, handleResetGame]);
|
|
130
|
+
const gameSettingsModalProps = useMemo(() => ({
|
|
131
|
+
gameId: GAME_IDS.SPACE_FIGHTER,
|
|
132
|
+
settings,
|
|
133
|
+
onSettingsChange
|
|
134
|
+
}), [settings, onSettingsChange]);
|
|
302
135
|
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
303
136
|
style: {
|
|
304
137
|
flex: 1
|
|
305
138
|
},
|
|
306
|
-
children: /*#__PURE__*/_jsx(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
310
|
-
style:
|
|
311
|
-
|
|
312
|
-
position: 'relative',
|
|
313
|
-
paddingTop: 0,
|
|
314
|
-
paddingHorizontal: 20
|
|
315
|
-
},
|
|
316
|
-
children: /*#__PURE__*/_jsx(ScoreBoard, {
|
|
317
|
-
score: score,
|
|
318
|
-
timeLeft: timeLeft
|
|
319
|
-
})
|
|
320
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
321
|
-
style: {
|
|
322
|
-
flex: 1,
|
|
323
|
-
position: 'relative'
|
|
324
|
-
},
|
|
325
|
-
children: [/*#__PURE__*/_jsx(GameArea, {
|
|
326
|
-
asteroids: asteroids,
|
|
327
|
-
spacecraft: spacecraft,
|
|
328
|
-
particles: gameService.getParticles(),
|
|
329
|
-
spacecraftPath: spacecraftPath,
|
|
330
|
-
isControllingSpacecraft: isControllingSpacecraft,
|
|
331
|
-
onSpacecraftControl: handleSpacecraftControlMove,
|
|
332
|
-
onSpacecraftRelease: handleSpacecraftControlEnd
|
|
333
|
-
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
334
|
-
gesture: panGesture,
|
|
335
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
336
|
-
style: {
|
|
337
|
-
position: 'absolute',
|
|
338
|
-
top: 0,
|
|
339
|
-
left: 0,
|
|
340
|
-
right: 0,
|
|
341
|
-
bottom: 0,
|
|
342
|
-
backgroundColor: 'transparent',
|
|
343
|
-
zIndex: 10
|
|
344
|
-
}
|
|
345
|
-
})
|
|
346
|
-
})]
|
|
139
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
140
|
+
style: styles.container,
|
|
141
|
+
children: /*#__PURE__*/_jsxs(GameBackground, {
|
|
142
|
+
children: [/*#__PURE__*/_jsx(GameArea, {}), /*#__PURE__*/_jsx(View, {
|
|
143
|
+
style: styles.scoreboardContainer,
|
|
144
|
+
children: /*#__PURE__*/_jsx(ScoreBoard, {})
|
|
347
145
|
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
348
|
-
|
|
349
|
-
gameOver: gameOver,
|
|
350
|
-
onStartGame: handleStartGame,
|
|
351
|
-
onStopGame: handleStopGame,
|
|
352
|
-
startButtonText: "START FLYING",
|
|
353
|
-
stopButtonText: "STOP GAME",
|
|
354
|
-
startButtonSubtext: "Navigate through space!",
|
|
355
|
-
stopButtonSubtext: "End current game",
|
|
356
|
-
startButtonColor: "#9370db",
|
|
357
|
-
stopButtonColor: "#dc2626",
|
|
358
|
-
startButtonBorderColor: "#ba68c8",
|
|
359
|
-
stopButtonBorderColor: "#f87171"
|
|
146
|
+
...gameControlButtonProps
|
|
360
147
|
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}), /*#__PURE__*/_jsx(Modal, {
|
|
365
|
-
visible: showSettingsModal,
|
|
366
|
-
animationType: "slide",
|
|
367
|
-
presentationStyle: "pageSheet",
|
|
368
|
-
onRequestClose: onToggleSettingsModal,
|
|
369
|
-
children: /*#__PURE__*/_jsx(GameSettings, {
|
|
370
|
-
gameId: "space-fighter",
|
|
371
|
-
onClose: onToggleSettingsModal || (() => {}),
|
|
372
|
-
settingsStore: settings
|
|
373
|
-
})
|
|
148
|
+
...gameOverModalProps
|
|
149
|
+
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
150
|
+
...gameSettingsModalProps
|
|
374
151
|
})]
|
|
375
152
|
})
|
|
376
153
|
})
|
|
@@ -380,38 +157,13 @@ const styles = StyleSheet.create({
|
|
|
380
157
|
container: {
|
|
381
158
|
flex: 1
|
|
382
159
|
},
|
|
383
|
-
|
|
160
|
+
scoreboardContainer: {
|
|
384
161
|
position: 'absolute',
|
|
385
162
|
top: 0,
|
|
386
|
-
left:
|
|
387
|
-
right:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
justifyContent: 'center',
|
|
391
|
-
alignItems: 'center'
|
|
392
|
-
},
|
|
393
|
-
settingsModal: {
|
|
394
|
-
backgroundColor: '#1e3a8a',
|
|
395
|
-
// bg-blue-900
|
|
396
|
-
padding: 24,
|
|
397
|
-
borderRadius: 16
|
|
398
|
-
},
|
|
399
|
-
settingsTitle: {
|
|
400
|
-
color: '#ffffff',
|
|
401
|
-
fontSize: 20,
|
|
402
|
-
fontWeight: 'bold',
|
|
403
|
-
marginBottom: 16
|
|
404
|
-
},
|
|
405
|
-
closeButton: {
|
|
406
|
-
backgroundColor: '#2563eb',
|
|
407
|
-
// bg-blue-600
|
|
408
|
-
paddingVertical: 8,
|
|
409
|
-
paddingHorizontal: 16,
|
|
410
|
-
borderRadius: 8
|
|
411
|
-
},
|
|
412
|
-
closeButtonText: {
|
|
413
|
-
color: '#ffffff',
|
|
414
|
-
fontWeight: '600'
|
|
163
|
+
left: 20,
|
|
164
|
+
right: 20,
|
|
165
|
+
zIndex: 100,
|
|
166
|
+
pointerEvents: 'none' // Allow touches to pass through to spacecraft below
|
|
415
167
|
}
|
|
416
168
|
});
|
|
417
169
|
//# sourceMappingURL=SpaceFighter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","useMemo","View","Dimensions","StyleSheet","Modal","Gesture","GestureDetector","GestureHandlerRootView","playSound","stopAllSounds","GAME_SOUNDS","playHaptic","HapticType","useSpaceFighterStore","createSpaceFighterService","ScoreBoard","GameArea","GameOverModal","GameBackground","GameControlButton","DEFAULT_SPACE_FIGHTER_SETTINGS","getDifficultySettings","GameSettings","createGameSettingsStore","jsx","_jsx","jsxs","_jsxs","width","height","get","SpaceFighter","showSettingsModal","onToggleSettingsModal","settings","externalSettings","onSettingsChange","gameService","current","settingsStore","defaultSettings","handleSettingsChange","newSettings","spaceFighterSettings","difficulty","soundEnabled","hapticEnabled","gameDuration","undefined","prevSettingsRef","prev","hasChanged","commonSettings","updateSettings","gameConstants","difficultySettings","asteroidSpawnInterval","asteroidSpeed","score","timeLeft","isPlaying","gameOver","asteroids","spacecraft","spacecraftPath","isControllingSpacecraft","startGame","stopGame","resetGame","decrementTime","addAsteroids","removeAsteroid","updateAsteroid","updateSpacecraft","setSpacecraftPath","setIsControllingSpacecraft","markAsteroidPassed","loseLife","currentSpacecraftPath","dragOffset","initialSpacecraftPosition","initialTouchPosition","pendingSpacecraftUpdate","animationFrameId","lastCollisionTime","handleSpacecraftControlStart","x","y","currentSpacecraft","getState","controlledSpacecraft","controlSpacecraft","processPendingSpacecraftUpdate","push","length","shift","handleSpacecraftControlMove","requestAnimationFrame","handleSpacecraftControlEnd","cancelAnimationFrame","releasedSpacecraft","releaseSpacecraft","setTimeout","playSuccessSound","SPACE_FIGHTER","SUCCESS","LIGHT","playCollisionSound","COLLISION","HEAVY","playGameOverSound","GAME_OVER","handleStartGame","updateDifficultySettings","initialSpacecraft","getInitialSpacecraft","startGameTimer","startAsteroidSpawning","startPhysicsLoop","START","handleStopGame","cleanup","handleResetGame","interval","setInterval","currentAsteroids","collision","checkCollision","now","Date","createCollisionParticles","resetSpacecraft","passedAsteroids","checkAsteroidPass","forEach","pairId","clearInterval","panGesture","Pan","onStart","event","absoluteX","absoluteY","onUpdate","dx","newX","newY","onEnd","onFinalize","runOnJS","style","flex","children","styles","container","zIndex","position","paddingTop","paddingHorizontal","particles","getParticles","onSpacecraftControl","onSpacecraftRelease","gesture","top","left","right","bottom","backgroundColor","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","isVisible","onPlayAgain","visible","animationType","presentationStyle","onRequestClose","gameId","onClose","create","settingsOverlay","justifyContent","alignItems","settingsModal","padding","borderRadius","settingsTitle","color","fontSize","fontWeight","marginBottom","closeButton","paddingVertical","closeButtonText"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighter.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAClD,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAClE,SAASC,OAAO,EAAEC,eAAe,EAAEC,sBAAsB,QAAQ,8BAA8B;AAC/F,SAASC,SAAS,EAAEC,aAAa,EAAEC,WAAW,QAAQ,iCAA8B;AACpF,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AACtE,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,yBAAyB,QAAQ,0BAAuB;AACjE,SAASC,UAAU,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,cAAc,QAAQ,uBAAc;AAClF,SAASC,iBAAiB,QAAQ,+BAAsB;AACxD,SAEEC,8BAA8B,EAC9BC,qBAAqB,QAChB,4BAAyB;AAChC,SAASC,YAAY,QAAQ,uCAAoC;AACjE,SAASC,uBAAuB,QAAQ,0CAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhF,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAG3B,UAAU,CAAC4B,GAAG,CAAC,QAAQ,CAAC;AASlD,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAC3BC,iBAAiB,GAAG,KAAK;EACzBC,qBAAqB;EACrBC,QAAQ,EAAEC,gBAAgB;EAC1BC;AACiB,CAAC,KAAK;EACvB,IAAIC,WAAW,GAAGtC,MAAM,CAACe,yBAAyB,CAACc,KAAK,EAAEC,MAAM,CAAC,CAAC,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,aAAa,EAAE;IACbC,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,YAAY,EAAE;EAChB,CAAC;EACDC,WAAW,EAAE;IACX/B,eAAe,EAAE,SAAS;IAAE;IAC5BgC,eAAe,EAAE,CAAC;IAClB1C,iBAAiB,EAAE,EAAE;IACrBmC,YAAY,EAAE;EAChB,CAAC;EACDQ,eAAe,EAAE;IACfN,KAAK,EAAE,SAAS;IAChBE,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useCallback","useMemo","View","StyleSheet","Dimensions","GestureHandlerRootView","useSpaceFighterStore","createSpaceFighterService","getDifficultySettings","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","jsx","_jsx","jsxs","_jsxs","width","height","get","SpaceFighter","settings","onSettingsChange","difficulty","isPlaying","state","gameOver","score","startGame","stopGame","resetGame","decrementTime","addAsteroids","removeAsteroid","updateAsteroid","updateSpacecraft","wrapFunction","safeExecute","SPACE_FIGHTER","gameService","INITIALIZATION_ERROR","handleResetGame","cleanup","difficultySettings","handleStartGame","updateDifficultySettings","asteroidSpeed","asteroidSpawnInterval","initialSpacecraft","getInitialSpacecraft","startGameTimer","startAsteroidSpawning","startPhysicsLoop","getState","spacecraft","asteroids","handleStopGame","UNKNOWN_ERROR","gameControlButtonProps","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameSettingsModalProps","gameId","style","flex","children","styles","container","scoreboardContainer","create","position","top","left","right","zIndex","pointerEvents"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighter.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,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B,aAAa;IAC9BjB,QAAQ;IACRC;EACF,CAAC,CAAC,EAAE,CAACD,QAAQ,EAAEC,gBAAgB,CAAC,CAAC;EAEjC,oBACER,IAAA,CAACd,sBAAsB;IAAC+E,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE,CAAE;IAAAC,QAAA,eACzCnE,IAAA,CAACjB,IAAI;MAACkF,KAAK,EAAEG,MAAM,CAACC,SAAU;MAAAF,QAAA,eAC5BjE,KAAA,CAACV,cAAc;QAAA2E,QAAA,gBAEbnE,IAAA,CAACT,QAAQ,IAAE,CAAC,eAEZS,IAAA,CAACjB,IAAI;UAACkF,KAAK,EAAEG,MAAM,CAACE,mBAAoB;UAAAH,QAAA,eACtCnE,IAAA,CAACV,UAAU,IAAE;QAAC,CACV,CAAC,eAGPU,IAAA,CAACP,iBAAiB;UAAA,GAAKmD;QAAsB,CAAG,CAAC,eAEjD5C,IAAA,CAACN,aAAa;UAAA,GAAK6D;QAAkB,CAAG,CAAC,eAGzCvD,IAAA,CAACH,iBAAiB;UAAA,GAAKkE;QAAsB,CAAG,CAAC;MAAA,CACnC;IAAC,CACb;EAAC,CACe,CAAC;AAE7B,CAAC;AAED,MAAMK,MAAM,GAAGpF,UAAU,CAACuF,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTH,IAAI,EAAE;EACR,CAAC;EACDI,mBAAmB,EAAE;IACnBE,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,GAAG;IACXC,aAAa,EAAE,MAAM,CAAE;EACzB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -75,36 +75,34 @@ export const SPACE_FIGHTER_COLORS = {
|
|
|
75
75
|
STARS: '#ffffff' // White for stars
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
// Space Fighter Game Theme
|
|
78
|
+
// Space Fighter Game Theme - Matches scoreboard purple
|
|
79
79
|
export const SPACE_FIGHTER_THEME = {
|
|
80
|
-
backgroundColor: '#
|
|
81
|
-
//
|
|
82
|
-
headerBackgroundColor: 'rgba(
|
|
83
|
-
//
|
|
80
|
+
backgroundColor: '#1a1b3a',
|
|
81
|
+
// Lighter space purple for better visibility in modal
|
|
82
|
+
headerBackgroundColor: 'rgba(147, 112, 219, 0.9)',
|
|
83
|
+
// Purple header to match scoreboard
|
|
84
84
|
headerTextColor: '#ffffff',
|
|
85
|
-
sectionBackgroundColor: 'rgba(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
sectionBackgroundColor: 'rgba(147, 112, 219, 0.4)',
|
|
86
|
+
// Match scoreboard transparency
|
|
87
|
+
sectionTitleColor: '#ffffff',
|
|
88
|
+
// White text on purple sections
|
|
89
|
+
buttonSelectedColor: '#9370db',
|
|
90
|
+
// Match start button purple
|
|
90
91
|
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
91
92
|
buttonSelectedTextColor: '#ffffff',
|
|
92
|
-
buttonUnselectedTextColor: '#
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
resetButtonColor: '#ef4444',
|
|
100
|
-
// Red
|
|
101
|
-
resetButtonTextColor: '#ffffff'
|
|
93
|
+
buttonUnselectedTextColor: '#ffffff',
|
|
94
|
+
// White text for space theme
|
|
95
|
+
switchTrackColorFalse: 'rgba(147, 112, 219, 0.5)',
|
|
96
|
+
switchTrackColorTrue: '#9370db',
|
|
97
|
+
// Match start button
|
|
98
|
+
switchThumbColor: '#ffffff',
|
|
99
|
+
infoTextColor: '#ffffff' // White text for readability on dark background
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
// Space Fighter Difficulty Descriptions
|
|
105
103
|
export const SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS = {
|
|
106
|
-
easy: '
|
|
107
|
-
medium: '
|
|
108
|
-
hard: '
|
|
104
|
+
easy: 'Slow asteroids, relaxed gameplay',
|
|
105
|
+
medium: 'Normal asteroid speed, balanced challenge',
|
|
106
|
+
hard: 'Fast asteroids, quick reflexes needed!'
|
|
109
107
|
};
|
|
110
108
|
//# sourceMappingURL=SpaceFighterConstants.js.map
|