react-native-games 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +134 -130
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +116 -343
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +182 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +123 -101
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +119 -92
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +123 -113
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +137 -23
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameBackground.js +8 -83
- package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +15 -22
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -4
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinja.js +143 -0
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +148 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -0
- package/lib/module/games/{fruit-slicer/FruitSlicerService.js → fruit-ninja/FruitNinjaService.js} +43 -21
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +191 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.js +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js +215 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameBackground.js +250 -304
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.js +17 -47
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/index.js +7 -0
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +184 -169
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +100 -0
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunnerService.js +37 -14
- package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +20 -15
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
- package/lib/module/games/maze-runner/components/GameBackground.js +151 -192
- package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +15 -25
- package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
- package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/index.js +0 -2
- package/lib/module/games/maze-runner/components/index.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +294 -0
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +113 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js +132 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +163 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +198 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +165 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js.map +1 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js +177 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +75 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/popit-fidget/components/index.js +7 -0
- package/lib/module/games/popit-fidget/components/index.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighter.js +169 -0
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +108 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -0
- package/lib/module/games/{space-traveller/SpaceTravellerService.js → space-fighter/SpaceFighterService.js} +48 -21
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js +195 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/AsteroidComponent.js +7 -5
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameArea.js +295 -0
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/GameBackground.js +10 -65
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/ScoreBoard.js +20 -26
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/Spacecraft3D.js +72 -111
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +52 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/index.js +0 -4
- package/lib/module/games/space-fighter/components/index.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js +263 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +115 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +120 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +172 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameBackground.js +31 -91
- package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js +97 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameHole.js +67 -54
- package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -0
- package/lib/module/games/{cat-popper/components/CatCharacter.js → whack-a-mole/components/MoleCharacter.js} +75 -115
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/ScoreBoard.js +13 -17
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/index.js +1 -3
- package/lib/module/games/whack-a-mole/components/index.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +41 -519
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +35 -23
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +77 -0
- package/lib/module/services/HapticsService.js.map +1 -0
- package/lib/module/services/SoundsService.js +171 -0
- package/lib/module/services/SoundsService.js.map +1 -0
- package/lib/module/shared/helpers/AnimationFrame.js +120 -0
- package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
- package/lib/module/shared/helpers/AnimationTracker.js +89 -0
- package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
- package/lib/module/shared/helpers/ErrorHandler.js +269 -0
- package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
- package/lib/module/shared/helpers/GameControlButton.js +219 -0
- package/lib/module/shared/helpers/GameControlButton.js.map +1 -0
- package/lib/module/{games/balloon-blaster/components → shared/helpers}/GameOverModal.js +25 -17
- package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
- package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
- package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
- package/lib/module/shared/helpers/ParticleBlast.js +133 -0
- package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js +81 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js.map +1 -0
- package/lib/module/shared/helpers/index.js +12 -0
- package/lib/module/shared/helpers/index.js.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +144 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +12 -2
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -4
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +4 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +112 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerService.d.ts → fruit-ninja/FruitNinjaService.d.ts} +13 -5
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerStore.d.ts → fruit-ninja/FruitNinjaStore.d.ts} +13 -4
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.d.ts +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/FruitComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +5 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -16
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +41 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +4 -2
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +2 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -2
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +45 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +33 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +36 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +9 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +4 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +71 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerService.d.ts → space-fighter/SpaceFighterService.d.ts} +7 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerStore.d.ts → space-fighter/SpaceFighterStore.d.ts} +12 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +8 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/Spacecraft3D.d.ts +1 -1
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/index.d.ts +0 -4
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +4 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +79 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts +33 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts +41 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameGrid.d.ts +2 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameHole.d.ts +3 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameHole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts +7 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +6 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +61 -340
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +21 -3
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/HapticsService.d.ts +16 -0
- package/lib/typescript/src/services/HapticsService.d.ts.map +1 -0
- package/lib/typescript/src/services/SoundsService.d.ts +154 -0
- package/lib/typescript/src/services/SoundsService.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts +17 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -0
- package/lib/typescript/src/{games/cat-popper/components → shared/helpers}/GameOverModal.d.ts +5 -0
- package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts +42 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/index.d.ts +13 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -0
- package/package.json +9 -6
- package/lib/module/games/balloon-blaster/components/GameControls.js +0 -229
- package/lib/module/games/balloon-blaster/components/GameControls.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -52
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
- package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopper.js +0 -230
- package/lib/module/games/cat-popper/CatPopper.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperService.js +0 -100
- package/lib/module/games/cat-popper/CatPopperService.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperStore.js +0 -113
- package/lib/module/games/cat-popper/CatPopperStore.js.map +0 -1
- package/lib/module/games/cat-popper/components/CatCharacter.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameBackground.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameControls.js +0 -230
- package/lib/module/games/cat-popper/components/GameControls.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameGrid.js +0 -66
- package/lib/module/games/cat-popper/components/GameGrid.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameHole.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameOverModal.js +0 -131
- package/lib/module/games/cat-popper/components/GameOverModal.js.map +0 -1
- package/lib/module/games/cat-popper/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/cat-popper/components/index.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicer.js +0 -411
- package/lib/module/games/fruit-slicer/FruitSlicer.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js +0 -156
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameArea.js +0 -50
- package/lib/module/games/fruit-slicer/components/GameArea.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameBackground.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameControls.js +0 -230
- package/lib/module/games/fruit-slicer/components/GameControls.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameOverModal.js +0 -189
- package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js +0 -52
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/SliceTrail.js +0 -58
- package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/index.js +0 -11
- package/lib/module/games/fruit-slicer/components/index.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameControls.js +0 -129
- package/lib/module/games/maze-runner/components/GameControls.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
- package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTraveller.js +0 -393
- package/lib/module/games/space-traveller/SpaceTraveller.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerService.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerStore.js +0 -139
- package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +0 -1
- package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameArea.js +0 -75
- package/lib/module/games/space-traveller/components/GameArea.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameBackground.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameControls.js +0 -177
- package/lib/module/games/space-traveller/components/GameControls.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameOverModal.js +0 -182
- package/lib/module/games/space-traveller/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/ParticleComponent.js +0 -34
- package/lib/module/games/space-traveller/components/ParticleComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/space-traveller/components/SettingsModal.js +0 -222
- package/lib/module/games/space-traveller/components/SettingsModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +0 -1
- package/lib/module/games/space-traveller/components/SpacecraftPath.js +0 -37
- package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +0 -1
- package/lib/module/games/space-traveller/components/index.js.map +0 -1
- package/lib/module/shared/settings/GameSettings.js +0 -295
- package/lib/module/shared/settings/GameSettings.js.map +0 -1
- package/lib/module/shared/settings/SettingsService.js +0 -119
- package/lib/module/shared/settings/SettingsService.js.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +0 -13
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +0 -32
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +0 -21
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +0 -7
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/index.d.ts +0 -8
- package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +0 -16
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
- package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -32
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
- /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → space-fighter}/components/SpacecraftPath.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → whack-a-mole}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/ScoreBoard.d.ts +0 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { Canvas, LinearGradient, Rect, Circle, vec } from '@shopify/react-native-skia';
|
|
6
|
+
import { RAINBOW_COLORS } from "../PopitFidgetConstants.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const GameBackground = ({
|
|
9
|
+
width,
|
|
10
|
+
height
|
|
11
|
+
}) => {
|
|
12
|
+
// Generate static colorful floating bubble decorations with subtle positioning variations
|
|
13
|
+
const generateFloatingBubbles = React.useMemo(() => {
|
|
14
|
+
const bubbles = [];
|
|
15
|
+
const bubbleCount = 15; // Reduced count for better performance
|
|
16
|
+
|
|
17
|
+
for (let i = 0; i < bubbleCount; i++) {
|
|
18
|
+
const baseX = width / bubbleCount * i;
|
|
19
|
+
const baseY = height / bubbleCount * i;
|
|
20
|
+
|
|
21
|
+
// Add subtle random offset for natural look
|
|
22
|
+
const x = baseX + Math.sin(i * 0.5) * 30 + Math.random() * 60;
|
|
23
|
+
const y = baseY + Math.cos(i * 0.7) * 40 + Math.random() * 80;
|
|
24
|
+
const radius = 8 + Math.random() * 12;
|
|
25
|
+
const colorIndex = i % RAINBOW_COLORS.length; // Cycle through colors for consistency
|
|
26
|
+
const opacity = 0.2 + Math.sin(i) * 0.1; // Subtle opacity variation
|
|
27
|
+
|
|
28
|
+
bubbles.push(/*#__PURE__*/_jsx(Circle, {
|
|
29
|
+
cx: Math.max(radius, Math.min(width - radius, x)),
|
|
30
|
+
cy: Math.max(radius, Math.min(height - radius, y)),
|
|
31
|
+
r: radius,
|
|
32
|
+
color: `${RAINBOW_COLORS[colorIndex]}${Math.floor(opacity * 255).toString(16).padStart(2, '0')}`
|
|
33
|
+
}, `floating-bubble-${i}`));
|
|
34
|
+
}
|
|
35
|
+
return bubbles;
|
|
36
|
+
}, [width, height]);
|
|
37
|
+
return /*#__PURE__*/_jsx(View, {
|
|
38
|
+
style: StyleSheet.absoluteFillObject,
|
|
39
|
+
children: /*#__PURE__*/_jsxs(Canvas, {
|
|
40
|
+
style: {
|
|
41
|
+
width,
|
|
42
|
+
height
|
|
43
|
+
},
|
|
44
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0,
|
|
47
|
+
width: width,
|
|
48
|
+
height: height,
|
|
49
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
50
|
+
start: vec(0, 0),
|
|
51
|
+
end: vec(width, height),
|
|
52
|
+
colors: [`${RAINBOW_COLORS[0]}40`,
|
|
53
|
+
// Vibrant pink
|
|
54
|
+
`${RAINBOW_COLORS[2]}35`,
|
|
55
|
+
// Vibrant orange
|
|
56
|
+
`${RAINBOW_COLORS[4]}40`,
|
|
57
|
+
// Vibrant yellow
|
|
58
|
+
`${RAINBOW_COLORS[6]}35`,
|
|
59
|
+
// Vibrant lime
|
|
60
|
+
`${RAINBOW_COLORS[8]}40`,
|
|
61
|
+
// Vibrant green
|
|
62
|
+
`${RAINBOW_COLORS[10]}35`,
|
|
63
|
+
// Vibrant cyan
|
|
64
|
+
`${RAINBOW_COLORS[12]}40`,
|
|
65
|
+
// Vibrant blue
|
|
66
|
+
`${RAINBOW_COLORS[14]}35` // Vibrant purple
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
}), /*#__PURE__*/_jsx(Rect, {
|
|
70
|
+
x: 0,
|
|
71
|
+
y: 0,
|
|
72
|
+
width: width,
|
|
73
|
+
height: height,
|
|
74
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
75
|
+
start: vec(0, 0),
|
|
76
|
+
end: vec(width / 2, height / 2),
|
|
77
|
+
colors: [`${RAINBOW_COLORS[1]}25`,
|
|
78
|
+
// Bright red
|
|
79
|
+
'transparent', `${RAINBOW_COLORS[5]}25`,
|
|
80
|
+
// Bright deep purple
|
|
81
|
+
'transparent', `${RAINBOW_COLORS[9]}25`,
|
|
82
|
+
// Bright teal
|
|
83
|
+
'transparent', `${RAINBOW_COLORS[13]}25`,
|
|
84
|
+
// Bright indigo
|
|
85
|
+
'transparent']
|
|
86
|
+
})
|
|
87
|
+
}), /*#__PURE__*/_jsx(Rect, {
|
|
88
|
+
x: 0,
|
|
89
|
+
y: 0,
|
|
90
|
+
width: width,
|
|
91
|
+
height: height,
|
|
92
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
93
|
+
start: vec(width, 0),
|
|
94
|
+
end: vec(0, height),
|
|
95
|
+
colors: [`${RAINBOW_COLORS[3]}20`,
|
|
96
|
+
// Bright orange
|
|
97
|
+
'transparent', `${RAINBOW_COLORS[7]}20`,
|
|
98
|
+
// Bright light green
|
|
99
|
+
'transparent', `${RAINBOW_COLORS[11]}20`,
|
|
100
|
+
// Bright light blue
|
|
101
|
+
'transparent']
|
|
102
|
+
})
|
|
103
|
+
}), generateFloatingBubbles, /*#__PURE__*/_jsx(Circle, {
|
|
104
|
+
cx: width * 0.1,
|
|
105
|
+
cy: height * 0.15,
|
|
106
|
+
r: 40,
|
|
107
|
+
color: `${RAINBOW_COLORS[0]}30` // Vibrant pink
|
|
108
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
109
|
+
cx: width * 0.9,
|
|
110
|
+
cy: height * 0.85,
|
|
111
|
+
r: 35,
|
|
112
|
+
color: `${RAINBOW_COLORS[3]}30` // Vibrant orange
|
|
113
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
114
|
+
cx: width * 0.85,
|
|
115
|
+
cy: height * 0.2,
|
|
116
|
+
r: 30,
|
|
117
|
+
color: `${RAINBOW_COLORS[8]}30` // Vibrant green
|
|
118
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
119
|
+
cx: width * 0.15,
|
|
120
|
+
cy: height * 0.8,
|
|
121
|
+
r: 45,
|
|
122
|
+
color: `${RAINBOW_COLORS[12]}30` // Vibrant blue
|
|
123
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
124
|
+
cx: width * 0.5,
|
|
125
|
+
cy: height * 0.1,
|
|
126
|
+
r: 25,
|
|
127
|
+
color: `${RAINBOW_COLORS[14]}30` // Vibrant purple
|
|
128
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
129
|
+
cx: width * 0.2,
|
|
130
|
+
cy: height * 0.5,
|
|
131
|
+
r: 32,
|
|
132
|
+
color: `${RAINBOW_COLORS[6]}30` // Vibrant lime
|
|
133
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
134
|
+
cx: width * 0.8,
|
|
135
|
+
cy: height * 0.6,
|
|
136
|
+
r: 28,
|
|
137
|
+
color: `${RAINBOW_COLORS[10]}30` // Vibrant cyan
|
|
138
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
139
|
+
cx: width * 0.6,
|
|
140
|
+
cy: height * 0.9,
|
|
141
|
+
r: 20,
|
|
142
|
+
color: `${RAINBOW_COLORS[1]}30` // Vibrant red
|
|
143
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
144
|
+
cx: width * 0.3,
|
|
145
|
+
cy: height * 0.25,
|
|
146
|
+
r: 24,
|
|
147
|
+
color: `${RAINBOW_COLORS[4]}30` // Vibrant yellow
|
|
148
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
149
|
+
cx: width * 0.7,
|
|
150
|
+
cy: height * 0.35,
|
|
151
|
+
r: 26,
|
|
152
|
+
color: `${RAINBOW_COLORS[9]}30` // Vibrant teal
|
|
153
|
+
}), Array.from({
|
|
154
|
+
length: Math.floor(width / 40)
|
|
155
|
+
}, (_, i) => /*#__PURE__*/_jsx(Rect, {
|
|
156
|
+
x: i * 40,
|
|
157
|
+
y: 0,
|
|
158
|
+
width: 1,
|
|
159
|
+
height: height,
|
|
160
|
+
color: "rgba(0, 0, 0, 0.02)"
|
|
161
|
+
}, `grid-v-${i}`)), Array.from({
|
|
162
|
+
length: Math.floor(height / 40)
|
|
163
|
+
}, (_, i) => /*#__PURE__*/_jsx(Rect, {
|
|
164
|
+
x: 0,
|
|
165
|
+
y: i * 40,
|
|
166
|
+
width: width,
|
|
167
|
+
height: 1,
|
|
168
|
+
color: "rgba(0, 0, 0, 0.02)"
|
|
169
|
+
}, `grid-h-${i}`))]
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// Memoize GameBackground to prevent unnecessary re-renders
|
|
175
|
+
const MemoizedGameBackground = /*#__PURE__*/React.memo(GameBackground);
|
|
176
|
+
export default MemoizedGameBackground;
|
|
177
|
+
//# sourceMappingURL=GameBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Canvas","LinearGradient","Rect","Circle","vec","RAINBOW_COLORS","jsx","_jsx","jsxs","_jsxs","GameBackground","width","height","generateFloatingBubbles","useMemo","bubbles","bubbleCount","i","baseX","baseY","x","Math","sin","random","y","cos","radius","colorIndex","length","opacity","push","cx","max","min","cy","r","color","floor","toString","padStart","style","absoluteFillObject","children","start","end","colors","Array","from","_","MemoizedGameBackground","memo"],"sourceRoot":"../../../../../src","sources":["games/popit-fidget/components/GameBackground.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,MAAM,EAAEC,cAAc,EAAEC,IAAI,EAAEC,MAAM,EAAEC,GAAG,QAAQ,4BAA4B;AACtF,SAASC,cAAc,QAAQ,4BAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQzD,MAAMC,cAA6C,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAO,CAAC,KAAK;EAE3E;EACA,MAAMC,uBAAuB,GAAGhB,KAAK,CAACiB,OAAO,CAAC,MAAM;IAClD,MAAMC,OAAO,GAAG,EAAE;IAClB,MAAMC,WAAW,GAAG,EAAE,CAAC,CAAC;;IAExB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,WAAW,EAAEC,CAAC,EAAE,EAAE;MACpC,MAAMC,KAAK,GAAIP,KAAK,GAAGK,WAAW,GAAIC,CAAC;MACvC,MAAME,KAAK,GAAIP,MAAM,GAAGI,WAAW,GAAIC,CAAC;;MAExC;MACA,MAAMG,CAAC,GAAGF,KAAK,GAAIG,IAAI,CAACC,GAAG,CAACL,CAAC,GAAG,GAAG,CAAC,GAAG,EAAG,GAAGI,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE;MAC/D,MAAMC,CAAC,GAAGL,KAAK,GAAIE,IAAI,CAACI,GAAG,CAACR,CAAC,GAAG,GAAG,CAAC,GAAG,EAAG,GAAGI,IAAI,CAACE,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,CAACJ,MAAM;QACL4B,EAAE,EAAEpB,KAAK,GAAG,GAAI;QAChBuB,EAAE,EAAEtB,MAAM,GAAG,IAAK;QAClBuB,CAAC,EAAE,EAAG;QACNC,KAAK,EAAE,GAAG/B,cAAc,CAAC,CAAC,CAAC,IAAK,CAAC;MAAA,CAClC,CAAC,EAGDyC,KAAK,CAACC,IAAI,CAAC;QAAEnB,MAAM,EAAEP,IAAI,CAACgB,KAAK,CAAC1B,KAAK,GAAG,EAAE;MAAE,CAAC,EAAE,CAACqC,CAAC,EAAE/B,CAAC,kBACnDV,IAAA,CAACL,IAAI;QAEHkB,CAAC,EAAEH,CAAC,GAAG,EAAG;QACVO,CAAC,EAAE,CAAE;QACLb,KAAK,EAAE,CAAE;QACTC,MAAM,EAAEA,MAAO;QACfwB,KAAK,EAAC;MAAqB,GALtB,UAAUnB,CAAC,EAMjB,CACF,CAAC,EACD6B,KAAK,CAACC,IAAI,CAAC;QAAEnB,MAAM,EAAEP,IAAI,CAACgB,KAAK,CAACzB,MAAM,GAAG,EAAE;MAAE,CAAC,EAAE,CAACoC,CAAC,EAAE/B,CAAC,kBACpDV,IAAA,CAACL,IAAI;QAEHkB,CAAC,EAAE,CAAE;QACLI,CAAC,EAAEP,CAAC,GAAG,EAAG;QACVN,KAAK,EAAEA,KAAM;QACbC,MAAM,EAAE,CAAE;QACVwB,KAAK,EAAC;MAAqB,GALtB,UAAUnB,CAAC,EAMjB,CACF,CAAC;IAAA,CACI;EAAC,CACL,CAAC;AAEX,CAAC;;AAED;AACA,MAAMgC,sBAAsB,gBAAGpD,KAAK,CAACqD,IAAI,CAACxC,cAAc,CAAC;AAEzD,eAAeuC,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
+
import { RESPONSIVE_SCOREBOARD_CONTAINER, RESPONSIVE_SCOREBOARD_FONTS } from "../../../shared/helpers/index.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const ScoreBoard = ({
|
|
8
|
+
score,
|
|
9
|
+
timeLeft
|
|
10
|
+
}) => {
|
|
11
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
12
|
+
style: styles.scoreBoard,
|
|
13
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
14
|
+
style: styles.scoreSection,
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
16
|
+
style: styles.scoreLabel,
|
|
17
|
+
children: "Score"
|
|
18
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
19
|
+
style: styles.scoreValue,
|
|
20
|
+
children: score
|
|
21
|
+
})]
|
|
22
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
23
|
+
style: styles.scoreSection,
|
|
24
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
25
|
+
style: styles.scoreLabel,
|
|
26
|
+
children: "Time"
|
|
27
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
28
|
+
style: styles.timeValue,
|
|
29
|
+
children: timeLeft
|
|
30
|
+
})]
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Memoize ScoreBoard to prevent unnecessary re-renders
|
|
36
|
+
const MemoizedScoreBoard = /*#__PURE__*/React.memo(ScoreBoard);
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
scoreBoard: {
|
|
39
|
+
...RESPONSIVE_SCOREBOARD_CONTAINER,
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: 0,
|
|
42
|
+
left: 20,
|
|
43
|
+
right: 20,
|
|
44
|
+
zIndex: 100,
|
|
45
|
+
flexDirection: 'row',
|
|
46
|
+
justifyContent: 'space-between',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
backgroundColor: 'rgba(108, 92, 231, 0.4)',
|
|
49
|
+
// Purple background for Pop It theme
|
|
50
|
+
borderWidth: 1,
|
|
51
|
+
borderColor: 'rgba(139, 92, 246, 0.3)' // Subtle purple border instead of white
|
|
52
|
+
},
|
|
53
|
+
scoreSection: {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
flex: 1
|
|
56
|
+
},
|
|
57
|
+
scoreLabel: {
|
|
58
|
+
fontSize: RESPONSIVE_SCOREBOARD_FONTS.labelSize,
|
|
59
|
+
fontWeight: 'bold',
|
|
60
|
+
color: '#ffffff',
|
|
61
|
+
marginBottom: 4
|
|
62
|
+
},
|
|
63
|
+
scoreValue: {
|
|
64
|
+
fontSize: RESPONSIVE_SCOREBOARD_FONTS.valueSize,
|
|
65
|
+
fontWeight: 'bold',
|
|
66
|
+
color: '#1e1b4b' // Dark purple color for Pop It theme
|
|
67
|
+
},
|
|
68
|
+
timeValue: {
|
|
69
|
+
fontSize: RESPONSIVE_SCOREBOARD_FONTS.timeSize,
|
|
70
|
+
fontWeight: 'bold',
|
|
71
|
+
color: '#1e1b4b' // Dark purple color for Pop It theme
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
export default MemoizedScoreBoard;
|
|
75
|
+
//# sourceMappingURL=ScoreBoard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","StyleSheet","RESPONSIVE_SCOREBOARD_CONTAINER","RESPONSIVE_SCOREBOARD_FONTS","jsx","_jsx","jsxs","_jsxs","ScoreBoard","score","timeLeft","style","styles","scoreBoard","children","scoreSection","scoreLabel","scoreValue","timeValue","MemoizedScoreBoard","memo","create","position","top","left","right","zIndex","flexDirection","justifyContent","alignItems","backgroundColor","borderWidth","borderColor","flex","fontSize","labelSize","fontWeight","color","marginBottom","valueSize","timeSize"],"sourceRoot":"../../../../../src","sources":["games/popit-fidget/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAA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c,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,yBAAyB;IAAE;IAC5CC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,yBAAyB,CAAE;EAC1C,CAAC;EACDjB,YAAY,EAAE;IACZc,UAAU,EAAE,QAAQ;IACpBI,IAAI,EAAE;EACR,CAAC;EACDjB,UAAU,EAAE;IACVkB,QAAQ,EAAE/B,2BAA2B,CAACgC,SAAS;IAC/CC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS;IAChBC,YAAY,EAAE;EAChB,CAAC;EACDrB,UAAU,EAAE;IACViB,QAAQ,EAAE/B,2BAA2B,CAACoC,SAAS;IAC/CH,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDnB,SAAS,EAAE;IACTgB,QAAQ,EAAE/B,2BAA2B,CAACqC,QAAQ;IAC9CJ,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB;AACF,CAAC,CAAC;AAEF,eAAelB,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { default as BubbleComponent } from "./BubbleComponent.js";
|
|
4
|
+
export { default as FidgetGrid } from "./FidgetGrid.js";
|
|
5
|
+
export { default as ScoreBoard } from "./ScoreBoard.js";
|
|
6
|
+
export { default as GameBackground } from "./GameBackground.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","BubbleComponent","FidgetGrid","ScoreBoard","GameBackground"],"sourceRoot":"../../../../../src","sources":["games/popit-fidget/components/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,eAAe,QAAQ,sBAAmB;AAC9D,SAASD,OAAO,IAAIE,UAAU,QAAQ,iBAAc;AACpD,SAASF,OAAO,IAAIG,UAAU,QAAQ,iBAAc;AACpD,SAASH,OAAO,IAAII,cAAc,QAAQ,qBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useCallback, useMemo } from 'react';
|
|
4
|
+
import { View, StyleSheet, Dimensions } from 'react-native';
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
|
+
import { useSpaceFighterStore } from "./SpaceFighterStore.js";
|
|
7
|
+
import { createSpaceFighterService } from "./SpaceFighterService.js";
|
|
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";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const {
|
|
15
|
+
width,
|
|
16
|
+
height
|
|
17
|
+
} = Dimensions.get('window');
|
|
18
|
+
export const SpaceFighter = ({
|
|
19
|
+
settings,
|
|
20
|
+
onSettingsChange
|
|
21
|
+
}) => {
|
|
22
|
+
// Memoize settings destructuring to prevent unnecessary re-renders
|
|
23
|
+
const {
|
|
24
|
+
difficulty
|
|
25
|
+
} = useMemo(() => settings, [settings]);
|
|
26
|
+
|
|
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);
|
|
31
|
+
|
|
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);
|
|
41
|
+
|
|
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]);
|
|
54
|
+
|
|
55
|
+
// Game service cleanup on unmount
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
return () => {
|
|
58
|
+
handleResetGame();
|
|
59
|
+
if (gameService) {
|
|
60
|
+
gameService.cleanup();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, [gameService]);
|
|
64
|
+
|
|
65
|
+
// Auto-stop physics when game over state changes
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (gameOver && gameService) {
|
|
68
|
+
// Stop all timers and physics when game over
|
|
69
|
+
gameService.cleanup();
|
|
70
|
+
}
|
|
71
|
+
}, [gameOver, gameService]);
|
|
72
|
+
|
|
73
|
+
// Memoize difficulty settings to prevent recalculation
|
|
74
|
+
const difficultySettings = useMemo(() => getDifficultySettings(difficulty), [difficulty]);
|
|
75
|
+
|
|
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) {
|
|
91
|
+
gameService.cleanup();
|
|
92
|
+
}
|
|
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]);
|
|
135
|
+
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
136
|
+
style: {
|
|
137
|
+
flex: 1
|
|
138
|
+
},
|
|
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, {})
|
|
145
|
+
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
146
|
+
...gameControlButtonProps
|
|
147
|
+
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
148
|
+
...gameOverModalProps
|
|
149
|
+
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
150
|
+
...gameSettingsModalProps
|
|
151
|
+
})]
|
|
152
|
+
})
|
|
153
|
+
})
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
const styles = StyleSheet.create({
|
|
157
|
+
container: {
|
|
158
|
+
flex: 1
|
|
159
|
+
},
|
|
160
|
+
scoreboardContainer: {
|
|
161
|
+
position: 'absolute',
|
|
162
|
+
top: 0,
|
|
163
|
+
left: 20,
|
|
164
|
+
right: 20,
|
|
165
|
+
zIndex: 100,
|
|
166
|
+
pointerEvents: 'none' // Allow touches to pass through to spacecraft below
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=SpaceFighter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC3D,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,yBAAyB,QAAQ,0BAAuB;AACjE,SAASC,qBAAqB,QAAQ,4BAAyB;AAC/D,SAASC,UAAU,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,uBAAc;AACnE,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,+BAAsB;AAC3G,SAASC,iBAAiB,QAAQ,+BAAsB;AACxD,SAASC,QAAQ,QAAwB,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvE,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGnB,UAAU,CAACoB,GAAG,CAAC,QAAQ,CAAC;AAElD,OAAO,MAAMC,YAAiC,GAAGA,CAAC;EAChDC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ;EACA,MAAM;IAAEC;EAAW,CAAC,GAAG3B,OAAO,CAAC,MAAMyB,QAAQ,EAAE,CAACA,QAAQ,CAAC,CAAC;;EAE1D;EACA,MAAMG,SAAS,GAAGvB,oBAAoB,CAACwB,KAAK,IAAIA,KAAK,CAACD,SAAS,CAAC;EAChE,MAAME,QAAQ,GAAGzB,oBAAoB,CAACwB,KAAK,IAAIA,KAAK,CAACC,QAAQ,CAAC;EAC9D,MAAMC,KAAK,GAAG1B,oBAAoB,CAACwB,KAAK,IAAIA,KAAK,CAACE,KAAK,CAAC;;EAExD;EACA,MAAMC,SAAS,GAAG3B,oBAAoB,CAACwB,KAAK,I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+
// Space Fighter Settings Interface
|
|
4
|
+
|
|
5
|
+
// Space Fighter Difficulty Configuration
|
|
6
|
+
export const SPACE_FIGHTER_DIFFICULTY_CONFIG = {
|
|
7
|
+
easy: {
|
|
8
|
+
gameDuration: 60,
|
|
9
|
+
asteroidSpawnInterval: 4000,
|
|
10
|
+
// Slower spawn rate
|
|
11
|
+
asteroidSpeed: 1.5 // Slower asteroids
|
|
12
|
+
},
|
|
13
|
+
medium: {
|
|
14
|
+
gameDuration: 60,
|
|
15
|
+
asteroidSpawnInterval: 3000,
|
|
16
|
+
// Balanced spawn rate
|
|
17
|
+
asteroidSpeed: 2 // Normal speed
|
|
18
|
+
},
|
|
19
|
+
hard: {
|
|
20
|
+
gameDuration: 60,
|
|
21
|
+
asteroidSpawnInterval: 2000,
|
|
22
|
+
// Faster spawn rate
|
|
23
|
+
asteroidSpeed: 3 // Faster asteroids for challenge
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Helper function to get difficulty settings
|
|
28
|
+
export const getDifficultySettings = difficulty => {
|
|
29
|
+
return SPACE_FIGHTER_DIFFICULTY_CONFIG[difficulty];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Default Space Fighter Settings
|
|
33
|
+
export const DEFAULT_SPACE_FIGHTER_SETTINGS = {
|
|
34
|
+
difficulty: 'medium',
|
|
35
|
+
soundEnabled: true,
|
|
36
|
+
hapticEnabled: true,
|
|
37
|
+
gameDuration: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.gameDuration,
|
|
38
|
+
asteroidSpawnInterval: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpawnInterval,
|
|
39
|
+
asteroidSpeed: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpeed
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Space Fighter Game Constants
|
|
43
|
+
export const SPACE_FIGHTER_GAME_CONFIG = {
|
|
44
|
+
GAME_DURATION: 120,
|
|
45
|
+
// seconds
|
|
46
|
+
SPACECRAFT_SIZE: 28,
|
|
47
|
+
// Increased from 20 for better visibility
|
|
48
|
+
SPACECRAFT_SPEED: 3,
|
|
49
|
+
ASTEROID_WIDTH: 80,
|
|
50
|
+
ASTEROID_GAP: 120,
|
|
51
|
+
// Increased gap between asteroid pairs for easier navigation
|
|
52
|
+
ASTEROID_SPAWN_INTERVAL: 3000,
|
|
53
|
+
// Increased from 2000ms to 3500ms for better spacing
|
|
54
|
+
ASTEROID_SPEED: 2,
|
|
55
|
+
GRAVITY: 0.3,
|
|
56
|
+
BOUNCE_DAMPING: 0.7,
|
|
57
|
+
FRICTION: 0.98,
|
|
58
|
+
MAX_VELOCITY: 8,
|
|
59
|
+
COLLISION_TOLERANCE: 2,
|
|
60
|
+
COLLISION_COOLDOWN: 2000 // 2 seconds between collisions
|
|
61
|
+
};
|
|
62
|
+
export const SPACE_FIGHTER_COLORS = {
|
|
63
|
+
BACKGROUND: '#0a0a1a',
|
|
64
|
+
// Deep space black
|
|
65
|
+
SPACECRAFT: '#00d4ff',
|
|
66
|
+
// Bright cyan for spacecraft
|
|
67
|
+
ASTEROID: '#8b4513',
|
|
68
|
+
// Brown for asteroids
|
|
69
|
+
ASTEROID_SHADOW: '#654321',
|
|
70
|
+
// Darker brown shadow
|
|
71
|
+
SCORE: '#ffd700',
|
|
72
|
+
// Gold for score
|
|
73
|
+
UI: '#9370db',
|
|
74
|
+
// Purple for UI elements
|
|
75
|
+
STARS: '#ffffff' // White for stars
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Space Fighter Game Theme - Matches scoreboard purple
|
|
79
|
+
export const SPACE_FIGHTER_THEME = {
|
|
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
|
+
headerTextColor: '#ffffff',
|
|
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
|
|
91
|
+
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
92
|
+
buttonSelectedTextColor: '#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
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// Space Fighter Difficulty Descriptions
|
|
103
|
+
export const SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS = {
|
|
104
|
+
easy: 'Slow asteroids, relaxed gameplay',
|
|
105
|
+
medium: 'Normal asteroid speed, balanced challenge',
|
|
106
|
+
hard: 'Fast asteroids, quick reflexes needed!'
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=SpaceFighterConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SPACE_FIGHTER_DIFFICULTY_CONFIG","easy","gameDuration","asteroidSpawnInterval","asteroidSpeed","medium","hard","getDifficultySettings","difficulty","DEFAULT_SPACE_FIGHTER_SETTINGS","soundEnabled","hapticEnabled","SPACE_FIGHTER_GAME_CONFIG","GAME_DURATION","SPACECRAFT_SIZE","SPACECRAFT_SPEED","ASTEROID_WIDTH","ASTEROID_GAP","ASTEROID_SPAWN_INTERVAL","ASTEROID_SPEED","GRAVITY","BOUNCE_DAMPING","FRICTION","MAX_VELOCITY","COLLISION_TOLERANCE","COLLISION_COOLDOWN","SPACE_FIGHTER_COLORS","BACKGROUND","SPACECRAFT","ASTEROID","ASTEROID_SHADOW","SCORE","UI","STARS","SPACE_FIGHTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighterConstants.ts"],"mappings":";;AAEA;;AAUA;AACA,OAAO,MAAMA,+BAA+B,GAAG;EAC7CC,IAAI,EAAE;IACJC,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,GAAG,CAAE;EACtB,CAAC;EACDC,MAAM,EAAE;IACNH,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,CAAC,CAAE;EACpB,CAAC;EACDE,IAAI,EAAE;IACJJ,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,CAAC,CAAE;EACpB;AACF,CAAU;;AAEV;AACA,OAAO,MAAMG,qBAAqB,GAAIC,UAAsC,IAAK;EAC/E,OAAOR,+BAA+B,CAACQ,UAAU,CAAC;AACpD,CAAC;;AAED;AACA,OAAO,MAAMC,8BAAoD,GAAG;EAClED,UAAU,EAAE,QAAQ;EACpBE,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBT,YAAY,EAAEF,+BAA+B,CAACK,MAAM,CAACH,YAAY;EACjEC,qBAAqB,EAAEH,+BAA+B,CAACK,MAAM,CAACF,qBAAqB;EACnFC,aAAa,EAAEJ,+BAA+B,CAACK,MAAM,CAACD;AACxD,CAAC;;AAED;AACA,OAAO,MAAMQ,yBAAyB,GAAG;EACvCC,aAAa,EAAE,GAAG;EAAE;EACpBC,eAAe,EAAE,EAAE;EAAE;EACrBC,gBAAgB,EAA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