react-native-games 1.1.0 → 1.3.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 +101 -30
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -167
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -182
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +1 -318
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +1 -183
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +1 -237
- package/lib/module/games/balloon-blaster/components/GameArea.js +1 -156
- package/lib/module/games/balloon-blaster/components/GameBackground.js +1 -476
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +1 -112
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +1 -7
- package/lib/module/games/bike-racing/BikeRacing.js +1 -0
- package/lib/module/games/bike-racing/BikeRacing.js.map +1 -0
- package/lib/module/games/bike-racing/BikeRacingConstants.js +1 -0
- package/lib/module/games/bike-racing/BikeRacingConstants.js.map +1 -0
- package/lib/module/games/bike-racing/BikeRacingService.js +1 -0
- package/lib/module/games/bike-racing/BikeRacingService.js.map +1 -0
- package/lib/module/games/bike-racing/BikeRacingStore.js +1 -0
- package/lib/module/games/bike-racing/BikeRacingStore.js.map +1 -0
- package/lib/module/games/bike-racing/components/BikeComponent.js +1 -0
- package/lib/module/games/bike-racing/components/BikeComponent.js.map +1 -0
- package/lib/module/games/bike-racing/components/GameBackground.js +1 -0
- package/lib/module/games/bike-racing/components/GameBackground.js.map +1 -0
- package/lib/module/games/bike-racing/components/ScoreBoard.js +1 -0
- package/lib/module/games/bike-racing/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/bike-racing/components/index.js +1 -0
- package/lib/module/games/bike-racing/components/index.js.map +1 -0
- package/lib/module/games/bike-racing/index.js +1 -0
- package/lib/module/games/bike-racing/index.js.map +1 -0
- package/lib/module/games/block-blast/BlockBlast.js +1 -0
- package/lib/module/games/block-blast/BlockBlast.js.map +1 -0
- package/lib/module/games/block-blast/BlockBlastConstants.js +1 -0
- package/lib/module/games/block-blast/BlockBlastConstants.js.map +1 -0
- package/lib/module/games/block-blast/BlockBlastService.js +1 -0
- package/lib/module/games/block-blast/BlockBlastService.js.map +1 -0
- package/lib/module/games/block-blast/BlockBlastStore.js +1 -0
- package/lib/module/games/block-blast/BlockBlastStore.js.map +1 -0
- package/lib/module/games/block-blast/components/BlockPieceComponent.js +1 -0
- package/lib/module/games/block-blast/components/BlockPieceComponent.js.map +1 -0
- package/lib/module/games/block-blast/components/GameArea.js +1 -0
- package/lib/module/games/block-blast/components/GameArea.js.map +1 -0
- package/lib/module/games/block-blast/components/GameBackground.js +1 -0
- package/lib/module/games/block-blast/components/GameBackground.js.map +1 -0
- package/lib/module/games/block-blast/components/GridComponent.js +1 -0
- package/lib/module/games/block-blast/components/GridComponent.js.map +1 -0
- package/lib/module/games/block-blast/components/ScoreBoard.js +1 -0
- package/lib/module/games/block-blast/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/block-blast/components/index.js +1 -0
- package/lib/module/games/block-blast/components/index.js.map +1 -0
- package/lib/module/games/block-blast/index.js +1 -0
- package/lib/module/games/block-blast/index.js.map +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooter.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooter.js.map +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterConstants.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterConstants.js.map +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterService.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterService.js.map +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterStore.js +1 -0
- package/lib/module/games/bubble-shooter/BubbleShooterStore.js.map +1 -0
- package/lib/module/games/bubble-shooter/components/GameArea.js +1 -0
- package/lib/module/games/bubble-shooter/components/GameArea.js.map +1 -0
- package/lib/module/games/bubble-shooter/components/GameBackground.js +1 -0
- package/lib/module/games/bubble-shooter/components/GameBackground.js.map +1 -0
- package/lib/module/games/bubble-shooter/components/ScoreBoard.js +1 -0
- package/lib/module/games/bubble-shooter/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/bubble-shooter/components/index.js +1 -0
- package/lib/module/games/bubble-shooter/components/index.js.map +1 -0
- package/lib/module/games/bubble-shooter/index.js +1 -0
- package/lib/module/games/bubble-shooter/index.js.map +1 -0
- package/lib/module/games/candy-crush/CandyCrush.js +1 -131
- package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
- package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
- package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
- package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
- package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
- package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
- package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
- package/lib/module/games/candy-crush/components/index.js +1 -7
- package/lib/module/games/candy-crush/index.js +1 -6
- package/lib/module/games/car-racing/CarRacing.js +1 -0
- package/lib/module/games/car-racing/CarRacing.js.map +1 -0
- package/lib/module/games/car-racing/CarRacingConstants.js +1 -0
- package/lib/module/games/car-racing/CarRacingConstants.js.map +1 -0
- package/lib/module/games/car-racing/CarRacingService.js +1 -0
- package/lib/module/games/car-racing/CarRacingService.js.map +1 -0
- package/lib/module/games/car-racing/CarRacingStore.js +1 -0
- package/lib/module/games/car-racing/CarRacingStore.js.map +1 -0
- package/lib/module/games/car-racing/components/CarComponent.js +1 -0
- package/lib/module/games/car-racing/components/CarComponent.js.map +1 -0
- package/lib/module/games/car-racing/components/GameBackground.js +1 -0
- package/lib/module/games/car-racing/components/GameBackground.js.map +1 -0
- package/lib/module/games/car-racing/components/ScoreBoard.js +1 -0
- package/lib/module/games/car-racing/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/car-racing/components/index.js +1 -0
- package/lib/module/games/car-racing/components/index.js.map +1 -0
- package/lib/module/games/colors-sort/ColorsSort.js +1 -143
- package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
- package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
- package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
- package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
- package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
- package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
- package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
- package/lib/module/games/colors-sort/components/index.js +1 -6
- package/lib/module/games/dino-jump/DinoJump.js +1 -209
- package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
- package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
- package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
- package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
- package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
- package/lib/module/games/dino-jump/components/GameArea.js +1 -68
- package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
- package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
- package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
- package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
- package/lib/module/games/dino-jump/components/index.js +1 -9
- package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
- package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
- package/lib/module/games/flappy-bird/components/Bird.js +1 -87
- package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
- package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
- package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
- package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
- package/lib/module/games/flappy-bird/components/index.js +1 -8
- package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
- package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
- package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
- package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
- package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
- package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
- package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
- package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
- package/lib/module/games/fruit-merger/components/index.js +1 -7
- package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
- package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
- package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/index.js +1 -7
- package/lib/module/games/game-2048/Game2048.js +1 -149
- package/lib/module/games/game-2048/Game2048.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Constants.js +1 -263
- package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Service.js +1 -457
- package/lib/module/games/game-2048/Game2048Store.js +1 -236
- package/lib/module/games/game-2048/components/GameBackground.js +1 -247
- package/lib/module/games/game-2048/components/GameGrid.js +1 -139
- package/lib/module/games/game-2048/components/GameTile.js +1 -72
- package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
- package/lib/module/games/game-2048/components/index.js +1 -7
- package/lib/module/games/maze-runner/MazeRunner.js +1 -267
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
- package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
- package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
- package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
- package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
- package/lib/module/games/maze-runner/components/index.js +1 -8
- package/lib/module/games/perfect-circle/PerfectCircle.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircle.js.map +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleConstants.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleConstants.js.map +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleService.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleService.js.map +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleStore.js +1 -0
- package/lib/module/games/perfect-circle/PerfectCircleStore.js.map +1 -0
- package/lib/module/games/perfect-circle/components/DrawingCanvas.js +1 -0
- package/lib/module/games/perfect-circle/components/DrawingCanvas.js.map +1 -0
- package/lib/module/games/perfect-circle/components/GameBackground.js +1 -0
- package/lib/module/games/perfect-circle/components/GameBackground.js.map +1 -0
- package/lib/module/games/perfect-circle/components/ScoreBoard.js +1 -0
- package/lib/module/games/perfect-circle/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/perfect-circle/index.js +1 -0
- package/lib/module/games/perfect-circle/index.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
- package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
- package/lib/module/games/popit-fidget/components/index.js +1 -7
- package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
- package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
- package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
- package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
- package/lib/module/games/sliding-numbers/components/index.js +1 -7
- package/lib/module/games/snake/Snake.js +1 -189
- package/lib/module/games/snake/Snake.js.map +1 -1
- package/lib/module/games/snake/SnakeConstants.js +1 -138
- package/lib/module/games/snake/SnakeConstants.js.map +1 -1
- package/lib/module/games/snake/SnakeService.js +1 -148
- package/lib/module/games/snake/SnakeStore.js +1 -182
- package/lib/module/games/snake/SnakeStore.js.map +1 -1
- package/lib/module/games/snake/components/GameBackground.js +1 -221
- package/lib/module/games/snake/components/GameGrid.js +1 -153
- package/lib/module/games/snake/components/ScoreBoard.js +1 -51
- package/lib/module/games/snake/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/snake/components/index.js +1 -6
- package/lib/module/games/snake/index.js +1 -6
- package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
- package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
- package/lib/module/games/space-fighter/components/GameArea.js +1 -289
- package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
- package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
- package/lib/module/games/space-fighter/components/index.js +1 -9
- package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
- package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
- package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
- package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/index.js +1 -8
- package/lib/module/helpers/AnimationFrame.js +1 -120
- package/lib/module/helpers/AnimationTracker.js +1 -89
- package/lib/module/helpers/ErrorHandler.js +1 -269
- package/lib/module/helpers/GameControlButton.js +1 -219
- package/lib/module/helpers/GameOverModal.js +1 -144
- package/lib/module/helpers/GameOverModal.js.map +1 -1
- package/lib/module/helpers/GameSettingsModal.js +1 -287
- package/lib/module/helpers/GameSettingsModal.js.map +1 -1
- package/lib/module/helpers/ParticleBlast.js +1 -134
- package/lib/module/helpers/ScoreBoardContainer.js +1 -34
- package/lib/module/helpers/ScoreBoardContainer.js.map +1 -1
- package/lib/module/helpers/index.js +1 -12
- package/lib/module/index.js +1 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +1 -178
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +1 -112
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +1 -77
- package/lib/module/services/ScoringService.js +1 -0
- package/lib/module/services/ScoringService.js.map +1 -0
- package/lib/module/services/SoundsService.js +1 -302
- package/lib/module/services/SoundsService.js.map +1 -1
- package/lib/module/services/UtilsService.js +1 -32
- package/lib/module/services/UtilsService.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 +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts +4 -0
- package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts +76 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts +22 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts +72 -0
- package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts +12 -0
- package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts +9 -0
- package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts +7 -0
- package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/components/index.d.ts +4 -0
- package/lib/typescript/src/games/bike-racing/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/bike-racing/index.d.ts +5 -0
- package/lib/typescript/src/games/bike-racing/index.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/BlockBlast.d.ts +4 -0
- package/lib/typescript/src/games/block-blast/BlockBlast.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts +82 -0
- package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts +17 -0
- package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts +62 -0
- package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts +14 -0
- package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/GameArea.d.ts +12 -0
- package/lib/typescript/src/games/block-blast/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts +17 -0
- package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts +7 -0
- package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/components/index.d.ts +6 -0
- package/lib/typescript/src/games/block-blast/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/block-blast/index.d.ts +5 -0
- package/lib/typescript/src/games/block-blast/index.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts +4 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts +61 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts +26 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts +62 -0
- package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts +9 -0
- package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts +8 -0
- package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts +7 -0
- package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/components/index.d.ts +4 -0
- package/lib/typescript/src/games/bubble-shooter/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/bubble-shooter/index.d.ts +3 -0
- package/lib/typescript/src/games/bubble-shooter/index.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts.map +1 -1
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
- package/lib/typescript/src/games/car-racing/CarRacing.d.ts +4 -0
- package/lib/typescript/src/games/car-racing/CarRacing.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts +76 -0
- package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/CarRacingService.d.ts +22 -0
- package/lib/typescript/src/games/car-racing/CarRacingService.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts +72 -0
- package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts +13 -0
- package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts +9 -0
- package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts +7 -0
- package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/car-racing/components/index.d.ts +4 -0
- package/lib/typescript/src/games/car-racing/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
- package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts +4 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts +81 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts +14 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts +40 -0
- package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts +9 -0
- package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts +8 -0
- package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts +7 -0
- package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/perfect-circle/index.d.ts +3 -0
- package/lib/typescript/src/games/perfect-circle/index.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
- package/lib/typescript/src/games/snake/Snake.d.ts.map +1 -1
- package/lib/typescript/src/games/snake/SnakeStore.d.ts +4 -0
- package/lib/typescript/src/games/snake/SnakeStore.d.ts.map +1 -1
- package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
- package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
- package/lib/typescript/src/helpers/ScoreBoardContainer.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +6 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +57 -7
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +2 -1
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/ScoringService.d.ts +2 -0
- package/lib/typescript/src/services/ScoringService.d.ts.map +1 -0
- package/lib/typescript/src/services/SoundsService.d.ts +88 -0
- package/lib/typescript/src/services/SoundsService.d.ts.map +1 -1
- package/lib/typescript/src/services/UtilsService.d.ts +12 -1
- package/lib/typescript/src/services/UtilsService.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,113 +1 @@
|
|
|
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 - Matches scoreboard purple
|
|
85
|
-
export const POPIT_FIDGET_THEME = {
|
|
86
|
-
backgroundColor: '#fef7ff',
|
|
87
|
-
// Very light lavender to match game background
|
|
88
|
-
headerBackgroundColor: 'rgba(108, 92, 231, 0.9)',
|
|
89
|
-
// Purple header to match scoreboard
|
|
90
|
-
headerTextColor: '#ffffff',
|
|
91
|
-
sectionBackgroundColor: 'rgba(108, 92, 231, 0.4)',
|
|
92
|
-
// Match scoreboard transparency
|
|
93
|
-
sectionTitleColor: '#ffffff',
|
|
94
|
-
// White text on purple sections
|
|
95
|
-
buttonSelectedColor: '#9c27b0',
|
|
96
|
-
// Match start button purple
|
|
97
|
-
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
98
|
-
buttonSelectedTextColor: '#ffffff',
|
|
99
|
-
buttonUnselectedTextColor: '#1f2937',
|
|
100
|
-
switchTrackColorFalse: 'rgba(108, 92, 231, 0.5)',
|
|
101
|
-
switchTrackColorTrue: '#9c27b0',
|
|
102
|
-
// Match start button
|
|
103
|
-
switchThumbColor: '#ffffff',
|
|
104
|
-
infoTextColor: '#1f2937' // Dark text for readability
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// Popit Fidget Difficulty Descriptions
|
|
108
|
-
export const POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS = {
|
|
109
|
-
easy: 'Smaller fidget grids, relaxing pace',
|
|
110
|
-
medium: 'Medium grids, satisfying pops',
|
|
111
|
-
hard: 'Large complex shapes, ultimate satisfaction!'
|
|
112
|
-
};
|
|
113
|
-
//# sourceMappingURL=PopitFidgetConstants.js.map
|
|
1
|
+
"use strict";export const POPIT_FIDGET_GAME_CONFIG ={GAME_DURATION:120,POINTS_PER_BUBBLE:10,COMPLETION_BONUS:500,TIME_BONUS_MULTIPLIER:5,BUBBLE_SIZE:40,ANIMATION_DURATION:300,PARTICLE_COUNT:4,PARTICLE_LIFETIME:800,GRID_SIZES:{easy:5,medium:6,hard:7}};export const POPIT_FIDGET_ANIMATION_CONFIG ={POP_SCALE:1.3,POP_DURATION:200,FADE_DURATION:300,BOUNCE_SCALE:0.9,PARTICLE_VELOCITY:3,PARTICLE_GRAVITY:0.2};export const POPIT_FIDGET_COLORS ={BACKGROUND:'#f5f5f5',FIDGET_BORDER:'#333',FIDGET_SHADOW:'rgba(0,0,0,0.3)',SCORE:'#4a90e2',UI:'#6c5ce7',POPPED_BUBBLE:'#d0d0d0',PARTICLE_GLOW:'rgba(255,255,255,0.9)',FIDGET_BASE:'#ffffff',BUBBLE_SHADOW:'rgba(0,0,0,0.2)',BUBBLE_HIGHLIGHT:'rgba(255,255,255,0.6)'};export const RAINBOW_COLORS = ['#E91E63','#F44336','#FF5722','#FF9800','#FFC107','#8E24AA','#CDDC39','#8BC34A','#4CAF50','#009688','#00BCD4','#03A9F4','#2196F3','#3F51B5','#9C27B0','#E91E63' ];export const BUBBLE_COLORS = RAINBOW_COLORS;export const POPIT_FIDGET_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#9c27b0',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(156,39,176,0.15)',sectionTitleColor:'#9c27b0',buttonSelectedColor:'#9c27b0',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(156,39,176,0.3)',switchTrackColorTrue:'#9c27b0',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS ={easy:'Smaller fidget grids,relaxing pace',medium:'Medium grids,satisfying pops',hard:'Large complex shapes,ultimate satisfaction!'};
|
|
@@ -1 +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","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,
|
|
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","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,oBAAoB;EAAE;EACvCC,qBAAqB,EAAE,SAAS;EAAE;EAClCC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,0BAA0B;EAAE;EACpDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,0BAA0B;EAAE;EACvDC,qBAAqB,EAAE,yBAAyB;EAChDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,0BAA0B,CAAE;AAC7C,CAAC;;AAED;AACA,OAAO,MAAMC,oCAAoC,GAAG;EAClDrC,IAAI,EAAE,qCAAqC;EAC3CC,MAAM,EAAE,+BAA+B;EACvCC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
|
|
@@ -1,132 +1 @@
|
|
|
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
|
-
constructor() {}
|
|
19
|
-
|
|
20
|
-
// Generate square fidget grid based on difficulty
|
|
21
|
-
generateFidgetGrid(difficulty) {
|
|
22
|
-
const availableWidth = width * 0.85; // Match PopitFidget component calculation
|
|
23
|
-
const availableHeight = height * 0.6; // Match PopitFidget component calculation
|
|
24
|
-
|
|
25
|
-
// Get grid size from difficulty-based configuration
|
|
26
|
-
const gridSize = GAME_CONFIG.GRID_SIZES[difficulty];
|
|
27
|
-
|
|
28
|
-
// Use same bubble size calculation as PopitFidget component
|
|
29
|
-
const maxSize = Math.min(availableWidth / gridSize, availableHeight / gridSize);
|
|
30
|
-
const bubbleSize = Math.max(45, Math.min(80, maxSize * 0.9));
|
|
31
|
-
|
|
32
|
-
// Calculate grid dimensions with proper spacing
|
|
33
|
-
const spacing = bubbleSize * 1.1;
|
|
34
|
-
const gridWidth = (gridSize - 1) * spacing + bubbleSize;
|
|
35
|
-
const gridHeight = (gridSize - 1) * spacing + bubbleSize;
|
|
36
|
-
const bubbles = [];
|
|
37
|
-
|
|
38
|
-
// Generate square grid - all bubbles are included (no shape filtering)
|
|
39
|
-
for (let row = 0; row < gridSize; row++) {
|
|
40
|
-
bubbles[row] = [];
|
|
41
|
-
for (let col = 0; col < gridSize; col++) {
|
|
42
|
-
// Position bubbles with proper spacing to prevent overlap
|
|
43
|
-
const x = col * spacing + bubbleSize / 2;
|
|
44
|
-
const y = row * spacing + bubbleSize / 2;
|
|
45
|
-
bubbles[row][col] = {
|
|
46
|
-
id: `${row}-${col}`,
|
|
47
|
-
row,
|
|
48
|
-
col,
|
|
49
|
-
x,
|
|
50
|
-
y,
|
|
51
|
-
isPopped: false,
|
|
52
|
-
color: this.getRainbowColorForPosition(row, gridSize),
|
|
53
|
-
animationProgress: 0
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
size: gridSize,
|
|
59
|
-
bubbles,
|
|
60
|
-
centerX: gridWidth / 2,
|
|
61
|
-
centerY: gridHeight / 2,
|
|
62
|
-
width: gridWidth,
|
|
63
|
-
height: gridHeight
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Get rainbow gradient color based on row position for authentic Pop It look
|
|
68
|
-
getRainbowColorForPosition(row, totalRows) {
|
|
69
|
-
// Create rainbow gradient effect like real Pop It fidget toys
|
|
70
|
-
const colorIndex = Math.floor(row / totalRows * RAINBOW_COLORS.length);
|
|
71
|
-
return RAINBOW_COLORS[colorIndex] || RAINBOW_COLORS[0];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Check if all bubbles are popped
|
|
75
|
-
checkAllBubblesPopped(grid) {
|
|
76
|
-
for (let row = 0; row < grid.size; row++) {
|
|
77
|
-
for (let col = 0; col < grid.size; col++) {
|
|
78
|
-
const bubble = grid.bubbles[row]?.[col];
|
|
79
|
-
if (bubble && !bubble.isPopped) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return true;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Calculate completion percentage
|
|
88
|
-
calculateCompletionPercentage(grid) {
|
|
89
|
-
let totalBubbles = 0;
|
|
90
|
-
let poppedBubbles = 0;
|
|
91
|
-
for (let row = 0; row < grid.size; row++) {
|
|
92
|
-
for (let col = 0; col < grid.size; col++) {
|
|
93
|
-
const bubble = grid.bubbles[row]?.[col];
|
|
94
|
-
if (bubble) {
|
|
95
|
-
totalBubbles++;
|
|
96
|
-
if (bubble.isPopped) {
|
|
97
|
-
poppedBubbles++;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return totalBubbles > 0 ? poppedBubbles / totalBubbles * 100 : 0;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Start game timer
|
|
106
|
-
startGameTimer(duration, onTick, onComplete) {
|
|
107
|
-
this.stopGameTimer();
|
|
108
|
-
let timeLeft = duration;
|
|
109
|
-
this.gameTimerRef = setInterval(() => {
|
|
110
|
-
timeLeft -= 1;
|
|
111
|
-
onTick(timeLeft);
|
|
112
|
-
if (timeLeft <= 0) {
|
|
113
|
-
this.stopGameTimer();
|
|
114
|
-
onComplete();
|
|
115
|
-
}
|
|
116
|
-
}, 1000);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Stop game timer
|
|
120
|
-
stopGameTimer() {
|
|
121
|
-
if (this.gameTimerRef) {
|
|
122
|
-
clearInterval(this.gameTimerRef);
|
|
123
|
-
this.gameTimerRef = null;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Cleanup
|
|
128
|
-
cleanup() {
|
|
129
|
-
this.stopGameTimer();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=PopitFidgetService.js.map
|
|
1
|
+
"use strict";import{Dimensions}from 'react-native';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";const{width,height}= Dimensions.get('window');export{GAME_CONFIG,ANIMATION_CONFIG,COLORS,BUBBLE_COLORS};export class PopitFidgetService{gameTimerRef = null;constructor(){}generateFidgetGrid(difficulty){const availableWidth = width * 0.85;const availableHeight = height * 0.6;const gridSize = GAME_CONFIG.GRID_SIZES[difficulty];const maxSize = Math.min(availableWidth / gridSize,availableHeight / gridSize);const bubbleSize = Math.max(45,Math.min(80,maxSize * 0.9));const spacing = bubbleSize * 1.1;const gridWidth =(gridSize - 1)* spacing + bubbleSize;const gridHeight =(gridSize - 1)* spacing + bubbleSize;const bubbles = [];for(let row = 0;row < gridSize;row++){bubbles[row] = [];for(let col = 0;col < gridSize;col++){const x = col * spacing + bubbleSize / 2;const y = row * spacing + bubbleSize / 2;bubbles[row][col] ={id:`${row}-${col}`,row,col,x,y,isPopped:false,color:this.getRainbowColorForPosition(row,gridSize),animationProgress:0};}}return{size:gridSize,bubbles,centerX:gridWidth / 2,centerY:gridHeight / 2,width:gridWidth,height:gridHeight};}getRainbowColorForPosition(row,totalRows){const colorIndex = Math.floor(row / totalRows * RAINBOW_COLORS.length);return RAINBOW_COLORS[colorIndex] || RAINBOW_COLORS[0];}checkAllBubblesPopped(grid){for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble && !bubble.isPopped){return false;}}}return true;}calculateCompletionPercentage(grid){let totalBubbles = 0;let poppedBubbles = 0;for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble){totalBubbles++;if(bubble.isPopped){poppedBubbles++;}}}}return totalBubbles > 0 ? poppedBubbles / totalBubbles * 100:0;}startGameTimer(duration,onTick,onComplete){this.stopGameTimer();let timeLeft = duration;this.gameTimerRef = setInterval(()=>{timeLeft -= 1;onTick(timeLeft);if(timeLeft <= 0){this.stopGameTimer();onComplete();}},1000);}stopGameTimer(){if(this.gameTimerRef){clearInterval(this.gameTimerRef);this.gameTimerRef = null;}}cleanup(){this.stopGameTimer();}}
|
|
@@ -1,125 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { create } from 'zustand';
|
|
4
|
-
import { subscribeWithSelector } from 'zustand/middleware';
|
|
5
|
-
import { immerMiddleware } from "../../services/UtilsService.js";
|
|
6
|
-
// Optimized store with selective subscriptions for low-end devices
|
|
7
|
-
export const usePopitFidgetStore = create()(subscribeWithSelector(immerMiddleware((set, get) => ({
|
|
8
|
-
// Initial state
|
|
9
|
-
timeElapsed: 0,
|
|
10
|
-
isPlaying: false,
|
|
11
|
-
gameOver: false,
|
|
12
|
-
gameWon: false,
|
|
13
|
-
fidgetGrid: null,
|
|
14
|
-
bubblesPopped: 0,
|
|
15
|
-
totalBubbles: 0,
|
|
16
|
-
bubbleStates: {},
|
|
17
|
-
// Actions
|
|
18
|
-
startGame: _gameDuration => {
|
|
19
|
-
set(draft => {
|
|
20
|
-
draft.isPlaying = true;
|
|
21
|
-
draft.gameOver = false;
|
|
22
|
-
draft.gameWon = false;
|
|
23
|
-
draft.timeElapsed = 0;
|
|
24
|
-
draft.bubblesPopped = 0;
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
stopGame: () => {
|
|
28
|
-
set(draft => {
|
|
29
|
-
draft.isPlaying = false;
|
|
30
|
-
draft.gameOver = true;
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
resetGame: () => {
|
|
34
|
-
set(draft => {
|
|
35
|
-
draft.timeElapsed = 0;
|
|
36
|
-
draft.isPlaying = false;
|
|
37
|
-
draft.gameOver = false;
|
|
38
|
-
draft.gameWon = false;
|
|
39
|
-
draft.fidgetGrid = null;
|
|
40
|
-
draft.bubblesPopped = 0;
|
|
41
|
-
draft.totalBubbles = 0;
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
setFidgetGrid: grid => {
|
|
45
|
-
// For square grids, total bubbles = size * size
|
|
46
|
-
const totalCount = grid.size * grid.size;
|
|
47
|
-
set(draft => {
|
|
48
|
-
draft.fidgetGrid = grid;
|
|
49
|
-
draft.totalBubbles = totalCount;
|
|
50
|
-
draft.bubblesPopped = 0;
|
|
51
|
-
|
|
52
|
-
// Initialize bubble states for all bubbles
|
|
53
|
-
draft.bubbleStates = {};
|
|
54
|
-
for (let row = 0; row < grid.size; row++) {
|
|
55
|
-
for (let col = 0; col < grid.size; col++) {
|
|
56
|
-
const bubble = grid.bubbles[row]?.[col];
|
|
57
|
-
if (bubble) {
|
|
58
|
-
draft.bubbleStates[bubble.id] = {
|
|
59
|
-
isPopped: bubble.isPopped || false,
|
|
60
|
-
popTime: bubble.popTime
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
popBubble: (row, col) => {
|
|
68
|
-
set(draft => {
|
|
69
|
-
if (!draft.fidgetGrid) return;
|
|
70
|
-
const bubble = draft.fidgetGrid.bubbles[row]?.[col];
|
|
71
|
-
if (!bubble) return;
|
|
72
|
-
|
|
73
|
-
// Check if bubble is already popped using bubbleStates
|
|
74
|
-
const bubbleState = draft.bubbleStates[bubble.id];
|
|
75
|
-
if (bubbleState?.isPopped) return;
|
|
76
|
-
|
|
77
|
-
// Update only the bubbleStates, not the fidgetGrid
|
|
78
|
-
// This prevents the entire fidgetGrid array from changing references
|
|
79
|
-
draft.bubbleStates[bubble.id] = {
|
|
80
|
-
isPopped: true,
|
|
81
|
-
popTime: Date.now()
|
|
82
|
-
};
|
|
83
|
-
draft.bubblesPopped = draft.bubblesPopped + 1;
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
// Check if game is won (only if actively playing)
|
|
87
|
-
const state = get();
|
|
88
|
-
if (state.isPlaying) {
|
|
89
|
-
get().checkGameWon();
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
incrementTime: () => {
|
|
93
|
-
set(draft => {
|
|
94
|
-
draft.timeElapsed = draft.timeElapsed + 1;
|
|
95
|
-
});
|
|
96
|
-
},
|
|
97
|
-
checkGameWon: () => {
|
|
98
|
-
const state = get();
|
|
99
|
-
if (!state.fidgetGrid) return;
|
|
100
|
-
|
|
101
|
-
// Check if all bubbles are popped using bubbleStates
|
|
102
|
-
let allPopped = true;
|
|
103
|
-
for (let row = 0; row < state.fidgetGrid.size; row++) {
|
|
104
|
-
for (let col = 0; col < state.fidgetGrid.size; col++) {
|
|
105
|
-
const bubble = state.fidgetGrid.bubbles[row]?.[col];
|
|
106
|
-
if (bubble) {
|
|
107
|
-
const bubbleState = state.bubbleStates[bubble.id];
|
|
108
|
-
if (!bubbleState?.isPopped) {
|
|
109
|
-
allPopped = false;
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (!allPopped) break;
|
|
115
|
-
}
|
|
116
|
-
if (allPopped && state.isPlaying) {
|
|
117
|
-
set(draft => {
|
|
118
|
-
draft.isPlaying = false;
|
|
119
|
-
draft.gameWon = true;
|
|
120
|
-
draft.gameOver = true;
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}))));
|
|
125
|
-
//# sourceMappingURL=PopitFidgetStore.js.map
|
|
1
|
+
"use strict";import{create}from 'zustand';import{subscribeWithSelector}from 'zustand/middleware';import{immerMiddleware}from "../../services/UtilsService.js";export const usePopitFidgetStore = create()(subscribeWithSelector(immerMiddleware((set,get)=>({timeElapsed:0,isPlaying:false,gameOver:false,gameWon:false,fidgetGrid:null,bubblesPopped:0,totalBubbles:0,bubbleStates:{},startGame:_gameDuration =>{set(draft =>{draft.isPlaying = true;draft.gameOver = false;draft.gameWon = false;draft.timeElapsed = 0;draft.bubblesPopped = 0;});},stopGame:()=>{set(draft =>{draft.isPlaying = false;draft.gameOver = true;});},resetGame:()=>{set(draft =>{draft.timeElapsed = 0;draft.isPlaying = false;draft.gameOver = false;draft.gameWon = false;draft.fidgetGrid = null;draft.bubblesPopped = 0;draft.totalBubbles = 0;});},setFidgetGrid:grid =>{const totalCount = grid.size * grid.size;set(draft =>{draft.fidgetGrid = grid;draft.totalBubbles = totalCount;draft.bubblesPopped = 0;draft.bubbleStates ={};for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble){draft.bubbleStates[bubble.id] ={isPopped:bubble.isPopped || false,popTime:bubble.popTime};}}}});},popBubble:(row,col)=>{set(draft =>{if(!draft.fidgetGrid)return;const bubble = draft.fidgetGrid.bubbles[row]?.[col];if(!bubble)return;const bubbleState = draft.bubbleStates[bubble.id];if(bubbleState?.isPopped)return;draft.bubbleStates[bubble.id] ={isPopped:true,popTime:Date.now()};draft.bubblesPopped = draft.bubblesPopped + 1;});const state = get();if(state.isPlaying){get().checkGameWon();}},incrementTime:()=>{set(draft =>{draft.timeElapsed = draft.timeElapsed + 1;});},checkGameWon:()=>{const state = get();if(!state.fidgetGrid)return;let allPopped = true;for(let row = 0;row < state.fidgetGrid.size;row++){for(let col = 0;col < state.fidgetGrid.size;col++){const bubble = state.fidgetGrid.bubbles[row]?.[col];if(bubble){const bubbleState = state.bubbleStates[bubble.id];if(!bubbleState?.isPopped){allPopped = false;break;}}}if(!allPopped)break;}if(allPopped && state.isPlaying){set(draft =>{draft.isPlaying = false;draft.gameWon = true;draft.gameOver = true;});}}}))));
|
|
@@ -1,198 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useState, useCallback, useMemo } from 'react';
|
|
4
|
-
import { View, TouchableOpacity } from 'react-native';
|
|
5
|
-
import { Canvas, Circle, LinearGradient, vec, Shadow } from '@shopify/react-native-skia';
|
|
6
|
-
import { playHaptic, HapticType } from "../../../services/HapticsService.js";
|
|
7
|
-
import { usePopitFidgetStore } from "../PopitFidgetStore.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const BubbleComponent = ({
|
|
10
|
-
bubble,
|
|
11
|
-
size,
|
|
12
|
-
onPop,
|
|
13
|
-
hapticEnabled = true,
|
|
14
|
-
isPlaying
|
|
15
|
-
}) => {
|
|
16
|
-
// Get bubble state from store to prevent re-renders when other bubbles change
|
|
17
|
-
const bubbleState = usePopitFidgetStore(state => state.bubbleStates[bubble.id]);
|
|
18
|
-
const isPopped = bubbleState?.isPopped || false;
|
|
19
|
-
// Simple state for press feedback - no animations to prevent crashes
|
|
20
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
21
|
-
|
|
22
|
-
// Memoize callbacks to prevent unnecessary re-renders
|
|
23
|
-
const handlePop = useCallback(() => {
|
|
24
|
-
// Only allow popping when game is actively playing
|
|
25
|
-
if (!isPlaying || isPopped) return;
|
|
26
|
-
|
|
27
|
-
// Enhanced haptic feedback - stronger for more satisfaction
|
|
28
|
-
playHaptic(HapticType.MEDIUM, hapticEnabled || false);
|
|
29
|
-
|
|
30
|
-
// Trigger pop callback
|
|
31
|
-
onPop();
|
|
32
|
-
}, [onPop, hapticEnabled, isPlaying, isPopped]);
|
|
33
|
-
const handlePressIn = useCallback(() => {
|
|
34
|
-
if (!isPopped && isPlaying) {
|
|
35
|
-
setIsPressed(true);
|
|
36
|
-
// Haptic feedback on press
|
|
37
|
-
playHaptic(HapticType.LIGHT, hapticEnabled || false);
|
|
38
|
-
}
|
|
39
|
-
}, [isPopped, isPlaying, hapticEnabled]);
|
|
40
|
-
const handlePressOut = useCallback(() => {
|
|
41
|
-
setIsPressed(false);
|
|
42
|
-
}, []);
|
|
43
|
-
|
|
44
|
-
// Memoize bubble style to prevent recalculation
|
|
45
|
-
const bubbleStyle = useMemo(() => ({
|
|
46
|
-
position: 'absolute',
|
|
47
|
-
left: bubble.x - size / 2,
|
|
48
|
-
top: bubble.y - size / 2,
|
|
49
|
-
width: size,
|
|
50
|
-
height: size,
|
|
51
|
-
transform: [{
|
|
52
|
-
scale: isPressed ? 0.95 : 1
|
|
53
|
-
}]
|
|
54
|
-
}), [bubble.x, bubble.y, size, isPressed]);
|
|
55
|
-
|
|
56
|
-
// Simplified popped state rendering
|
|
57
|
-
if (isPopped) {
|
|
58
|
-
return /*#__PURE__*/_jsx(View, {
|
|
59
|
-
style: bubbleStyle,
|
|
60
|
-
children: /*#__PURE__*/_jsxs(Canvas, {
|
|
61
|
-
style: {
|
|
62
|
-
width: size,
|
|
63
|
-
height: size
|
|
64
|
-
},
|
|
65
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
66
|
-
cx: size / 2,
|
|
67
|
-
cy: size / 2,
|
|
68
|
-
r: size / 2,
|
|
69
|
-
color: bubble.color,
|
|
70
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
71
|
-
start: vec(0, 0),
|
|
72
|
-
end: vec(size, size),
|
|
73
|
-
colors: [`${bubble.color}60`,
|
|
74
|
-
// Muted to show flatness
|
|
75
|
-
`${bubble.color}40`,
|
|
76
|
-
// More muted
|
|
77
|
-
`${bubble.color}30` // Very muted to show depression
|
|
78
|
-
]
|
|
79
|
-
})
|
|
80
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
81
|
-
cx: size / 2,
|
|
82
|
-
cy: size / 2 + 1,
|
|
83
|
-
r: size / 2 - 6,
|
|
84
|
-
color: bubble.color,
|
|
85
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
86
|
-
start: vec(size * 0.7, size * 0.7),
|
|
87
|
-
end: vec(size * 0.3, size * 0.3),
|
|
88
|
-
colors: ['#FFFFFF30',
|
|
89
|
-
// Light highlight
|
|
90
|
-
`${bubble.color}80`,
|
|
91
|
-
// Bubble color
|
|
92
|
-
'#00000020' // Subtle shadow
|
|
93
|
-
]
|
|
94
|
-
})
|
|
95
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
96
|
-
cx: size / 2 + size * 0.15,
|
|
97
|
-
cy: size / 2 + size * 0.2,
|
|
98
|
-
r: size * 0.06,
|
|
99
|
-
color: "#FFFFFF",
|
|
100
|
-
opacity: 0.6
|
|
101
|
-
})]
|
|
102
|
-
})
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Simplified unpopped bubble rendering with TouchableOpacity wrapper for iOS/Android compatibility
|
|
107
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
108
|
-
style: bubbleStyle,
|
|
109
|
-
children: [/*#__PURE__*/_jsxs(Canvas, {
|
|
110
|
-
style: {
|
|
111
|
-
width: size,
|
|
112
|
-
height: size
|
|
113
|
-
},
|
|
114
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
115
|
-
cx: size / 2,
|
|
116
|
-
cy: size / 2,
|
|
117
|
-
r: size / 2,
|
|
118
|
-
color: bubble.color,
|
|
119
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
120
|
-
start: vec(0, 0),
|
|
121
|
-
end: vec(size, size),
|
|
122
|
-
colors: [`${bubble.color}E0`, `${bubble.color}A0`, `${bubble.color}80`]
|
|
123
|
-
})
|
|
124
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
125
|
-
cx: size / 2,
|
|
126
|
-
cy: size / 2 + 2,
|
|
127
|
-
r: size / 2 - 4,
|
|
128
|
-
color: "rgba(0,0,0,0.15)"
|
|
129
|
-
}), /*#__PURE__*/_jsxs(Circle, {
|
|
130
|
-
cx: size / 2,
|
|
131
|
-
cy: size / 2 - 1,
|
|
132
|
-
r: size / 2 - 4,
|
|
133
|
-
color: bubble.color,
|
|
134
|
-
children: [/*#__PURE__*/_jsx(LinearGradient, {
|
|
135
|
-
start: vec(size * 0.2, size * 0.2),
|
|
136
|
-
end: vec(size * 0.8, size * 0.8),
|
|
137
|
-
colors: ['#FFFFFF', '#FFFFFFA0', bubble.color, `${bubble.color}C0`, '#00000020']
|
|
138
|
-
}), /*#__PURE__*/_jsx(Shadow, {
|
|
139
|
-
dx: 0,
|
|
140
|
-
dy: 3,
|
|
141
|
-
blur: 6,
|
|
142
|
-
color: "rgba(0,0,0,0.2)"
|
|
143
|
-
})]
|
|
144
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
145
|
-
cx: size / 2 - size * 0.15,
|
|
146
|
-
cy: size / 2 - size * 0.2,
|
|
147
|
-
r: size * 0.12,
|
|
148
|
-
color: "#FFFFFF",
|
|
149
|
-
opacity: 0.8,
|
|
150
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
151
|
-
start: vec(0, 0),
|
|
152
|
-
end: vec(size * 0.24, size * 0.24),
|
|
153
|
-
colors: ['#FFFFFF', '#FFFFFF80', '#FFFFFF00']
|
|
154
|
-
})
|
|
155
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
156
|
-
cx: size / 2 + size * 0.1,
|
|
157
|
-
cy: size / 2 - size * 0.15,
|
|
158
|
-
r: size * 0.06,
|
|
159
|
-
color: "#FFFFFF",
|
|
160
|
-
opacity: 0.6
|
|
161
|
-
})]
|
|
162
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
163
|
-
style: {
|
|
164
|
-
position: 'absolute',
|
|
165
|
-
top: 0,
|
|
166
|
-
left: 0,
|
|
167
|
-
width: size,
|
|
168
|
-
height: size,
|
|
169
|
-
backgroundColor: 'transparent'
|
|
170
|
-
},
|
|
171
|
-
onPress: handlePop,
|
|
172
|
-
onPressIn: handlePressIn,
|
|
173
|
-
onPressOut: handlePressOut,
|
|
174
|
-
activeOpacity: 1,
|
|
175
|
-
disabled: isPopped || !isPlaying,
|
|
176
|
-
hitSlop: {
|
|
177
|
-
top: 10,
|
|
178
|
-
bottom: 10,
|
|
179
|
-
left: 10,
|
|
180
|
-
right: 10
|
|
181
|
-
},
|
|
182
|
-
delayPressIn: 0,
|
|
183
|
-
delayPressOut: 0
|
|
184
|
-
})]
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
// Memoized BubbleComponent with custom comparison to prevent unnecessary re-renders
|
|
189
|
-
// Note: We don't compare onPop function reference as it may change but functionality remains the same
|
|
190
|
-
// Note: We don't compare bubble.isPopped as we now use store state which is subscribed individually
|
|
191
|
-
const MemoizedBubbleComponent = /*#__PURE__*/React.memo(BubbleComponent, (prevProps, nextProps) => {
|
|
192
|
-
return prevProps.bubble.id === nextProps.bubble.id && prevProps.bubble.x === nextProps.bubble.x && prevProps.bubble.y === nextProps.bubble.y && prevProps.bubble.color === nextProps.bubble.color && prevProps.size === nextProps.size && prevProps.hapticEnabled === nextProps.hapticEnabled && prevProps.isPlaying === nextProps.isPlaying
|
|
193
|
-
// Removed bubble.isPopped comparison as we now use individual store subscriptions
|
|
194
|
-
// Removed onPop comparison as function reference may change but behavior is the same
|
|
195
|
-
;
|
|
196
|
-
});
|
|
197
|
-
export default MemoizedBubbleComponent;
|
|
198
|
-
//# sourceMappingURL=BubbleComponent.js.map
|
|
1
|
+
"use strict";import React,{useState,useCallback,useMemo}from 'react';import{View,TouchableOpacity}from 'react-native';import{Canvas,Circle,LinearGradient,vec,Shadow}from '@shopify/react-native-skia';import{playHaptic,HapticType}from "../../../services/HapticsService.js";import{usePopitFidgetStore}from "../PopitFidgetStore.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const BubbleComponent =({bubble,size,onPop,hapticEnabled = true,isPlaying})=>{const bubbleState = usePopitFidgetStore(state => state.bubbleStates[bubble.id]);const isPopped = bubbleState?.isPopped || false;const [isPressed,setIsPressed] = useState(false);const handlePop = useCallback(()=>{if(!isPlaying || isPopped)return;playHaptic(HapticType.MEDIUM,hapticEnabled || false);onPop();},[onPop,hapticEnabled,isPlaying,isPopped]);const handlePressIn = useCallback(()=>{if(!isPopped && isPlaying){setIsPressed(true);playHaptic(HapticType.LIGHT,hapticEnabled || false);}},[isPopped,isPlaying,hapticEnabled]);const handlePressOut = useCallback(()=>{setIsPressed(false);},[]);const bubbleStyle = useMemo(()=>({position:'absolute',left:bubble.x - size / 2,top:bubble.y - size / 2,width:size,height:size,transform:[{scale:isPressed ? 0.95:1}]}),[bubble.x,bubble.y,size,isPressed]);if(isPopped){return _jsx(View,{style:bubbleStyle,children:_jsxs(Canvas,{style:{width:size,height:size},children:[_jsx(Circle,{cx:size / 2,cy:size / 2,r:size / 2,color:bubble.color,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size,size),colors:[`${bubble.color}60`,`${bubble.color}40`,`${bubble.color}30` ]})}),_jsx(Circle,{cx:size / 2,cy:size / 2 + 1,r:size / 2 - 6,color:bubble.color,children:_jsx(LinearGradient,{start:vec(size * 0.7,size * 0.7),end:vec(size * 0.3,size * 0.3),colors:['#FFFFFF30',`${bubble.color}80`,'#00000020' ]})}),_jsx(Circle,{cx:size / 2 + size * 0.15,cy:size / 2 + size * 0.2,r:size * 0.06,color:"#FFFFFF",opacity:0.6})]})});}return _jsxs(View,{style:bubbleStyle,children:[_jsxs(Canvas,{style:{width:size,height:size},children:[_jsx(Circle,{cx:size / 2,cy:size / 2,r:size / 2,color:bubble.color,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size,size),colors:[`${bubble.color}E0`,`${bubble.color}A0`,`${bubble.color}80`]})}),_jsx(Circle,{cx:size / 2,cy:size / 2 + 2,r:size / 2 - 4,color:"rgba(0,0,0,0.15)"}),_jsxs(Circle,{cx:size / 2,cy:size / 2 - 1,r:size / 2 - 4,color:bubble.color,children:[_jsx(LinearGradient,{start:vec(size * 0.2,size * 0.2),end:vec(size * 0.8,size * 0.8),colors:['#FFFFFF','#FFFFFFA0',bubble.color,`${bubble.color}C0`,'#00000020']}),_jsx(Shadow,{dx:0,dy:3,blur:6,color:"rgba(0,0,0,0.2)"})]}),_jsx(Circle,{cx:size / 2 - size * 0.15,cy:size / 2 - size * 0.2,r:size * 0.12,color:"#FFFFFF",opacity:0.8,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size * 0.24,size * 0.24),colors:['#FFFFFF','#FFFFFF80','#FFFFFF00']})}),_jsx(Circle,{cx:size / 2 + size * 0.1,cy:size / 2 - size * 0.15,r:size * 0.06,color:"#FFFFFF",opacity:0.6})]}),_jsx(TouchableOpacity,{style:{position:'absolute',top:0,left:0,width:size,height:size,backgroundColor:'transparent'},onPress:handlePop,onPressIn:handlePressIn,onPressOut:handlePressOut,activeOpacity:1,disabled:isPopped || !isPlaying,hitSlop:{top:10,bottom:10,left:10,right:10},delayPressIn:0,delayPressOut:0})]});};const MemoizedBubbleComponent = React.memo(BubbleComponent,(prevProps,nextProps)=>{return prevProps.bubble.id === nextProps.bubble.id && prevProps.bubble.x === nextProps.bubble.x && prevProps.bubble.y === nextProps.bubble.y && prevProps.bubble.color === nextProps.bubble.color && prevProps.size === nextProps.size && prevProps.hapticEnabled === nextProps.hapticEnabled && prevProps.isPlaying === nextProps.isPlaying;});export default MemoizedBubbleComponent;
|