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,215 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useRef, useEffect, useState } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
5
|
-
import { runOnJS } from 'react-native-reanimated';
|
|
6
|
-
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
7
|
-
import { useFruitNinjaStore } from "../FruitNinjaStore.js";
|
|
8
|
-
import { GAME_CONFIG } from "../FruitNinjaService.js";
|
|
9
|
-
import { playSound, GAME_SOUNDS } from "../../../services/SoundsService.js";
|
|
10
|
-
import { playHaptic, HapticType } from "../../../services/HapticsService.js";
|
|
11
|
-
import { ParticleBlast, useAnimationTracker } from "../../../helpers/index.js";
|
|
12
|
-
import { FruitComponent } from "./FruitComponent.js";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
export const GameArea = /*#__PURE__*/React.memo(() => {
|
|
15
|
-
// Read state directly from store to reduce main component re-renders
|
|
16
|
-
const fruits = useFruitNinjaStore(state => state.fruits);
|
|
17
|
-
|
|
18
|
-
// Get store actions
|
|
19
|
-
const {
|
|
20
|
-
sliceFruit,
|
|
21
|
-
removeFruit,
|
|
22
|
-
updateFruit,
|
|
23
|
-
resetCombo,
|
|
24
|
-
loseLife,
|
|
25
|
-
addLife
|
|
26
|
-
} = useFruitNinjaStore();
|
|
27
|
-
|
|
28
|
-
// Minimal collision detection - no visual trail needed
|
|
29
|
-
const lastGesturePoint = useRef(null);
|
|
30
|
-
|
|
31
|
-
// Self-contained component - no external settings needed
|
|
32
|
-
|
|
33
|
-
// Animation tracking for fruits using shared utility
|
|
34
|
-
const fruitAnimations = useAnimationTracker();
|
|
35
|
-
|
|
36
|
-
// State for managing active particle blasts
|
|
37
|
-
const [activeBlasts, setActiveBlasts] = useState([]);
|
|
38
|
-
|
|
39
|
-
// Sound and haptic feedback functions (using default enabled state)
|
|
40
|
-
const playSliceSound = () => {
|
|
41
|
-
playSound(GAME_SOUNDS.FRUIT_NINJA.SLICE, true);
|
|
42
|
-
playHaptic(HapticType.LIGHT, true);
|
|
43
|
-
};
|
|
44
|
-
const playBombSound = () => {
|
|
45
|
-
playSound(GAME_SOUNDS.FRUIT_NINJA.BOMB, true);
|
|
46
|
-
playHaptic(HapticType.HEAVY, true);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// Create blast particles using shared ParticleBlast component
|
|
50
|
-
const createBlastParticles = fruit => {
|
|
51
|
-
const blastX = fruit.position.x + GAME_CONFIG.FRUIT_SIZE / 2;
|
|
52
|
-
const blastY = fruit.position.y + GAME_CONFIG.FRUIT_SIZE / 2;
|
|
53
|
-
const blastId = `blast_${Date.now()}_${Math.random()}`;
|
|
54
|
-
setActiveBlasts(prev => [...prev, {
|
|
55
|
-
id: blastId,
|
|
56
|
-
x: blastX,
|
|
57
|
-
y: blastY
|
|
58
|
-
}]);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// Handle blast completion (remove from active blasts)
|
|
62
|
-
const handleBlastComplete = blastId => {
|
|
63
|
-
setActiveBlasts(prev => prev.filter(blast => blast.id !== blastId));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Simplified gesture handling - no visual trail, just collision detection
|
|
67
|
-
const handleGestureStart = event => {
|
|
68
|
-
const currentState = useFruitNinjaStore.getState();
|
|
69
|
-
if (!currentState.isPlaying) return;
|
|
70
|
-
lastGesturePoint.current = {
|
|
71
|
-
x: event.x,
|
|
72
|
-
y: event.y
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
// Light haptic feedback on slice start
|
|
76
|
-
playHaptic(HapticType.LIGHT, true);
|
|
77
|
-
};
|
|
78
|
-
const handleGestureUpdate = event => {
|
|
79
|
-
const currentState = useFruitNinjaStore.getState();
|
|
80
|
-
if (!currentState.isPlaying) return;
|
|
81
|
-
const currentPoint = {
|
|
82
|
-
x: event.x,
|
|
83
|
-
y: event.y
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
// Check for fruit collisions with current gesture point
|
|
87
|
-
checkFruitCollisions(currentPoint);
|
|
88
|
-
lastGesturePoint.current = currentPoint;
|
|
89
|
-
};
|
|
90
|
-
const handleGestureEnd = () => {
|
|
91
|
-
const currentState = useFruitNinjaStore.getState();
|
|
92
|
-
if (!currentState.isPlaying) return;
|
|
93
|
-
lastGesturePoint.current = null;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// Create pan gesture - moved from parent
|
|
97
|
-
const panGesture = Gesture.Pan().onStart(event => {
|
|
98
|
-
runOnJS(handleGestureStart)(event);
|
|
99
|
-
}).onUpdate(event => {
|
|
100
|
-
runOnJS(handleGestureUpdate)(event);
|
|
101
|
-
}).onEnd(() => {
|
|
102
|
-
runOnJS(handleGestureEnd)();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Fruit slicing logic - moved from parent
|
|
106
|
-
const handleFruitSlice = fruitId => {
|
|
107
|
-
// Double-check game state to prevent race conditions
|
|
108
|
-
const currentState = useFruitNinjaStore.getState();
|
|
109
|
-
if (!currentState.isPlaying || currentState.gameOver) return;
|
|
110
|
-
const fruit = currentState.fruits.find(f => f.id === fruitId);
|
|
111
|
-
if (!fruit || fruit.isSliced) return;
|
|
112
|
-
|
|
113
|
-
// Handle different fruit types BEFORE marking as sliced
|
|
114
|
-
if (fruit.isBomb) {
|
|
115
|
-
playBombSound();
|
|
116
|
-
loseLife();
|
|
117
|
-
resetCombo();
|
|
118
|
-
// Create blast particles at bomb location
|
|
119
|
-
createBlastParticles(fruit);
|
|
120
|
-
updateFruit(fruitId, {
|
|
121
|
-
isSliced: true
|
|
122
|
-
});
|
|
123
|
-
} else {
|
|
124
|
-
// Handle different fruit types with simplified mechanics
|
|
125
|
-
playSliceSound();
|
|
126
|
-
if (fruit.isBonus) {
|
|
127
|
-
// Star fruit - add a life instead of points
|
|
128
|
-
addLife();
|
|
129
|
-
playSliceSound();
|
|
130
|
-
// Mark star as sliced after processing
|
|
131
|
-
updateFruit(fruitId, {
|
|
132
|
-
isSliced: true
|
|
133
|
-
});
|
|
134
|
-
} else if (fruit.isFreeze) {
|
|
135
|
-
// Freeze fruit - slice and mark (sliceFruit handles marking)
|
|
136
|
-
sliceFruit(fruitId);
|
|
137
|
-
} else {
|
|
138
|
-
// Regular fruit - add 10 points (sliceFruit handles marking)
|
|
139
|
-
sliceFruit(fruitId);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Create blast particles at fruit location
|
|
143
|
-
createBlastParticles(fruit);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Remove fruit after animation
|
|
147
|
-
setTimeout(() => {
|
|
148
|
-
removeFruit(fruitId);
|
|
149
|
-
fruitAnimations.delete(fruitId);
|
|
150
|
-
}, 500);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// Optimized collision detection with single point
|
|
154
|
-
const checkFruitCollisions = gesturePoint => {
|
|
155
|
-
const currentFruits = useFruitNinjaStore.getState().fruits;
|
|
156
|
-
currentFruits.forEach(fruit => {
|
|
157
|
-
if (!fruit.isSliced) {
|
|
158
|
-
// Simple distance-based collision detection
|
|
159
|
-
const fruitCenterX = fruit.position.x + GAME_CONFIG.FRUIT_SIZE / 2;
|
|
160
|
-
const fruitCenterY = fruit.position.y + GAME_CONFIG.FRUIT_SIZE / 2;
|
|
161
|
-
const fruitRadius = GAME_CONFIG.FRUIT_SIZE / 2;
|
|
162
|
-
|
|
163
|
-
// Check if gesture point is within fruit radius
|
|
164
|
-
const distance = Math.sqrt(Math.pow(gesturePoint.x - fruitCenterX, 2) + Math.pow(gesturePoint.y - fruitCenterY, 2));
|
|
165
|
-
if (distance <= fruitRadius) {
|
|
166
|
-
handleFruitSlice(fruit.id);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// Track fruit animations without shared values - moved from parent
|
|
173
|
-
useEffect(() => {
|
|
174
|
-
fruits.forEach(fruit => {
|
|
175
|
-
if (!fruitAnimations.has(fruit.id)) {
|
|
176
|
-
fruitAnimations.initialize(fruit.id);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
}, [fruits, fruitAnimations]);
|
|
180
|
-
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
181
|
-
gesture: panGesture,
|
|
182
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
183
|
-
style: styles.gameArea,
|
|
184
|
-
children: [fruits.map(fruit => {
|
|
185
|
-
const animation = fruitAnimations.get(fruit.id);
|
|
186
|
-
return /*#__PURE__*/_jsx(FruitComponent, {
|
|
187
|
-
fruit: fruit,
|
|
188
|
-
animation: animation,
|
|
189
|
-
onSlice: handleFruitSlice
|
|
190
|
-
}, fruit.id);
|
|
191
|
-
}), activeBlasts.map(blast => /*#__PURE__*/_jsx(ParticleBlast, {
|
|
192
|
-
x: blast.x,
|
|
193
|
-
y: blast.y,
|
|
194
|
-
particleCount: 8,
|
|
195
|
-
duration: 1000,
|
|
196
|
-
onComplete: () => handleBlastComplete(blast.id)
|
|
197
|
-
}, blast.id))]
|
|
198
|
-
})
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
const styles = StyleSheet.create({
|
|
202
|
-
gameArea: {
|
|
203
|
-
flex: 1,
|
|
204
|
-
position: 'relative',
|
|
205
|
-
overflow: 'hidden'
|
|
206
|
-
},
|
|
207
|
-
backgroundGradient: {
|
|
208
|
-
position: 'absolute',
|
|
209
|
-
top: 0,
|
|
210
|
-
left: 0,
|
|
211
|
-
right: 0,
|
|
212
|
-
bottom: 0
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
//# sourceMappingURL=GameArea.js.map
|
|
1
|
+
"use strict";import React,{useRef,useEffect,useState}from 'react';import{View,StyleSheet}from 'react-native';import{runOnJS}from 'react-native-reanimated';import{Gesture,GestureDetector}from 'react-native-gesture-handler';import{useFruitNinjaStore}from "../FruitNinjaStore.js";import{GAME_CONFIG}from "../FruitNinjaService.js";import{playSound,GAME_SOUNDS}from "../../../services/SoundsService.js";import{playHaptic,HapticType}from "../../../services/HapticsService.js";import{ParticleBlast,useAnimationTracker}from "../../../helpers/index.js";import{FruitComponent}from "./FruitComponent.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const GameArea = React.memo(()=>{const fruits = useFruitNinjaStore(state => state.fruits);const{sliceFruit,removeFruit,updateFruit,resetCombo,loseLife,addLife}= useFruitNinjaStore();const lastGesturePoint = useRef(null);const fruitAnimations = useAnimationTracker();const [activeBlasts,setActiveBlasts] = useState([]);const playSliceSound =()=>{playSound(GAME_SOUNDS.FRUIT_NINJA.SLICE,true);playHaptic(HapticType.LIGHT,true);};const playBombSound =()=>{playSound(GAME_SOUNDS.FRUIT_NINJA.BOMB,true);playHaptic(HapticType.HEAVY,true);};const createBlastParticles = fruit =>{const blastX = fruit.position.x + GAME_CONFIG.FRUIT_SIZE / 2;const blastY = fruit.position.y + GAME_CONFIG.FRUIT_SIZE / 2;const blastId = `blast_${Date.now()}_${Math.random()}`;setActiveBlasts(prev => [...prev,{id:blastId,x:blastX,y:blastY}]);};const handleBlastComplete = blastId =>{setActiveBlasts(prev => prev.filter(blast => blast.id !== blastId));};const handleGestureStart = event =>{const currentState = useFruitNinjaStore.getState();if(!currentState.isPlaying)return;lastGesturePoint.current ={x:event.x,y:event.y};playHaptic(HapticType.LIGHT,true);};const handleGestureUpdate = event =>{const currentState = useFruitNinjaStore.getState();if(!currentState.isPlaying)return;const currentPoint ={x:event.x,y:event.y};checkFruitCollisions(currentPoint);lastGesturePoint.current = currentPoint;};const handleGestureEnd =()=>{const currentState = useFruitNinjaStore.getState();if(!currentState.isPlaying)return;lastGesturePoint.current = null;};const panGesture = Gesture.Pan().onStart(event =>{runOnJS(handleGestureStart)(event);}).onUpdate(event =>{runOnJS(handleGestureUpdate)(event);}).onEnd(()=>{runOnJS(handleGestureEnd)();});const handleFruitSlice = fruitId =>{const currentState = useFruitNinjaStore.getState();if(!currentState.isPlaying || currentState.gameOver)return;const fruit = currentState.fruits.find(f => f.id === fruitId);if(!fruit || fruit.isSliced)return;if(fruit.isBomb){playBombSound();loseLife();resetCombo();createBlastParticles(fruit);updateFruit(fruitId,{isSliced:true});}else{playSliceSound();if(fruit.isBonus){addLife();playSliceSound();updateFruit(fruitId,{isSliced:true});}else if(fruit.isFreeze){sliceFruit(fruitId);}else{sliceFruit(fruitId);}createBlastParticles(fruit);}setTimeout(()=>{removeFruit(fruitId);fruitAnimations.delete(fruitId);},500);};const checkFruitCollisions = gesturePoint =>{const currentFruits = useFruitNinjaStore.getState().fruits;currentFruits.forEach(fruit =>{if(!fruit.isSliced){const fruitCenterX = fruit.position.x + GAME_CONFIG.FRUIT_SIZE / 2;const fruitCenterY = fruit.position.y + GAME_CONFIG.FRUIT_SIZE / 2;const fruitRadius = GAME_CONFIG.FRUIT_SIZE / 2;const distance = Math.sqrt(Math.pow(gesturePoint.x - fruitCenterX,2)+ Math.pow(gesturePoint.y - fruitCenterY,2));if(distance <= fruitRadius){handleFruitSlice(fruit.id);}}});};useEffect(()=>{fruits.forEach(fruit =>{if(!fruitAnimations.has(fruit.id)){fruitAnimations.initialize(fruit.id);}});},[fruits,fruitAnimations]);return _jsx(GestureDetector,{gesture:panGesture,children:_jsxs(View,{style:styles.gameArea,children:[fruits.map(fruit =>{const animation = fruitAnimations.get(fruit.id);return _jsx(FruitComponent,{fruit:fruit,animation:animation,onSlice:handleFruitSlice},fruit.id);}),activeBlasts.map(blast => _jsx(ParticleBlast,{x:blast.x,y:blast.y,particleCount:8,duration:1000,onComplete:()=> handleBlastComplete(blast.id)},blast.id))]})});});const styles = StyleSheet.create({gameArea:{flex:1,position:'relative',overflow:'hidden'},backgroundGradient:{position:'absolute',top:0,left:0,right:0,bottom:0}});
|