react-native-games 0.3.0 → 0.4.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 +45 -32
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +160 -75
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +183 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +152 -55
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +108 -92
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +48 -65
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +7 -2
- 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/ParticleSystem.js +9 -6
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +8 -16
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -1
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/{fruit-slicer/FruitSlicer.js → fruit-ninja/FruitNinja.js} +68 -54
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +151 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -0
- package/lib/module/games/{fruit-slicer/FruitSlicerService.js → fruit-ninja/FruitNinjaService.js} +13 -12
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +166 -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.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameBackground.js +198 -169
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/GameOverModal.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/ParticleSystem.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.js +8 -17
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/SliceTrail.js +1 -1
- package/lib/module/games/fruit-ninja/components/SliceTrail.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/index.js +0 -1
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +109 -91
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +105 -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/EnhancedGameArea.js +5 -9
- 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 +8 -23
- package/lib/module/games/maze-runner/components/ScoreBoard.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 +293 -0
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +116 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js +191 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +190 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +196 -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 +174 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -0
- package/lib/module/games/popit-fidget/components/GameOverModal.js +132 -0
- package/lib/module/games/popit-fidget/components/GameOverModal.js.map +1 -0
- package/lib/module/games/popit-fidget/components/ParticleSystem.js +89 -0
- package/lib/module/games/popit-fidget/components/ParticleSystem.js.map +1 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +68 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/popit-fidget/components/index.js +9 -0
- package/lib/module/games/popit-fidget/components/index.js.map +1 -0
- package/lib/module/games/{space-traveller/SpaceTraveller.js → space-fighter/SpaceFighter.js} +94 -70
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +110 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -0
- package/lib/module/games/{space-traveller/SpaceTravellerService.js → space-fighter/SpaceFighterService.js} +18 -10
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js +143 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -0
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameOverModal.js.map +1 -0
- package/lib/module/games/space-fighter/components/ParticleComponent.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/ScoreBoard.js +11 -19
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/space-fighter/components/SettingsModal.js.map +1 -0
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/SpacecraftPath.js +1 -1
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/index.js +0 -1
- package/lib/module/games/space-fighter/components/index.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js +273 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +117 -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 +159 -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 → whack-a-mole}/components/GameOverModal.js +2 -2
- package/lib/module/games/whack-a-mole/components/GameOverModal.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 +8 -16
- 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 -2
- 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 +36 -506
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +22 -14
- 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/{games/balloon-blaster/components/GameControls.js → shared/helpers/GameControlButton.js} +39 -58
- package/lib/module/shared/helpers/GameControlButton.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 +5 -0
- package/lib/module/shared/helpers/index.js.map +1 -0
- package/lib/module/shared/settings/SettingsService.js +18 -12
- package/lib/module/shared/settings/SettingsService.js.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +143 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +3 -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.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/ParticleSystem.d.ts.map +1 -1
- 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 -1
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +16 -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} +4 -4
- 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} +12 -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-slicer → fruit-ninja}/components/GameArea.d.ts +1 -1
- 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/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/ParticleSystem.d.ts +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/index.d.ts +0 -1
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +1 -9
- 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/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/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 +11 -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 +54 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +40 -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/GameOverModal.d.ts +9 -0
- package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts +9 -0
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.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 +7 -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 +9 -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-traveller → space-fighter}/components/AsteroidComponent.d.ts +1 -1
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/GameArea.d.ts +1 -1
- 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/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/ParticleComponent.d.ts +1 -1
- package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/SettingsModal.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 -1
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper/CatPopper.d.ts → whack-a-mole/WhackAMole.d.ts} +4 -4
- 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/{fruit-slicer → whack-a-mole}/components/GameOverModal.d.ts.map +1 -1
- 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/{cat-popper → whack-a-mole}/components/index.d.ts +1 -2
- 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 +30 -318
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +1 -0
- 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/GameControlButton.d.ts +17 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.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 +4 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -0
- package/lib/typescript/src/shared/settings/SettingsService.d.ts +2 -1
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +1 -1
- package/package.json +9 -6
- package/lib/module/games/balloon-blaster/components/GameControls.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.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.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.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.map +0 -1
- 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.map +0 -1
- 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/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.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.map +0 -1
- 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.map +0 -1
- package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +0 -1
- 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/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/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.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.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/ParticleSystem.d.ts.map +0 -1
- 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.map +0 -1
- 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/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.map +0 -1
- 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.map +0 -1
- 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.map +0 -1
- 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/module/games/{fruit-slicer → fruit-ninja}/components/GameArea.js +0 -0
- /package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameOverModal.js +0 -0
- /package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ParticleSystem.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/AsteroidComponent.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/GameArea.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/GameBackground.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/GameOverModal.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/ParticleComponent.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/SettingsModal.js +0 -0
- /package/lib/module/games/{space-traveller → space-fighter}/components/Spacecraft3D.js +0 -0
- /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameOverModal.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/SliceTrail.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameOverModal.d.ts +0 -0
- /package/lib/typescript/src/games/{cat-popper → space-fighter}/components/ScoreBoard.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → space-fighter}/components/SettingsModal.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/{space-traveller → whack-a-mole}/components/GameOverModal.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → whack-a-mole}/components/ScoreBoard.d.ts +0 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef, useCallback } from 'react';
|
|
4
|
+
import { View, StyleSheet, Dimensions, Modal } from 'react-native';
|
|
5
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
|
+
import { usePopitFidgetStore } from "./PopitFidgetStore.js";
|
|
7
|
+
import { PopitFidgetService } from "./PopitFidgetService.js";
|
|
8
|
+
import { createGameSettingsStore } from "../../shared/settings/SettingsService.js";
|
|
9
|
+
import { playSound, GAME_SOUNDS } from "../../services/SoundsService.js";
|
|
10
|
+
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
11
|
+
import { getDurationForDifficulty } from "../../shared/settings/SettingsService.js";
|
|
12
|
+
import { GameBackground, FidgetGrid as FidgetGridComponent, ScoreBoard, GameOverModal } from "./components/index.js";
|
|
13
|
+
import { GameControlButton } from "../../shared/helpers/index.js";
|
|
14
|
+
import { GameSettings as GameSettingsComponent } from "../../shared/settings/GameSettings.js";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const {
|
|
17
|
+
width,
|
|
18
|
+
height
|
|
19
|
+
} = Dimensions.get('window');
|
|
20
|
+
const PopitFidget = ({
|
|
21
|
+
showSettingsModal = false,
|
|
22
|
+
onToggleSettingsModal,
|
|
23
|
+
externalSettings,
|
|
24
|
+
onSettingsChange
|
|
25
|
+
}) => {
|
|
26
|
+
// Use selective subscriptions to prevent unnecessary re-renders
|
|
27
|
+
const fidgetGrid = usePopitFidgetStore(state => state.fidgetGrid);
|
|
28
|
+
const score = usePopitFidgetStore(state => state.score);
|
|
29
|
+
const timeLeft = usePopitFidgetStore(state => state.timeLeft);
|
|
30
|
+
const isPlaying = usePopitFidgetStore(state => state.isPlaying);
|
|
31
|
+
const gameOver = usePopitFidgetStore(state => state.gameOver);
|
|
32
|
+
const gameWon = usePopitFidgetStore(state => state.gameWon);
|
|
33
|
+
|
|
34
|
+
// Get store actions (these don't cause re-renders)
|
|
35
|
+
const startGame = usePopitFidgetStore(state => state.startGame);
|
|
36
|
+
const stopGame = usePopitFidgetStore(state => state.stopGame);
|
|
37
|
+
const resetGame = usePopitFidgetStore(state => state.resetGame);
|
|
38
|
+
const setFidgetGrid = usePopitFidgetStore(state => state.setFidgetGrid);
|
|
39
|
+
const popBubble = usePopitFidgetStore(state => state.popBubble);
|
|
40
|
+
const setTimeLeft = usePopitFidgetStore(state => state.setTimeLeft);
|
|
41
|
+
const serviceRef = useRef(null);
|
|
42
|
+
// Removed animation maps to prevent memory leaks
|
|
43
|
+
const useSettings = useRef(createGameSettingsStore()).current;
|
|
44
|
+
const settings = useSettings();
|
|
45
|
+
const prevSettingsRef = useRef(null);
|
|
46
|
+
|
|
47
|
+
// Initialize service and generate initial fidget grid
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!serviceRef.current) {
|
|
50
|
+
serviceRef.current = new PopitFidgetService();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Generate initial fidget grid so it shows before game starts
|
|
54
|
+
if (serviceRef.current && !fidgetGrid) {
|
|
55
|
+
const grid = serviceRef.current.generateFidgetGrid(settings.difficulty);
|
|
56
|
+
setFidgetGrid(grid);
|
|
57
|
+
}
|
|
58
|
+
return () => {
|
|
59
|
+
serviceRef.current?.cleanup();
|
|
60
|
+
};
|
|
61
|
+
}, [fidgetGrid, setFidgetGrid, settings.difficulty]);
|
|
62
|
+
|
|
63
|
+
// Handle external settings changes
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (!externalSettings) return;
|
|
66
|
+
const prev = prevSettingsRef.current;
|
|
67
|
+
const hasChanged = !prev || prev.difficulty !== externalSettings.difficulty || prev.soundEnabled !== externalSettings.soundEnabled || prev.hapticEnabled !== externalSettings.hapticEnabled;
|
|
68
|
+
if (hasChanged) {
|
|
69
|
+
const commonSettings = {
|
|
70
|
+
difficulty: externalSettings.difficulty,
|
|
71
|
+
soundEnabled: externalSettings.soundEnabled,
|
|
72
|
+
hapticEnabled: externalSettings.hapticEnabled
|
|
73
|
+
};
|
|
74
|
+
settings.setDifficulty(commonSettings.difficulty);
|
|
75
|
+
settings.setSoundEnabled(commonSettings.soundEnabled);
|
|
76
|
+
settings.setHapticEnabled(commonSettings.hapticEnabled);
|
|
77
|
+
prevSettingsRef.current = externalSettings;
|
|
78
|
+
}
|
|
79
|
+
}, [externalSettings, settings]);
|
|
80
|
+
|
|
81
|
+
// Settings change callback
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
if (!onSettingsChange) return;
|
|
84
|
+
const unsubscribe = useSettings.subscribe(state => {
|
|
85
|
+
onSettingsChange({
|
|
86
|
+
difficulty: state.difficulty,
|
|
87
|
+
soundEnabled: state.soundEnabled,
|
|
88
|
+
hapticEnabled: state.hapticEnabled
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
return unsubscribe;
|
|
92
|
+
}, [onSettingsChange, useSettings]);
|
|
93
|
+
|
|
94
|
+
// Generate new fidget grid (simplified - always square based on difficulty)
|
|
95
|
+
const generateNewFidget = useCallback(() => {
|
|
96
|
+
if (!serviceRef.current) return;
|
|
97
|
+
const grid = serviceRef.current.generateFidgetGrid(settings.difficulty);
|
|
98
|
+
setFidgetGrid(grid);
|
|
99
|
+
}, [setFidgetGrid, settings.difficulty]);
|
|
100
|
+
|
|
101
|
+
// Track previous difficulty to avoid infinite loops
|
|
102
|
+
const prevDifficultyRef = React.useRef(settings.difficulty);
|
|
103
|
+
|
|
104
|
+
// Watch for difficulty changes and regenerate grid when difficulty changes
|
|
105
|
+
React.useEffect(() => {
|
|
106
|
+
// Only regenerate if difficulty actually changed
|
|
107
|
+
if (prevDifficultyRef.current !== settings.difficulty && serviceRef.current) {
|
|
108
|
+
if (!isPlaying) {
|
|
109
|
+
// Game not playing - just regenerate grid
|
|
110
|
+
const grid = serviceRef.current.generateFidgetGrid(settings.difficulty);
|
|
111
|
+
setFidgetGrid(grid);
|
|
112
|
+
} else {
|
|
113
|
+
// Game is playing - restart with new difficulty duration
|
|
114
|
+
const newDuration = getDurationForDifficulty(settings.difficulty);
|
|
115
|
+
|
|
116
|
+
// Stop current timer
|
|
117
|
+
serviceRef.current.stopGameTimer();
|
|
118
|
+
|
|
119
|
+
// Start new timer with new duration
|
|
120
|
+
serviceRef.current.startGameTimer(newDuration, timeLeft => setTimeLeft(timeLeft), () => stopGame());
|
|
121
|
+
|
|
122
|
+
// Update store with new duration
|
|
123
|
+
setTimeLeft(newDuration);
|
|
124
|
+
}
|
|
125
|
+
prevDifficultyRef.current = settings.difficulty;
|
|
126
|
+
}
|
|
127
|
+
}, [settings.difficulty, isPlaying, setFidgetGrid, setTimeLeft, stopGame]);
|
|
128
|
+
|
|
129
|
+
// Watch for game completion events and play appropriate sounds
|
|
130
|
+
React.useEffect(() => {
|
|
131
|
+
if (gameOver && !isPlaying) {
|
|
132
|
+
if (gameWon) {
|
|
133
|
+
// All bubbles popped - game completed successfully
|
|
134
|
+
playSound(GAME_SOUNDS.BUBBLE_POPPER.COMPLETE, settings.soundEnabled);
|
|
135
|
+
} else {
|
|
136
|
+
// Time ran out - game over
|
|
137
|
+
playSound(GAME_SOUNDS.TIME_UP, settings.soundEnabled);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, [gameOver, gameWon, isPlaying, settings.soundEnabled]);
|
|
141
|
+
|
|
142
|
+
// Timer effect - handles countdown when game is playing
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
let timerInterval = null;
|
|
145
|
+
if (isPlaying && timeLeft > 0) {
|
|
146
|
+
timerInterval = setInterval(() => {
|
|
147
|
+
const newTime = timeLeft - 1;
|
|
148
|
+
if (newTime <= 0) {
|
|
149
|
+
// Time's up - stop the game
|
|
150
|
+
setTimeLeft(0);
|
|
151
|
+
stopGame();
|
|
152
|
+
} else {
|
|
153
|
+
setTimeLeft(newTime);
|
|
154
|
+
}
|
|
155
|
+
}, 1000);
|
|
156
|
+
}
|
|
157
|
+
return () => {
|
|
158
|
+
if (timerInterval) {
|
|
159
|
+
clearInterval(timerInterval);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}, [isPlaying, timeLeft, setTimeLeft, stopGame]);
|
|
163
|
+
|
|
164
|
+
// Start game
|
|
165
|
+
const startGameHandler = useCallback(() => {
|
|
166
|
+
if (!serviceRef.current) return;
|
|
167
|
+
|
|
168
|
+
// Always generate new fidget when starting a new game
|
|
169
|
+
generateNewFidget();
|
|
170
|
+
|
|
171
|
+
// Play game start sound
|
|
172
|
+
playSound(GAME_SOUNDS.BUBBLE_POPPER.START, settings.soundEnabled);
|
|
173
|
+
|
|
174
|
+
// Store uses fixed 60s duration internally
|
|
175
|
+
startGame();
|
|
176
|
+
|
|
177
|
+
// Haptic feedback
|
|
178
|
+
playHaptic(HapticType.MEDIUM, settings.hapticEnabled);
|
|
179
|
+
}, [startGame, settings.soundEnabled, settings.hapticEnabled, generateNewFidget]);
|
|
180
|
+
|
|
181
|
+
// Stop game - simply reset the game state without showing game over popup
|
|
182
|
+
const stopGameHandler = useCallback(() => {
|
|
183
|
+
if (!serviceRef.current) return;
|
|
184
|
+
serviceRef.current.stopGameTimer();
|
|
185
|
+
serviceRef.current.clearParticles();
|
|
186
|
+
resetGame();
|
|
187
|
+
generateNewFidget();
|
|
188
|
+
}, [resetGame, generateNewFidget]);
|
|
189
|
+
|
|
190
|
+
// Reset game
|
|
191
|
+
const resetGameHandler = useCallback(() => {
|
|
192
|
+
if (!serviceRef.current) return;
|
|
193
|
+
serviceRef.current.stopGameTimer();
|
|
194
|
+
serviceRef.current.clearParticles();
|
|
195
|
+
resetGame();
|
|
196
|
+
generateNewFidget();
|
|
197
|
+
}, [resetGame, generateNewFidget]);
|
|
198
|
+
|
|
199
|
+
// Handle bubble pop with stable callback reference
|
|
200
|
+
const handleBubblePop = useCallback((row, col) => {
|
|
201
|
+
if (!serviceRef.current || !fidgetGrid) return;
|
|
202
|
+
const bubble = fidgetGrid.bubbles[row]?.[col];
|
|
203
|
+
if (!bubble || bubble.isPopped) return;
|
|
204
|
+
|
|
205
|
+
// Play pop sound
|
|
206
|
+
playSound(GAME_SOUNDS.BUBBLE_POPPER.POP, settings.soundEnabled);
|
|
207
|
+
|
|
208
|
+
// Pop the bubble in store
|
|
209
|
+
popBubble(row, col);
|
|
210
|
+
|
|
211
|
+
// Haptic feedback
|
|
212
|
+
playHaptic(HapticType.LIGHT, settings.hapticEnabled);
|
|
213
|
+
|
|
214
|
+
// Completion percentage is already calculated efficiently in the store
|
|
215
|
+
}, [fidgetGrid, popBubble, settings.soundEnabled, settings.hapticEnabled]);
|
|
216
|
+
|
|
217
|
+
// Calculate bubble size based on grid - made bigger for Pop It appearance
|
|
218
|
+
const getBubbleSize = useCallback(() => {
|
|
219
|
+
if (!fidgetGrid) return 60;
|
|
220
|
+
const availableWidth = width * 0.85;
|
|
221
|
+
const availableHeight = height * 0.6;
|
|
222
|
+
const maxSize = Math.min(availableWidth / fidgetGrid.size, availableHeight / fidgetGrid.size);
|
|
223
|
+
// Increased minimum and maximum sizes for bigger, more prominent bubbles
|
|
224
|
+
return Math.max(45, Math.min(80, maxSize * 0.9));
|
|
225
|
+
}, [fidgetGrid]);
|
|
226
|
+
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
227
|
+
style: styles.container,
|
|
228
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
229
|
+
style: styles.gameContainer,
|
|
230
|
+
children: [/*#__PURE__*/_jsx(GameBackground, {
|
|
231
|
+
width: width,
|
|
232
|
+
height: height,
|
|
233
|
+
isPlaying: isPlaying
|
|
234
|
+
}), /*#__PURE__*/_jsx(ScoreBoard, {
|
|
235
|
+
score: score,
|
|
236
|
+
timeLeft: timeLeft
|
|
237
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
238
|
+
style: styles.gameArea,
|
|
239
|
+
children: fidgetGrid && /*#__PURE__*/_jsx(FidgetGridComponent, {
|
|
240
|
+
grid: fidgetGrid,
|
|
241
|
+
bubbleSize: getBubbleSize(),
|
|
242
|
+
onBubblePop: handleBubblePop,
|
|
243
|
+
hapticEnabled: settings.hapticEnabled,
|
|
244
|
+
isPlaying: isPlaying
|
|
245
|
+
})
|
|
246
|
+
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
247
|
+
isPlaying: isPlaying,
|
|
248
|
+
gameOver: gameOver,
|
|
249
|
+
onStartGame: startGameHandler,
|
|
250
|
+
onStopGame: stopGameHandler,
|
|
251
|
+
startButtonText: "START POPPING",
|
|
252
|
+
stopButtonText: "STOP GAME",
|
|
253
|
+
startButtonSubtext: "Pop bubbles to relax!",
|
|
254
|
+
stopButtonSubtext: "End current game",
|
|
255
|
+
startButtonColor: "#9c27b0",
|
|
256
|
+
stopButtonColor: "#dc2626",
|
|
257
|
+
startButtonBorderColor: "#ce93d8",
|
|
258
|
+
stopButtonBorderColor: "#f87171"
|
|
259
|
+
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
260
|
+
visible: gameOver,
|
|
261
|
+
score: score,
|
|
262
|
+
onPlayAgain: resetGameHandler
|
|
263
|
+
}), /*#__PURE__*/_jsx(Modal, {
|
|
264
|
+
visible: showSettingsModal,
|
|
265
|
+
animationType: "slide",
|
|
266
|
+
presentationStyle: "pageSheet",
|
|
267
|
+
onRequestClose: onToggleSettingsModal,
|
|
268
|
+
children: /*#__PURE__*/_jsx(GameSettingsComponent, {
|
|
269
|
+
gameId: "popit-fidget",
|
|
270
|
+
onClose: onToggleSettingsModal || (() => {}),
|
|
271
|
+
settingsStore: settings
|
|
272
|
+
})
|
|
273
|
+
})]
|
|
274
|
+
})
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
const styles = StyleSheet.create({
|
|
278
|
+
container: {
|
|
279
|
+
flex: 1
|
|
280
|
+
},
|
|
281
|
+
gameContainer: {
|
|
282
|
+
flex: 1,
|
|
283
|
+
backgroundColor: '#fef7ff' // Very light lavender to complement rainbow theme
|
|
284
|
+
},
|
|
285
|
+
gameArea: {
|
|
286
|
+
flex: 1,
|
|
287
|
+
justifyContent: 'center',
|
|
288
|
+
alignItems: 'center',
|
|
289
|
+
paddingHorizontal: 20
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
export { PopitFidget };
|
|
293
|
+
//# sourceMappingURL=PopitFidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useCallback","View","StyleSheet","Dimensions","Modal","GestureHandlerRootView","usePopitFidgetStore","PopitFidgetService","createGameSettingsStore","playSound","GAME_SOUNDS","playHaptic","HapticType","getDurationForDifficulty","GameBackground","FidgetGrid","FidgetGridComponent","ScoreBoard","GameOverModal","GameControlButton","GameSettings","GameSettingsComponent","jsx","_jsx","jsxs","_jsxs","width","height","get","PopitFidget","showSettingsModal","onToggleSettingsModal","externalSettings","onSettingsChange","fidgetGrid","state","score","timeLeft","isPlaying","gameOver","gameWon","startGame","stopGame","resetGame","setFidgetGrid","popBubble","setTimeLeft","serviceRef","useSettings","current","settings","prevSettingsRef","grid","generateFidgetGrid","difficulty","cleanup","prev","hasChanged","soundEnabled","hapticEnabled","commonSettings","setDifficulty","setSoundEnabled","setHapticEnabled","unsubscribe","subscribe","generateNewFidget","prevDifficultyRef","newDuration","stopGameTimer","startGameTimer","BUBBLE_POPPER","COMPLETE","TIME_UP","timerInterval","setInterval","newTime","clearInterval","startGameHandler","START","MEDIUM","stopGameHandler","clearParticles","resetGameHandler","handleBubblePop","row","col","bubble","bubbles","isPopped","POP","LIGHT","getBubbleSize","availableWidth","availableHeight","maxSize","Math","min","size","max","style","styles","container","children","gameContainer","gameArea","bubbleSize","onBubblePop","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","visible","onPlayAgain","animationType","presentationStyle","onRequestClose","gameId","onClose","settingsStore","create","flex","backgroundColor","justifyContent","alignItems","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["games/popit-fidget/PopitFidget.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AAC7D,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAClE,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,mBAAmB,QAA+B,uBAAoB;AAC/E,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,uBAAuB,QAAQ,0CAAuC;AAC/E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iCAA8B;AACrE,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AAEtE,SAASC,wBAAwB,QAAQ,0CAAuC;AAChF,SACEC,cAAc,EACdC,UAAU,IAAIC,mBAAmB,EACjCC,UAAU,EACVC,aAAa,QACR,uBAAc;AACrB,SAASC,iBAAiB,QAAQ,+BAAsB;AACxD,SAASC,YAAY,IAAIC,qBAAqB,QAAQ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QACzBC,sBAAsB,EAAC,SAAS;QAChCC,qBAAqB,EAAC;MAAS,CAChC,CAAC,eAGF9F,IAAA,CAACL,aAAa;QACZoG,OAAO,EAAE/E,QAAS;QAClBH,KAAK,EAAEA,KAAM;QACbmF,WAAW,EAAEpC;MAAiB,CAC/B,CAAC,eAGF5D,IAAA,CAACnB,KAAK;QACJkH,OAAO,EAAExF,iBAAkB;QAC3B0F,aAAa,EAAC,OAAO;QACrBC,iBAAiB,EAAC,WAAW;QAC7BC,cAAc,EAAE3F,qBAAsB;QAAAwE,QAAA,eAEtChF,IAAA,CAACF,qBAAqB;UACpBsG,MAAM,EAAC,cAAc;UACrBC,OAAO,EAAE7F,qBAAqB,KAAK,MAAM,CAAC,CAAC,CAAE;UAC7C8F,aAAa,EAAE3E;QAAS,CACzB;MAAC,CACG,CAAC;IAAA,CACJ;EAAC,CACe,CAAC;AAE7B,CAAC;AAED,MAAMmD,MAAM,GAAGnG,UAAU,CAAC4H,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IACTyB,IAAI,EAAE;EACR,CAAC;EACDvB,aAAa,EAAE;IACbuB,IAAI,EAAE,CAAC;IACPC,eAAe,EAAE,SAAS,CAAE;EAC9B,CAAC;EACDvB,QAAQ,EAAE;IACRsB,IAAI,EAAE,CAAC;IACPE,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,SAAStG,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Popit Fidget Game Constants
|
|
4
|
+
export const POPIT_FIDGET_GAME_CONFIG = {
|
|
5
|
+
GAME_DURATION: 120,
|
|
6
|
+
// seconds
|
|
7
|
+
POINTS_PER_BUBBLE: 10,
|
|
8
|
+
COMPLETION_BONUS: 500,
|
|
9
|
+
TIME_BONUS_MULTIPLIER: 5,
|
|
10
|
+
BUBBLE_SIZE: 40,
|
|
11
|
+
ANIMATION_DURATION: 300,
|
|
12
|
+
PARTICLE_COUNT: 4,
|
|
13
|
+
// Reduced for better performance
|
|
14
|
+
PARTICLE_LIFETIME: 800,
|
|
15
|
+
// Difficulty-based square grid sizes
|
|
16
|
+
GRID_SIZES: {
|
|
17
|
+
easy: 5,
|
|
18
|
+
// 5x5 = 25 bubbles
|
|
19
|
+
medium: 6,
|
|
20
|
+
// 6x6 = 36 bubbles
|
|
21
|
+
hard: 7 // 7x7 = 49 bubbles
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export const POPIT_FIDGET_ANIMATION_CONFIG = {
|
|
25
|
+
POP_SCALE: 1.3,
|
|
26
|
+
POP_DURATION: 200,
|
|
27
|
+
FADE_DURATION: 300,
|
|
28
|
+
BOUNCE_SCALE: 0.9,
|
|
29
|
+
PARTICLE_VELOCITY: 3,
|
|
30
|
+
PARTICLE_GRAVITY: 0.2
|
|
31
|
+
};
|
|
32
|
+
export const POPIT_FIDGET_COLORS = {
|
|
33
|
+
BACKGROUND: '#f5f5f5',
|
|
34
|
+
// Light gray background
|
|
35
|
+
FIDGET_BORDER: '#333',
|
|
36
|
+
FIDGET_SHADOW: 'rgba(0,0,0,0.3)',
|
|
37
|
+
SCORE: '#4a90e2',
|
|
38
|
+
UI: '#6c5ce7',
|
|
39
|
+
POPPED_BUBBLE: '#d0d0d0',
|
|
40
|
+
PARTICLE_GLOW: 'rgba(255,255,255,0.9)',
|
|
41
|
+
// Pop It fidget toy colors - rainbow gradient
|
|
42
|
+
FIDGET_BASE: '#ffffff',
|
|
43
|
+
BUBBLE_SHADOW: 'rgba(0,0,0,0.2)',
|
|
44
|
+
BUBBLE_HIGHLIGHT: 'rgba(255,255,255,0.6)'
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Rainbow gradient colors for authentic Pop It fidget toy look - enhanced vibrancy
|
|
48
|
+
export const RAINBOW_COLORS = ['#E91E63',
|
|
49
|
+
// Vibrant pink/magenta (like image)
|
|
50
|
+
'#F44336',
|
|
51
|
+
// Bright red
|
|
52
|
+
'#FF5722',
|
|
53
|
+
// Deep orange
|
|
54
|
+
'#FF9800',
|
|
55
|
+
// Orange
|
|
56
|
+
'#FFC107',
|
|
57
|
+
// Amber/yellow
|
|
58
|
+
'#8E24AA',
|
|
59
|
+
// Deep purple
|
|
60
|
+
'#CDDC39',
|
|
61
|
+
// Lime
|
|
62
|
+
'#8BC34A',
|
|
63
|
+
// Light green
|
|
64
|
+
'#4CAF50',
|
|
65
|
+
// Green
|
|
66
|
+
'#009688',
|
|
67
|
+
// Teal
|
|
68
|
+
'#00BCD4',
|
|
69
|
+
// Cyan
|
|
70
|
+
'#03A9F4',
|
|
71
|
+
// Light blue
|
|
72
|
+
'#2196F3',
|
|
73
|
+
// Blue
|
|
74
|
+
'#3F51B5',
|
|
75
|
+
// Indigo
|
|
76
|
+
'#9C27B0',
|
|
77
|
+
// Purple
|
|
78
|
+
'#E91E63' // Back to vibrant pink for seamless loop
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
// Legacy bubble colors for backward compatibility
|
|
82
|
+
export const BUBBLE_COLORS = RAINBOW_COLORS;
|
|
83
|
+
|
|
84
|
+
// Popit Fidget Game Theme
|
|
85
|
+
export const POPIT_FIDGET_THEME = {
|
|
86
|
+
backgroundColor: '#f0f8ff',
|
|
87
|
+
// Alice blue
|
|
88
|
+
headerBackgroundColor: 'rgba(106, 92, 206, 0.8)',
|
|
89
|
+
// Purple with transparency
|
|
90
|
+
headerTextColor: '#ffffff',
|
|
91
|
+
sectionBackgroundColor: 'rgba(255, 255, 255, 0.3)',
|
|
92
|
+
sectionTitleColor: '#1f2937',
|
|
93
|
+
// Dark gray
|
|
94
|
+
buttonSelectedColor: '#6c5ce7',
|
|
95
|
+
// Purple
|
|
96
|
+
buttonUnselectedColor: 'rgba(255, 255, 255, 0.4)',
|
|
97
|
+
buttonSelectedTextColor: '#ffffff',
|
|
98
|
+
buttonUnselectedTextColor: '#1f2937',
|
|
99
|
+
switchTrackColorFalse: '#a29bfe',
|
|
100
|
+
switchTrackColorTrue: '#6c5ce7',
|
|
101
|
+
switchThumbColor: '#fd79a8',
|
|
102
|
+
// Pink
|
|
103
|
+
infoTextColor: '#374151',
|
|
104
|
+
// Gray
|
|
105
|
+
resetButtonColor: '#e84393',
|
|
106
|
+
// Pink
|
|
107
|
+
resetButtonTextColor: '#ffffff'
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Popit Fidget Difficulty Descriptions
|
|
111
|
+
export const POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS = {
|
|
112
|
+
easy: '60 seconds, smaller fidget grids, relaxing pace',
|
|
113
|
+
medium: '120 seconds, medium grids, satisfying pops',
|
|
114
|
+
hard: '180 seconds, large complex shapes, ultimate satisfaction!'
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=PopitFidgetConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["POPIT_FIDGET_GAME_CONFIG","GAME_DURATION","POINTS_PER_BUBBLE","COMPLETION_BONUS","TIME_BONUS_MULTIPLIER","BUBBLE_SIZE","ANIMATION_DURATION","PARTICLE_COUNT","PARTICLE_LIFETIME","GRID_SIZES","easy","medium","hard","POPIT_FIDGET_ANIMATION_CONFIG","POP_SCALE","POP_DURATION","FADE_DURATION","BOUNCE_SCALE","PARTICLE_VELOCITY","PARTICLE_GRAVITY","POPIT_FIDGET_COLORS","BACKGROUND","FIDGET_BORDER","FIDGET_SHADOW","SCORE","UI","POPPED_BUBBLE","PARTICLE_GLOW","FIDGET_BASE","BUBBLE_SHADOW","BUBBLE_HIGHLIGHT","RAINBOW_COLORS","BUBBLE_COLORS","POPIT_FIDGET_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","resetButtonColor","resetButtonTextColor","POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/popit-fidget/PopitFidgetConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,aAAa,EAAE,GAAG;EAAE;EACpBC,iBAAiB,EAAE,EAAE;EACrBC,gBAAgB,EAAE,GAAG;EACrBC,qBAAqB,EAAE,CAAC;EACxBC,WAAW,EAAE,EAAE;EACfC,kBAAkB,EAAE,GAAG;EACvBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG;EACtB;EACAC,UAAU,EAAE;IACVC,IAAI,EAAE,CAAC;IAAK;IACZC,MAAM,EAAE,CAAC;IAAG;IACZC,IAAI,EAAE,CAAC,CAAK;EACd;AACF,CAAU;AAEV,OAAO,MAAMC,6BAA6B,GAAG;EAC3CC,SAAS,EAAE,GAAG;EACdC,YAAY,EAAE,GAAG;EACjBC,aAAa,EAAE,GAAG;EAClBC,YAAY,EAAE,GAAG;EACjBC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE;AACpB,CAAU;AAEV,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,UAAU,EAAE,SAAS;EAAE;EACvBC,aAAa,EAAE,MAAM;EACrBC,aAAa,EAAE,iBAAiB;EAChCC,KAAK,EAAE,SAAS;EAChBC,EAAE,EAAE,SAAS;EACbC,aAAa,EAAE,SAAS;EACxBC,aAAa,EAAE,uBAAuB;EACtC;EACAC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,iBAAiB;EAChCC,gBAAgB,EAAE;AACpB,CAAU;;AAEV;AACA,OAAO,MAAMC,cAAc,GAAG,CAC5B,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS,CAAE;AAAA,CACH;;AAEV;AACA,OAAO,MAAMC,aAAa,GAAGD,cAAc;;AAE3C;AACA,OAAO,MAAME,kBAAqC,GAAG;EACnDC,eAAe,EAAE,SAAS;EAAE;EAC5BC,qBAAqB,EAAE,yBAAyB;EAAE;EAClDC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,0BAA0B;EAClDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,SAAS;EACpCC,qBAAqB,EAAE,SAAS;EAChCC,oBAAoB,EAAE,SAAS;EAC/BC,gBAAgB,EAAE,SAAS;EAAE;EAC7BC,aAAa,EAAE,SAAS;EAAE;EAC1BC,gBAAgB,EAAE,SAAS;EAAE;EAC7BC,oBAAoB,EAAE;AACxB,CAAC;;AAED;AACA,OAAO,MAAMC,oCAAoC,GAAG;EAClDvC,IAAI,EAAE,iDAAiD;EACvDC,MAAM,EAAE,4CAA4C;EACpDC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dimensions } from 'react-native';
|
|
4
|
+
import { POPIT_FIDGET_GAME_CONFIG as GAME_CONFIG, POPIT_FIDGET_ANIMATION_CONFIG as ANIMATION_CONFIG, POPIT_FIDGET_COLORS as COLORS, RAINBOW_COLORS, BUBBLE_COLORS } from "./PopitFidgetConstants.js";
|
|
5
|
+
const {
|
|
6
|
+
width,
|
|
7
|
+
height
|
|
8
|
+
} = Dimensions.get('window');
|
|
9
|
+
|
|
10
|
+
// Constants now imported from PopitFidgetConstants.ts
|
|
11
|
+
// Re-export for backward compatibility
|
|
12
|
+
export { GAME_CONFIG, ANIMATION_CONFIG, COLORS, BUBBLE_COLORS };
|
|
13
|
+
|
|
14
|
+
// Types - Simplified to always use square grids
|
|
15
|
+
|
|
16
|
+
export class PopitFidgetService {
|
|
17
|
+
gameTimerRef = null;
|
|
18
|
+
animationRef = null;
|
|
19
|
+
particles = [];
|
|
20
|
+
constructor() {}
|
|
21
|
+
|
|
22
|
+
// Generate square fidget grid based on difficulty
|
|
23
|
+
generateFidgetGrid(difficulty) {
|
|
24
|
+
const availableWidth = width * 0.85; // Match PopitFidget component calculation
|
|
25
|
+
const availableHeight = height * 0.6; // Match PopitFidget component calculation
|
|
26
|
+
|
|
27
|
+
// Get grid size from difficulty-based configuration
|
|
28
|
+
const gridSize = GAME_CONFIG.GRID_SIZES[difficulty];
|
|
29
|
+
|
|
30
|
+
// Use same bubble size calculation as PopitFidget component
|
|
31
|
+
const maxSize = Math.min(availableWidth / gridSize, availableHeight / gridSize);
|
|
32
|
+
const bubbleSize = Math.max(45, Math.min(80, maxSize * 0.9));
|
|
33
|
+
|
|
34
|
+
// Calculate grid dimensions with proper spacing
|
|
35
|
+
const spacing = bubbleSize * 1.1;
|
|
36
|
+
const gridWidth = (gridSize - 1) * spacing + bubbleSize;
|
|
37
|
+
const gridHeight = (gridSize - 1) * spacing + bubbleSize;
|
|
38
|
+
const bubbles = [];
|
|
39
|
+
|
|
40
|
+
// Generate square grid - all bubbles are included (no shape filtering)
|
|
41
|
+
for (let row = 0; row < gridSize; row++) {
|
|
42
|
+
bubbles[row] = [];
|
|
43
|
+
for (let col = 0; col < gridSize; col++) {
|
|
44
|
+
// Position bubbles with proper spacing to prevent overlap
|
|
45
|
+
const x = col * spacing + bubbleSize / 2;
|
|
46
|
+
const y = row * spacing + bubbleSize / 2;
|
|
47
|
+
bubbles[row][col] = {
|
|
48
|
+
id: `${row}-${col}`,
|
|
49
|
+
row,
|
|
50
|
+
col,
|
|
51
|
+
x,
|
|
52
|
+
y,
|
|
53
|
+
isPopped: false,
|
|
54
|
+
color: this.getRainbowColorForPosition(row, gridSize),
|
|
55
|
+
animationProgress: 0
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
size: gridSize,
|
|
61
|
+
bubbles,
|
|
62
|
+
centerX: gridWidth / 2,
|
|
63
|
+
centerY: gridHeight / 2,
|
|
64
|
+
width: gridWidth,
|
|
65
|
+
height: gridHeight
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Get rainbow gradient color based on row position for authentic Pop It look
|
|
70
|
+
getRainbowColorForPosition(row, totalRows) {
|
|
71
|
+
// Create rainbow gradient effect like real Pop It fidget toys
|
|
72
|
+
const colorIndex = Math.floor(row / totalRows * RAINBOW_COLORS.length);
|
|
73
|
+
return RAINBOW_COLORS[colorIndex] || RAINBOW_COLORS[0];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Pop bubble and create particle effect
|
|
77
|
+
popBubble(bubble, onParticleCreated) {
|
|
78
|
+
if (bubble.isPopped) return;
|
|
79
|
+
|
|
80
|
+
// Create pop particles (reduced count for better performance)
|
|
81
|
+
const particles = [];
|
|
82
|
+
const particleCount = 4;
|
|
83
|
+
for (let i = 0; i < particleCount; i++) {
|
|
84
|
+
const angle = i / particleCount * Math.PI * 2;
|
|
85
|
+
const velocity = 2 + Math.random() * 3;
|
|
86
|
+
particles.push({
|
|
87
|
+
id: `${bubble.id}-particle-${i}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
88
|
+
position: {
|
|
89
|
+
x: bubble.x,
|
|
90
|
+
y: bubble.y
|
|
91
|
+
},
|
|
92
|
+
velocity: {
|
|
93
|
+
x: Math.cos(angle) * velocity,
|
|
94
|
+
y: Math.sin(angle) * velocity
|
|
95
|
+
},
|
|
96
|
+
color: bubble.color,
|
|
97
|
+
size: 4 + Math.random() * 6,
|
|
98
|
+
lifetime: 0,
|
|
99
|
+
maxLifetime: 500 + Math.random() * 300
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
onParticleCreated(particles);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Check if all bubbles are popped
|
|
106
|
+
checkAllBubblesPopped(grid) {
|
|
107
|
+
for (let row = 0; row < grid.size; row++) {
|
|
108
|
+
for (let col = 0; col < grid.size; col++) {
|
|
109
|
+
const bubble = grid.bubbles[row]?.[col];
|
|
110
|
+
if (bubble && !bubble.isPopped) {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Calculate completion percentage
|
|
119
|
+
calculateCompletionPercentage(grid) {
|
|
120
|
+
let totalBubbles = 0;
|
|
121
|
+
let poppedBubbles = 0;
|
|
122
|
+
for (let row = 0; row < grid.size; row++) {
|
|
123
|
+
for (let col = 0; col < grid.size; col++) {
|
|
124
|
+
const bubble = grid.bubbles[row]?.[col];
|
|
125
|
+
if (bubble) {
|
|
126
|
+
totalBubbles++;
|
|
127
|
+
if (bubble.isPopped) {
|
|
128
|
+
poppedBubbles++;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return totalBubbles > 0 ? poppedBubbles / totalBubbles * 100 : 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Start game timer
|
|
137
|
+
startGameTimer(duration, onTick, onComplete) {
|
|
138
|
+
this.stopGameTimer();
|
|
139
|
+
let timeLeft = duration;
|
|
140
|
+
this.gameTimerRef = setInterval(() => {
|
|
141
|
+
timeLeft -= 1;
|
|
142
|
+
onTick(timeLeft);
|
|
143
|
+
if (timeLeft <= 0) {
|
|
144
|
+
this.stopGameTimer();
|
|
145
|
+
onComplete();
|
|
146
|
+
}
|
|
147
|
+
}, 1000);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Stop game timer
|
|
151
|
+
stopGameTimer() {
|
|
152
|
+
if (this.gameTimerRef) {
|
|
153
|
+
clearInterval(this.gameTimerRef);
|
|
154
|
+
this.gameTimerRef = null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Update particles animation
|
|
159
|
+
updateParticles(deltaTime) {
|
|
160
|
+
this.particles = this.particles.filter(particle => {
|
|
161
|
+
particle.lifetime += deltaTime;
|
|
162
|
+
particle.position.x += particle.velocity.x;
|
|
163
|
+
particle.position.y += particle.velocity.y;
|
|
164
|
+
particle.velocity.y += 0.2; // Gravity effect
|
|
165
|
+
|
|
166
|
+
return particle.lifetime < particle.maxLifetime;
|
|
167
|
+
});
|
|
168
|
+
return this.particles;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Add particles
|
|
172
|
+
addParticles(newParticles) {
|
|
173
|
+
this.particles.push(...newParticles);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Clear particles
|
|
177
|
+
clearParticles() {
|
|
178
|
+
this.particles = [];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Cleanup
|
|
182
|
+
cleanup() {
|
|
183
|
+
this.stopGameTimer();
|
|
184
|
+
this.clearParticles();
|
|
185
|
+
if (this.animationRef) {
|
|
186
|
+
cancelAnimationFrame(this.animationRef);
|
|
187
|
+
this.animationRef = null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=PopitFidgetService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dimensions","POPIT_FIDGET_GAME_CONFIG","GAME_CONFIG","POPIT_FIDGET_ANIMATION_CONFIG","ANIMATION_CONFIG","POPIT_FIDGET_COLORS","COLORS","RAINBOW_COLORS","BUBBLE_COLORS","width","height","get","PopitFidgetService","gameTimerRef","animationRef","particles","constructor","generateFidgetGrid","difficulty","availableWidth","availableHeight","gridSize","GRID_SIZES","maxSize","Math","min","bubbleSize","max","spacing","gridWidth","gridHeight","bubbles","row","col","x","y","id","isPopped","color","getRainbowColorForPosition","animationProgress","size","centerX","centerY","totalRows","colorIndex","floor","length","popBubble","bubble","onParticleCreated","particleCount","i","angle","PI","velocity","random","push","Date","now","toString","substr","position","cos","sin","lifetime","maxLifetime","checkAllBubblesPopped","grid","calculateCompletionPercentage","totalBubbles","poppedBubbles","startGameTimer","duration","onTick","onComplete","stopGameTimer","timeLeft","setInterval","clearInterval","updateParticles","deltaTime","filter","particle","addParticles","newParticles","clearParticles","cleanup","cancelAnimationFrame"],"sourceRoot":"../../../../src","sources":["games/popit-fidget/PopitFidgetService.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AACzC,SACEC,wBAAwB,IAAIC,WAAW,EACvCC,6BAA6B,IAAIC,gBAAgB,EACjDC,mBAAmB,IAAIC,MAAM,EAC7BC,cAAc,EACdC,aAAa,QACR,2BAAwB;AAE/B,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGV,UAAU,CAACW,GAAG,CAAC,QAAQ,CAAC;;AAElD;AACA;AACA,SAAST,WAAW,EAAEE,gBAAgB,EAAEE,MAAM,EAAEE,aAAa;;AAE7D;;AAiCA,OAAO,MAAMI,kBAAkB,CAAC;EACtBC,YAAY,GAA0B,IAAI;EAC1CC,YAAY,GAAkB,IAAI;EAClCC,SAAS,GAAe,EAAE;EAElCC,WAAWA,CAAA,EAAG,CAAC;;EAGf;EACAC,kBAAkBA,CAACC,UAAsC,EAAc;IACrE,MAAMC,cAAc,GAAGV,KAAK,GAAG,IAAI,CAAC,CAAC;IACrC,MAAMW,eAAe,GAAGV,MAAM,GAAG,GAAG,CAAC,CAAC;;IAEtC;IACA,MAAMW,QAAQ,GAAGnB,WAAW,CAACoB,UAAU,CAACJ,UAAU,CAAC;;IAEnD;IACA,MAAMK,OAAO,GAAGC,IAAI,CAACC,GAAG,CAACN,cAAc,GAAGE,QAAQ,EAAED,eAAe,GAAGC,QAAQ,CAAC;IAC/E,MAAMK,UAAU,GAAGF,IAAI,CAACG,GAAG,CAAC,E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