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,138 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { Dimensions } from 'react-native';
|
|
4
|
-
const {
|
|
5
|
-
width
|
|
6
|
-
} = Dimensions.get('window');
|
|
7
|
-
|
|
8
|
-
// Snake Game Constants
|
|
9
|
-
export const SNAKE_GAME_CONFIG = {
|
|
10
|
-
// Grid configuration
|
|
11
|
-
GRID_SIZE: 20,
|
|
12
|
-
// 20x20 grid
|
|
13
|
-
CELL_SIZE: Math.floor((width - 40) / 20),
|
|
14
|
-
// Calculate cell size based on screen width
|
|
15
|
-
|
|
16
|
-
// Game timing - Lower value = faster snake
|
|
17
|
-
GAME_SPEED: {
|
|
18
|
-
easy: 400,
|
|
19
|
-
// milliseconds per move - Slow
|
|
20
|
-
medium: 300,
|
|
21
|
-
// Medium speed
|
|
22
|
-
hard: 200 // Fast speed
|
|
23
|
-
},
|
|
24
|
-
// Scoring - multiplied by difficulty
|
|
25
|
-
POINTS_PER_FOOD: 10,
|
|
26
|
-
POINTS_PER_SPECIAL_FOOD: 25,
|
|
27
|
-
DIFFICULTY_MULTIPLIER: {
|
|
28
|
-
easy: 1,
|
|
29
|
-
medium: 2,
|
|
30
|
-
hard: 3
|
|
31
|
-
},
|
|
32
|
-
// Special food spawn chance
|
|
33
|
-
SPECIAL_FOOD_CHANCE: 0.15,
|
|
34
|
-
// 15% chance
|
|
35
|
-
SPECIAL_FOOD_DURATION: 5000,
|
|
36
|
-
// 5 seconds
|
|
37
|
-
|
|
38
|
-
// Initial snake length
|
|
39
|
-
INITIAL_SNAKE_LENGTH: 3
|
|
40
|
-
};
|
|
41
|
-
export const SNAKE_COLORS = {
|
|
42
|
-
// Background
|
|
43
|
-
BACKGROUND: '#252541',
|
|
44
|
-
GRID_LINE: 'rgba(255, 255, 255, 0.15)',
|
|
45
|
-
// Snake colors - vibrant gradient
|
|
46
|
-
SNAKE_HEAD: '#00ff88',
|
|
47
|
-
SNAKE_BODY: '#00cc6a',
|
|
48
|
-
SNAKE_TAIL: '#00994d',
|
|
49
|
-
SNAKE_OUTLINE: '#004d26',
|
|
50
|
-
// Food colors
|
|
51
|
-
FOOD_NORMAL: '#ff4757',
|
|
52
|
-
FOOD_SPECIAL: '#ffa502',
|
|
53
|
-
FOOD_GLOW: 'rgba(255, 71, 87, 0.5)',
|
|
54
|
-
// UI colors
|
|
55
|
-
SCORE_TEXT: '#ffffff',
|
|
56
|
-
SCORE_BACKGROUND: 'rgba(0, 255, 136, 0.2)',
|
|
57
|
-
BUTTON_PRIMARY: '#00cc6a',
|
|
58
|
-
BUTTON_SECONDARY: '#00994d',
|
|
59
|
-
MODAL_PRIMARY: 'rgba(0, 255, 136, 0.95)',
|
|
60
|
-
MODAL_BORDER: 'rgba(0, 204, 106, 0.9)',
|
|
61
|
-
MODAL_BUTTON: '#00ff88',
|
|
62
|
-
MODAL_BUTTON_BORDER: '#00cc6a',
|
|
63
|
-
// Game over
|
|
64
|
-
COLLISION_COLOR: '#ff4757'
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Direction constants
|
|
68
|
-
export const DIRECTIONS = {
|
|
69
|
-
UP: {
|
|
70
|
-
x: 0,
|
|
71
|
-
y: -1
|
|
72
|
-
},
|
|
73
|
-
DOWN: {
|
|
74
|
-
x: 0,
|
|
75
|
-
y: 1
|
|
76
|
-
},
|
|
77
|
-
LEFT: {
|
|
78
|
-
x: -1,
|
|
79
|
-
y: 0
|
|
80
|
-
},
|
|
81
|
-
RIGHT: {
|
|
82
|
-
x: 1,
|
|
83
|
-
y: 0
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
// Snake Game Theme - Green/Neon theme
|
|
87
|
-
export const SNAKE_THEME = {
|
|
88
|
-
backgroundColor: '#1a1a2e',
|
|
89
|
-
headerBackgroundColor: '#00ff88',
|
|
90
|
-
headerTextColor: '#1a1a2e',
|
|
91
|
-
sectionBackgroundColor: 'rgba(0, 255, 136, 0.15)',
|
|
92
|
-
sectionTitleColor: '#00ff88',
|
|
93
|
-
buttonSelectedColor: '#00ff88',
|
|
94
|
-
buttonUnselectedColor: 'rgba(0, 255, 136, 0.2)',
|
|
95
|
-
buttonSelectedTextColor: '#1a1a2e',
|
|
96
|
-
buttonUnselectedTextColor: '#00ff88',
|
|
97
|
-
switchTrackColorFalse: 'rgba(0, 255, 136, 0.3)',
|
|
98
|
-
switchTrackColorTrue: '#00ff88',
|
|
99
|
-
switchThumbColor: '#ffffff',
|
|
100
|
-
infoTextColor: 'rgba(255, 255, 255, 0.7)'
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// Snake Difficulty Descriptions
|
|
104
|
-
export const SNAKE_DIFFICULTY_DESCRIPTIONS = {
|
|
105
|
-
easy: 'Slow speed • 1x points • Perfect for beginners',
|
|
106
|
-
medium: 'Medium speed • 2x points • Balanced challenge',
|
|
107
|
-
hard: 'Fast speed • 3x points • Expert level'
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// Snake sounds
|
|
111
|
-
export const SNAKE_SOUNDS = {
|
|
112
|
-
EAT: {
|
|
113
|
-
text: 'Nom!',
|
|
114
|
-
pitch: 1.2,
|
|
115
|
-
rate: 1.5
|
|
116
|
-
},
|
|
117
|
-
SPECIAL: {
|
|
118
|
-
text: 'Bonus!',
|
|
119
|
-
pitch: 1.5,
|
|
120
|
-
rate: 2.0
|
|
121
|
-
},
|
|
122
|
-
COLLISION: {
|
|
123
|
-
text: 'Ouch!',
|
|
124
|
-
pitch: 0.8,
|
|
125
|
-
rate: 1.2
|
|
126
|
-
},
|
|
127
|
-
WIN: {
|
|
128
|
-
text: 'Victory!',
|
|
129
|
-
pitch: 1.6,
|
|
130
|
-
rate: 1.8
|
|
131
|
-
},
|
|
132
|
-
LOSE: {
|
|
133
|
-
text: 'Game Over',
|
|
134
|
-
pitch: 0.8,
|
|
135
|
-
rate: 1.2
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=SnakeConstants.js.map
|
|
1
|
+
"use strict";import{Dimensions}from 'react-native';const{width}= Dimensions.get('window');export const SNAKE_GAME_CONFIG ={GRID_SIZE:20,CELL_SIZE:Math.floor((width - 40)/ 20),GAME_SPEED:{easy:400,medium:300,hard:200},POINTS_PER_FOOD:10,POINTS_PER_SPECIAL_FOOD:25,DIFFICULTY_MULTIPLIER:{easy:1,medium:2,hard:3},SPECIAL_FOOD_CHANCE:0.15,SPECIAL_FOOD_DURATION:5000,INITIAL_SNAKE_LENGTH:3};export const SNAKE_COLORS ={BACKGROUND:'#252541',GRID_LINE:'rgba(255,255,255,0.15)',SNAKE_HEAD:'#00ff88',SNAKE_BODY:'#00cc6a',SNAKE_TAIL:'#00994d',SNAKE_OUTLINE:'#004d26',FOOD_NORMAL:'#ff4757',FOOD_SPECIAL:'#ffa502',FOOD_GLOW:'rgba(255,71,87,0.5)',SCORE_TEXT:'#ffffff',SCORE_BACKGROUND:'rgba(0,255,136,0.2)',BUTTON_PRIMARY:'#00cc6a',BUTTON_SECONDARY:'#00994d',MODAL_PRIMARY:'rgba(0,255,136,0.95)',MODAL_BORDER:'rgba(0,204,106,0.9)',MODAL_BUTTON:'#00ff88',MODAL_BUTTON_BORDER:'#00cc6a',COLLISION_COLOR:'#ff4757'};export const DIRECTIONS ={UP:{x:0,y:-1},DOWN:{x:0,y:1},LEFT:{x:-1,y:0},RIGHT:{x:1,y:0}};export const SNAKE_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#00cc6a',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(0,204,106,0.15)',sectionTitleColor:'#00cc6a',buttonSelectedColor:'#00cc6a',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(0,204,106,0.3)',switchTrackColorTrue:'#00cc6a',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const SNAKE_DIFFICULTY_DESCRIPTIONS ={easy:'Slow speed • 1x points • Perfect for beginners',medium:'Medium speed • 2x points • Balanced challenge',hard:'Fast speed • 3x points • Expert level'};export const SNAKE_SOUNDS ={EAT:{text:'Nom!',pitch:1.2,rate:1.5},SPECIAL:{text:'Bonus!',pitch:1.5,rate:2.0},COLLISION:{text:'Ouch!',pitch:0.8,rate:1.2},WIN:{text:'Victory!',pitch:1.6,rate:1.8},LOSE:{text:'Game Over',pitch:0.8,rate:1.2}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Dimensions","width","get","SNAKE_GAME_CONFIG","GRID_SIZE","CELL_SIZE","Math","floor","GAME_SPEED","easy","medium","hard","POINTS_PER_FOOD","POINTS_PER_SPECIAL_FOOD","DIFFICULTY_MULTIPLIER","SPECIAL_FOOD_CHANCE","SPECIAL_FOOD_DURATION","INITIAL_SNAKE_LENGTH","SNAKE_COLORS","BACKGROUND","GRID_LINE","SNAKE_HEAD","SNAKE_BODY","SNAKE_TAIL","SNAKE_OUTLINE","FOOD_NORMAL","FOOD_SPECIAL","FOOD_GLOW","SCORE_TEXT","SCORE_BACKGROUND","BUTTON_PRIMARY","BUTTON_SECONDARY","MODAL_PRIMARY","MODAL_BORDER","MODAL_BUTTON","MODAL_BUTTON_BORDER","COLLISION_COLOR","DIRECTIONS","UP","x","y","DOWN","LEFT","RIGHT","SNAKE_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","SNAKE_DIFFICULTY_DESCRIPTIONS","SNAKE_SOUNDS","EAT","text","pitch","rate","SPECIAL","COLLISION","WIN","LOSE"],"sourceRoot":"../../../../src","sources":["games/snake/SnakeConstants.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAGzC,MAAM;EAAEC;AAAM,CAAC,GAAGD,UAAU,CAACE,GAAG,CAAC,QAAQ,CAAC;;AAE1C;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAC/B;EACAC,SAAS,EAAE,EAAE;EAAE;EACfC,SAAS,EAAEC,IAAI,CAACC,KAAK,CAAC,CAACN,KAAK,GAAG,EAAE,IAAI,EAAE,CAAC;EAAE;;EAE1C;EACAO,UAAU,E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AAE,CAAC;IAAEC,CAAC,EAAE;EAAE;AACtB,CAAU;AAIV;AACA,OAAO,MAAMI,WAA8B,GAAG;EAC5CC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"names":["Dimensions","width","get","SNAKE_GAME_CONFIG","GRID_SIZE","CELL_SIZE","Math","floor","GAME_SPEED","easy","medium","hard","POINTS_PER_FOOD","POINTS_PER_SPECIAL_FOOD","DIFFICULTY_MULTIPLIER","SPECIAL_FOOD_CHANCE","SPECIAL_FOOD_DURATION","INITIAL_SNAKE_LENGTH","SNAKE_COLORS","BACKGROUND","GRID_LINE","SNAKE_HEAD","SNAKE_BODY","SNAKE_TAIL","SNAKE_OUTLINE","FOOD_NORMAL","FOOD_SPECIAL","FOOD_GLOW","SCORE_TEXT","SCORE_BACKGROUND","BUTTON_PRIMARY","BUTTON_SECONDARY","MODAL_PRIMARY","MODAL_BORDER","MODAL_BUTTON","MODAL_BUTTON_BORDER","COLLISION_COLOR","DIRECTIONS","UP","x","y","DOWN","LEFT","RIGHT","SNAKE_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","SNAKE_DIFFICULTY_DESCRIPTIONS","SNAKE_SOUNDS","EAT","text","pitch","rate","SPECIAL","COLLISION","WIN","LOSE"],"sourceRoot":"../../../../src","sources":["games/snake/SnakeConstants.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAGzC,MAAM;EAAEC;AAAM,CAAC,GAAGD,UAAU,CAACE,GAAG,CAAC,QAAQ,CAAC;;AAE1C;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAC/B;EACAC,SAAS,EAAE,EAAE;EAAE;EACfC,SAAS,EAAEC,IAAI,CAACC,KAAK,CAAC,CAACN,KAAK,GAAG,EAAE,IAAI,EAAE,CAAC;EAAE;;EAE1C;EACAO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,148 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { SNAKE_GAME_CONFIG, DIRECTIONS } from "./SnakeConstants.js";
|
|
4
|
-
export class SnakeService {
|
|
5
|
-
nextId = 1;
|
|
6
|
-
|
|
7
|
-
// Initialize snake at center of grid
|
|
8
|
-
initializeSnake() {
|
|
9
|
-
const centerX = Math.floor(SNAKE_GAME_CONFIG.GRID_SIZE / 2);
|
|
10
|
-
const centerY = Math.floor(SNAKE_GAME_CONFIG.GRID_SIZE / 2);
|
|
11
|
-
const snake = [];
|
|
12
|
-
for (let i = 0; i < SNAKE_GAME_CONFIG.INITIAL_SNAKE_LENGTH; i++) {
|
|
13
|
-
snake.push({
|
|
14
|
-
id: this.nextId++,
|
|
15
|
-
x: centerX - i,
|
|
16
|
-
y: centerY
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return snake;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Generate random food position (not on snake)
|
|
23
|
-
generateFood(snake, isSpecial = false) {
|
|
24
|
-
let position;
|
|
25
|
-
let attempts = 0;
|
|
26
|
-
const maxAttempts = 100;
|
|
27
|
-
do {
|
|
28
|
-
position = {
|
|
29
|
-
x: Math.floor(Math.random() * SNAKE_GAME_CONFIG.GRID_SIZE),
|
|
30
|
-
y: Math.floor(Math.random() * SNAKE_GAME_CONFIG.GRID_SIZE)
|
|
31
|
-
};
|
|
32
|
-
attempts++;
|
|
33
|
-
} while (attempts < maxAttempts && this.isPositionOnSnake(position, snake));
|
|
34
|
-
const food = {
|
|
35
|
-
id: this.nextId++,
|
|
36
|
-
x: position.x,
|
|
37
|
-
y: position.y,
|
|
38
|
-
isSpecial
|
|
39
|
-
};
|
|
40
|
-
if (isSpecial) {
|
|
41
|
-
food.expiresAt = Date.now() + SNAKE_GAME_CONFIG.SPECIAL_FOOD_DURATION;
|
|
42
|
-
}
|
|
43
|
-
return food;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Check if position is on snake
|
|
47
|
-
isPositionOnSnake(position, snake) {
|
|
48
|
-
return snake.some(segment => segment.x === position.x && segment.y === position.y);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Move snake in direction
|
|
52
|
-
moveSnake(snake, direction) {
|
|
53
|
-
const head = snake[0];
|
|
54
|
-
if (!head) return snake;
|
|
55
|
-
const directionVector = DIRECTIONS[direction];
|
|
56
|
-
const newHead = {
|
|
57
|
-
id: this.nextId++,
|
|
58
|
-
x: head.x + directionVector.x,
|
|
59
|
-
y: head.y + directionVector.y
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
// Add new head
|
|
63
|
-
const newSnake = [newHead, ...snake];
|
|
64
|
-
// Remove tail (will be added back if food is eaten)
|
|
65
|
-
newSnake.pop();
|
|
66
|
-
return newSnake;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Check collision with walls
|
|
70
|
-
checkWallCollision(head) {
|
|
71
|
-
return head.x < 0 || head.x >= SNAKE_GAME_CONFIG.GRID_SIZE || head.y < 0 || head.y >= SNAKE_GAME_CONFIG.GRID_SIZE;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Check collision with self
|
|
75
|
-
checkSelfCollision(snake) {
|
|
76
|
-
const head = snake[0];
|
|
77
|
-
if (!head) return false;
|
|
78
|
-
|
|
79
|
-
// Check if head collides with any body segment (skip head itself)
|
|
80
|
-
for (let i = 1; i < snake.length; i++) {
|
|
81
|
-
const segment = snake[i];
|
|
82
|
-
if (segment && head.x === segment.x && head.y === segment.y) {
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Check if snake ate food
|
|
90
|
-
checkFoodCollision(head, food) {
|
|
91
|
-
return head.x === food.x && head.y === food.y;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Grow snake (add segment at tail)
|
|
95
|
-
growSnake(snake) {
|
|
96
|
-
const tail = snake[snake.length - 1];
|
|
97
|
-
if (!tail) return snake;
|
|
98
|
-
|
|
99
|
-
// Add new segment at tail position
|
|
100
|
-
const newSegment = {
|
|
101
|
-
id: this.nextId++,
|
|
102
|
-
x: tail.x,
|
|
103
|
-
y: tail.y
|
|
104
|
-
};
|
|
105
|
-
return [...snake, newSegment];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Check if direction change is valid (can't reverse)
|
|
109
|
-
isValidDirectionChange(currentDirection, newDirection) {
|
|
110
|
-
const opposites = {
|
|
111
|
-
UP: 'DOWN',
|
|
112
|
-
DOWN: 'UP',
|
|
113
|
-
LEFT: 'RIGHT',
|
|
114
|
-
RIGHT: 'LEFT'
|
|
115
|
-
};
|
|
116
|
-
return opposites[currentDirection] !== newDirection;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Get opposite direction
|
|
120
|
-
getOppositeDirection(direction) {
|
|
121
|
-
const opposites = {
|
|
122
|
-
UP: 'DOWN',
|
|
123
|
-
DOWN: 'UP',
|
|
124
|
-
LEFT: 'RIGHT',
|
|
125
|
-
RIGHT: 'LEFT'
|
|
126
|
-
};
|
|
127
|
-
return opposites[direction];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Reset ID counter
|
|
131
|
-
resetIdCounter() {
|
|
132
|
-
this.nextId = 1;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Check if special food has expired
|
|
136
|
-
isSpecialFoodExpired(food) {
|
|
137
|
-
if (!food.isSpecial || !food.expiresAt) return false;
|
|
138
|
-
return Date.now() > food.expiresAt;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Calculate score based on food type and difficulty
|
|
142
|
-
calculateScore(isSpecialFood, difficulty) {
|
|
143
|
-
const baseScore = isSpecialFood ? SNAKE_GAME_CONFIG.POINTS_PER_SPECIAL_FOOD : SNAKE_GAME_CONFIG.POINTS_PER_FOOD;
|
|
144
|
-
const difficultyMultiplier = SNAKE_GAME_CONFIG.DIFFICULTY_MULTIPLIER[difficulty];
|
|
145
|
-
return baseScore * difficultyMultiplier;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
//# sourceMappingURL=SnakeService.js.map
|
|
1
|
+
"use strict";import{SNAKE_GAME_CONFIG,DIRECTIONS}from "./SnakeConstants.js";export class SnakeService{nextId = 1;initializeSnake(){const centerX = Math.floor(SNAKE_GAME_CONFIG.GRID_SIZE / 2);const centerY = Math.floor(SNAKE_GAME_CONFIG.GRID_SIZE / 2);const snake = [];for(let i = 0;i < SNAKE_GAME_CONFIG.INITIAL_SNAKE_LENGTH;i++){snake.push({id:this.nextId++,x:centerX - i,y:centerY});}return snake;}generateFood(snake,isSpecial = false){let position;let attempts = 0;const maxAttempts = 100;do{position ={x:Math.floor(Math.random()* SNAKE_GAME_CONFIG.GRID_SIZE),y:Math.floor(Math.random()* SNAKE_GAME_CONFIG.GRID_SIZE)};attempts++;}while(attempts < maxAttempts && this.isPositionOnSnake(position,snake));const food ={id:this.nextId++,x:position.x,y:position.y,isSpecial};if(isSpecial){food.expiresAt = Date.now()+ SNAKE_GAME_CONFIG.SPECIAL_FOOD_DURATION;}return food;}isPositionOnSnake(position,snake){return snake.some(segment => segment.x === position.x && segment.y === position.y);}moveSnake(snake,direction){const head = snake[0];if(!head)return snake;const directionVector = DIRECTIONS[direction];const newHead ={id:this.nextId++,x:head.x + directionVector.x,y:head.y + directionVector.y};const newSnake = [newHead,...snake];newSnake.pop();return newSnake;}checkWallCollision(head){return head.x < 0 || head.x >= SNAKE_GAME_CONFIG.GRID_SIZE || head.y < 0 || head.y >= SNAKE_GAME_CONFIG.GRID_SIZE;}checkSelfCollision(snake){const head = snake[0];if(!head)return false;for(let i = 1;i < snake.length;i++){const segment = snake[i];if(segment && head.x === segment.x && head.y === segment.y){return true;}}return false;}checkFoodCollision(head,food){return head.x === food.x && head.y === food.y;}growSnake(snake){const tail = snake[snake.length - 1];if(!tail)return snake;const newSegment ={id:this.nextId++,x:tail.x,y:tail.y};return [...snake,newSegment];}isValidDirectionChange(currentDirection,newDirection){const opposites ={UP:'DOWN',DOWN:'UP',LEFT:'RIGHT',RIGHT:'LEFT'};return opposites[currentDirection] !== newDirection;}getOppositeDirection(direction){const opposites ={UP:'DOWN',DOWN:'UP',LEFT:'RIGHT',RIGHT:'LEFT'};return opposites[direction];}resetIdCounter(){this.nextId = 1;}isSpecialFoodExpired(food){if(!food.isSpecial || !food.expiresAt)return false;return Date.now()> food.expiresAt;}calculateScore(isSpecialFood,difficulty){const baseScore = isSpecialFood ? SNAKE_GAME_CONFIG.POINTS_PER_SPECIAL_FOOD:SNAKE_GAME_CONFIG.POINTS_PER_FOOD;const difficultyMultiplier = SNAKE_GAME_CONFIG.DIFFICULTY_MULTIPLIER[difficulty];return baseScore * difficultyMultiplier;}}
|
|
@@ -1,182 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { create } from 'zustand';
|
|
4
|
-
import { subscribeWithSelector } from 'zustand/middleware';
|
|
5
|
-
import { immerMiddleware } from "../../services/UtilsService.js";
|
|
6
|
-
import { SnakeService } from "./SnakeService.js";
|
|
7
|
-
import { SNAKE_GAME_CONFIG, SNAKE_SOUNDS } from "./SnakeConstants.js";
|
|
8
|
-
import { playSound } from "../../services/SoundsService.js";
|
|
9
|
-
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
10
|
-
const gameService = new SnakeService();
|
|
11
|
-
export const useSnakeStore = create()(subscribeWithSelector(immerMiddleware((set, get) => ({
|
|
12
|
-
// Initial state
|
|
13
|
-
snake: gameService.initializeSnake(),
|
|
14
|
-
food: null,
|
|
15
|
-
direction: 'RIGHT',
|
|
16
|
-
nextDirection: 'RIGHT',
|
|
17
|
-
score: 0,
|
|
18
|
-
isPlaying: false,
|
|
19
|
-
isGameOver: false,
|
|
20
|
-
isPaused: false,
|
|
21
|
-
difficulty: 'easy',
|
|
22
|
-
enableSounds: true,
|
|
23
|
-
enableHaptics: true,
|
|
24
|
-
moveTimer: null,
|
|
25
|
-
startGame: () => {
|
|
26
|
-
const state = get();
|
|
27
|
-
|
|
28
|
-
// Clear any existing timers
|
|
29
|
-
if (state.moveTimer) clearInterval(state.moveTimer);
|
|
30
|
-
|
|
31
|
-
// Generate initial food
|
|
32
|
-
const initialFood = gameService.generateFood(state.snake, false);
|
|
33
|
-
|
|
34
|
-
// Start game loop
|
|
35
|
-
const gameSpeed = SNAKE_GAME_CONFIG.GAME_SPEED[state.difficulty];
|
|
36
|
-
const moveTimer = setInterval(() => {
|
|
37
|
-
const currentState = get();
|
|
38
|
-
if (currentState.isPlaying && !currentState.isPaused) {
|
|
39
|
-
currentState.gameLoop();
|
|
40
|
-
}
|
|
41
|
-
}, gameSpeed);
|
|
42
|
-
set(state => {
|
|
43
|
-
state.isPlaying = true;
|
|
44
|
-
state.isPaused = false;
|
|
45
|
-
state.food = initialFood;
|
|
46
|
-
state.moveTimer = moveTimer;
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
stopGame: () => {
|
|
50
|
-
const state = get();
|
|
51
|
-
if (state.moveTimer) clearInterval(state.moveTimer);
|
|
52
|
-
playSound(SNAKE_SOUNDS.LOSE, state.enableSounds);
|
|
53
|
-
playHaptic(HapticType.MEDIUM, state.enableHaptics);
|
|
54
|
-
|
|
55
|
-
// Reset the game instead of showing game over modal
|
|
56
|
-
state.initializeGame(state.difficulty);
|
|
57
|
-
},
|
|
58
|
-
pauseGame: () => {
|
|
59
|
-
set(state => {
|
|
60
|
-
state.isPaused = true;
|
|
61
|
-
});
|
|
62
|
-
},
|
|
63
|
-
resumeGame: () => {
|
|
64
|
-
set(state => {
|
|
65
|
-
state.isPaused = false;
|
|
66
|
-
});
|
|
67
|
-
},
|
|
68
|
-
resetGame: () => {
|
|
69
|
-
const state = get();
|
|
70
|
-
state.initializeGame(state.difficulty);
|
|
71
|
-
},
|
|
72
|
-
initializeGame: (difficulty = 'easy') => {
|
|
73
|
-
const state = get();
|
|
74
|
-
if (state.moveTimer) clearInterval(state.moveTimer);
|
|
75
|
-
gameService.resetIdCounter();
|
|
76
|
-
const newSnake = gameService.initializeSnake();
|
|
77
|
-
set(state => {
|
|
78
|
-
state.snake = newSnake;
|
|
79
|
-
state.food = null;
|
|
80
|
-
state.direction = 'RIGHT';
|
|
81
|
-
state.nextDirection = 'RIGHT';
|
|
82
|
-
state.score = 0;
|
|
83
|
-
state.isPlaying = false;
|
|
84
|
-
state.isGameOver = false;
|
|
85
|
-
state.isPaused = false;
|
|
86
|
-
state.difficulty = difficulty;
|
|
87
|
-
state.moveTimer = null;
|
|
88
|
-
});
|
|
89
|
-
},
|
|
90
|
-
changeDirection: newDirection => {
|
|
91
|
-
const state = get();
|
|
92
|
-
if (!state.isPlaying || state.isPaused) return;
|
|
93
|
-
|
|
94
|
-
// Check if direction change is valid (can't reverse)
|
|
95
|
-
if (gameService.isValidDirectionChange(state.direction, newDirection)) {
|
|
96
|
-
set(state => {
|
|
97
|
-
state.nextDirection = newDirection;
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
gameLoop: () => {
|
|
102
|
-
const state = get();
|
|
103
|
-
if (!state.isPlaying || state.isPaused || state.isGameOver) return;
|
|
104
|
-
set(draft => {
|
|
105
|
-
// Update direction
|
|
106
|
-
draft.direction = draft.nextDirection;
|
|
107
|
-
|
|
108
|
-
// Move snake
|
|
109
|
-
const newSnake = gameService.moveSnake(draft.snake, draft.direction);
|
|
110
|
-
const head = newSnake[0];
|
|
111
|
-
if (!head) return;
|
|
112
|
-
|
|
113
|
-
// Check wall collision
|
|
114
|
-
if (gameService.checkWallCollision(head)) {
|
|
115
|
-
draft.isGameOver = true;
|
|
116
|
-
draft.isPlaying = false;
|
|
117
|
-
if (draft.moveTimer) {
|
|
118
|
-
clearInterval(draft.moveTimer);
|
|
119
|
-
draft.moveTimer = null;
|
|
120
|
-
}
|
|
121
|
-
playSound(SNAKE_SOUNDS.COLLISION, draft.enableSounds);
|
|
122
|
-
playHaptic(HapticType.HEAVY, draft.enableHaptics);
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Check self collision
|
|
127
|
-
if (gameService.checkSelfCollision(newSnake)) {
|
|
128
|
-
draft.isGameOver = true;
|
|
129
|
-
draft.isPlaying = false;
|
|
130
|
-
if (draft.moveTimer) {
|
|
131
|
-
clearInterval(draft.moveTimer);
|
|
132
|
-
draft.moveTimer = null;
|
|
133
|
-
}
|
|
134
|
-
playSound(SNAKE_SOUNDS.COLLISION, draft.enableSounds);
|
|
135
|
-
playHaptic(HapticType.HEAVY, draft.enableHaptics);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Check food collision
|
|
140
|
-
if (draft.food && gameService.checkFoodCollision(head, draft.food)) {
|
|
141
|
-
// Grow snake
|
|
142
|
-
const grownSnake = gameService.growSnake(newSnake);
|
|
143
|
-
draft.snake = grownSnake;
|
|
144
|
-
|
|
145
|
-
// Update score with difficulty multiplier
|
|
146
|
-
const points = gameService.calculateScore(draft.food.isSpecial, draft.difficulty);
|
|
147
|
-
draft.score += points;
|
|
148
|
-
|
|
149
|
-
// Play sound
|
|
150
|
-
const sound = draft.food.isSpecial ? SNAKE_SOUNDS.SPECIAL : SNAKE_SOUNDS.EAT;
|
|
151
|
-
playSound(sound, draft.enableSounds);
|
|
152
|
-
playHaptic(draft.food.isSpecial ? HapticType.HEAVY : HapticType.MEDIUM, draft.enableHaptics);
|
|
153
|
-
|
|
154
|
-
// Generate new food
|
|
155
|
-
const isSpecial = Math.random() < SNAKE_GAME_CONFIG.SPECIAL_FOOD_CHANCE;
|
|
156
|
-
draft.food = gameService.generateFood(grownSnake, isSpecial);
|
|
157
|
-
} else {
|
|
158
|
-
draft.snake = newSnake;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Check if special food expired
|
|
162
|
-
if (draft.food && gameService.isSpecialFoodExpired(draft.food)) {
|
|
163
|
-
draft.food = gameService.generateFood(draft.snake, false);
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
updateSettings: (enableSounds, enableHaptics) => {
|
|
168
|
-
set(state => {
|
|
169
|
-
state.enableSounds = enableSounds;
|
|
170
|
-
state.enableHaptics = enableHaptics;
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
}))));
|
|
174
|
-
|
|
175
|
-
// Selector hooks for optimal re-renders
|
|
176
|
-
export const useSnake = () => useSnakeStore(state => state.snake);
|
|
177
|
-
export const useFood = () => useSnakeStore(state => state.food);
|
|
178
|
-
export const useScore = () => useSnakeStore(state => state.score);
|
|
179
|
-
export const useIsPlaying = () => useSnakeStore(state => state.isPlaying);
|
|
180
|
-
export const useIsGameOver = () => useSnakeStore(state => state.isGameOver);
|
|
181
|
-
export const useIsPaused = () => useSnakeStore(state => state.isPaused);
|
|
182
|
-
//# sourceMappingURL=SnakeStore.js.map
|
|
1
|
+
"use strict";import{create}from 'zustand';import{subscribeWithSelector}from 'zustand/middleware';import{immerMiddleware}from "../../services/UtilsService.js";import{SnakeService}from "./SnakeService.js";import{SNAKE_GAME_CONFIG,SNAKE_SOUNDS}from "./SnakeConstants.js";import{playSound}from "../../services/SoundsService.js";import{playHaptic,HapticType}from "../../services/HapticsService.js";const gameService = new SnakeService();export const useSnakeStore = create()(subscribeWithSelector(immerMiddleware((set,get)=>({snake:gameService.initializeSnake(),food:null,direction:'RIGHT',nextDirection:'RIGHT',score:0,timeLeft:300,isPlaying:false,isGameOver:false,isPaused:false,difficulty:'easy',enableSounds:true,enableHaptics:true,moveTimer:null,countdownTimer:null,startGame:()=>{const state = get();if(state.moveTimer)clearInterval(state.moveTimer);if(state.countdownTimer)clearInterval(state.countdownTimer);const initialFood = gameService.generateFood(state.snake,false);const gameSpeed = SNAKE_GAME_CONFIG.GAME_SPEED[state.difficulty];const moveTimer = setInterval(()=>{const currentState = get();if(currentState.isPlaying && !currentState.isPaused){currentState.gameLoop();}},gameSpeed);const countdownTimer = setInterval(()=>{const currentState = get();if(currentState.isPlaying && !currentState.isPaused){currentState.decrementTime();}},1000);set(state =>{state.isPlaying = true;state.isPaused = false;state.food = initialFood;state.moveTimer = moveTimer;state.countdownTimer = countdownTimer;});},stopGame:()=>{const state = get();if(state.moveTimer)clearInterval(state.moveTimer);if(state.countdownTimer)clearInterval(state.countdownTimer);playSound(SNAKE_SOUNDS.LOSE,state.enableSounds);playHaptic(HapticType.MEDIUM,state.enableHaptics);state.initializeGame(state.difficulty);},pauseGame:()=>{set(state =>{state.isPaused = true;});},resumeGame:()=>{set(state =>{state.isPaused = false;});},resetGame:()=>{const state = get();state.initializeGame(state.difficulty);},initializeGame:(difficulty = 'easy')=>{const state = get();if(state.moveTimer)clearInterval(state.moveTimer);if(state.countdownTimer)clearInterval(state.countdownTimer);gameService.resetIdCounter();const newSnake = gameService.initializeSnake();const timeLimit = difficulty === 'easy' ? 300:600;set(state =>{state.snake = newSnake;state.food = null;state.direction = 'RIGHT';state.nextDirection = 'RIGHT';state.score = 0;state.timeLeft = timeLimit;state.isPlaying = false;state.isGameOver = false;state.isPaused = false;state.difficulty = difficulty;state.moveTimer = null;state.countdownTimer = null;});},changeDirection:newDirection =>{const state = get();if(!state.isPlaying || state.isPaused)return;if(gameService.isValidDirectionChange(state.direction,newDirection)){set(state =>{state.nextDirection = newDirection;});}},gameLoop:()=>{const state = get();if(!state.isPlaying || state.isPaused || state.isGameOver)return;set(draft =>{draft.direction = draft.nextDirection;const newSnake = gameService.moveSnake(draft.snake,draft.direction);const head = newSnake[0];if(!head)return;if(gameService.checkWallCollision(head)){draft.isGameOver = true;draft.isPlaying = false;if(draft.moveTimer){clearInterval(draft.moveTimer);draft.moveTimer = null;}if(draft.countdownTimer){clearInterval(draft.countdownTimer);draft.countdownTimer = null;}playSound(SNAKE_SOUNDS.COLLISION,draft.enableSounds);playHaptic(HapticType.HEAVY,draft.enableHaptics);return;}if(gameService.checkSelfCollision(newSnake)){draft.isGameOver = true;draft.isPlaying = false;if(draft.moveTimer){clearInterval(draft.moveTimer);draft.moveTimer = null;}if(draft.countdownTimer){clearInterval(draft.countdownTimer);draft.countdownTimer = null;}playSound(SNAKE_SOUNDS.COLLISION,draft.enableSounds);playHaptic(HapticType.HEAVY,draft.enableHaptics);return;}if(draft.food && gameService.checkFoodCollision(head,draft.food)){const grownSnake = gameService.growSnake(newSnake);draft.snake = grownSnake;const points = gameService.calculateScore(draft.food.isSpecial,draft.difficulty);draft.score += points;const sound = draft.food.isSpecial ? SNAKE_SOUNDS.SPECIAL:SNAKE_SOUNDS.EAT;playSound(sound,draft.enableSounds);playHaptic(draft.food.isSpecial ? HapticType.HEAVY:HapticType.MEDIUM,draft.enableHaptics);const isSpecial = Math.random()< SNAKE_GAME_CONFIG.SPECIAL_FOOD_CHANCE;draft.food = gameService.generateFood(grownSnake,isSpecial);}else{draft.snake = newSnake;}if(draft.food && gameService.isSpecialFoodExpired(draft.food)){draft.food = gameService.generateFood(draft.snake,false);}});},updateSettings:(enableSounds,enableHaptics)=>{set(state =>{state.enableSounds = enableSounds;state.enableHaptics = enableHaptics;});},decrementTime:()=>{set(state =>{if(state.timeLeft > 0){state.timeLeft--;}else{state.isGameOver = true;state.isPlaying = false;if(state.moveTimer){clearInterval(state.moveTimer);state.moveTimer = null;}if(state.countdownTimer){clearInterval(state.countdownTimer);state.countdownTimer = null;}}});}}))));export const useSnake =()=> useSnakeStore(state => state.snake);export const useFood =()=> useSnakeStore(state => state.food);export const useScore =()=> useSnakeStore(state => state.score);export const useTimeLeft =()=> useSnakeStore(state => state.timeLeft);export const useIsPlaying =()=> useSnakeStore(state => state.isPlaying);export const useIsGameOver =()=> useSnakeStore(state => state.isGameOver);export const useIsPaused =()=> useSnakeStore(state => state.isPaused);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["create","subscribeWithSelector","immerMiddleware","SnakeService","SNAKE_GAME_CONFIG","SNAKE_SOUNDS","playSound","playHaptic","HapticType","gameService","useSnakeStore","set","get","snake","initializeSnake","food","direction","nextDirection","score","isPlaying","isGameOver","isPaused","difficulty","enableSounds","enableHaptics","moveTimer","startGame","state","clearInterval","initialFood","generateFood","gameSpeed","GAME_SPEED","setInterval","currentState","gameLoop","stopGame","LOSE","MEDIUM","initializeGame","pauseGame","resumeGame","resetGame","resetIdCounter","newSnake","changeDirection","newDirection","isValidDirectionChange","draft","moveSnake","head","checkWallCollision","COLLISION","HEAVY","checkSelfCollision","checkFoodCollision","grownSnake","growSnake","points","calculateScore","isSpecial","sound","SPECIAL","EAT","Math","random","SPECIAL_FOOD_CHANCE","isSpecialFoodExpired","updateSettings","useSnake","useFood","useScore","useIsPlaying","useIsGameOver","useIsPaused"],"sourceRoot":"../../../../src","sources":["games/snake/SnakeStore.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,eAAe,QAAQ,gCAA6B;AAC7D,SAASC,YAAY,QAAsC,mBAAgB;AAC3E,SAASC,iBAAiB,EAAEC,YAAY,QAAwB,qBAAkB;AAClF,SAASC,SAAS,QAAQ,iCAA8B;AACxD,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;
|
|
1
|
+
{"version":3,"names":["create","subscribeWithSelector","immerMiddleware","SnakeService","SNAKE_GAME_CONFIG","SNAKE_SOUNDS","playSound","playHaptic","HapticType","gameService","useSnakeStore","set","get","snake","initializeSnake","food","direction","nextDirection","score","timeLeft","isPlaying","isGameOver","isPaused","difficulty","enableSounds","enableHaptics","moveTimer","countdownTimer","startGame","state","clearInterval","initialFood","generateFood","gameSpeed","GAME_SPEED","setInterval","currentState","gameLoop","decrementTime","stopGame","LOSE","MEDIUM","initializeGame","pauseGame","resumeGame","resetGame","resetIdCounter","newSnake","timeLimit","changeDirection","newDirection","isValidDirectionChange","draft","moveSnake","head","checkWallCollision","COLLISION","HEAVY","checkSelfCollision","checkFoodCollision","grownSnake","growSnake","points","calculateScore","isSpecial","sound","SPECIAL","EAT","Math","random","SPECIAL_FOOD_CHANCE","isSpecialFoodExpired","updateSettings","useSnake","useFood","useScore","useTimeLeft","useIsPlaying","useIsGameOver","useIsPaused"],"sourceRoot":"../../../../src","sources":["games/snake/SnakeStore.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,qBAAqB,QAAQ,oBAAoB;AAC1D,SAASC,eAAe,QAAQ,gCAA6B;AAC7D,SAASC,YAAY,QAAsC,mBAAgB;AAC3E,SAASC,iBAAiB,EAAEC,YAAY,QAAwB,qBAAkB;AAClF,SAASC,SAAS,QAAQ,iCAA8B;AACxD,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AA+BtE,MAAMC,WAAW,GAAG,IAAIN,YAAY,CAAC,CAAC;AAEtC,OAAO,MAAMO,aAAa,GAAGV,MAAM,CAAa,CAAC,CAC/CC,qBAAqB,CACnBC,eAAe,CAAC,CAACS,GAAQ,EAAEC,GAAQ,MAAM;EACvC;EACAC,KAAK,EAAEJ,WAAW,CAACK,eAAe,CAAC,CAAC;EACpCC,IAAI,EAAE,IAAI;EACVC,SAAS,EAAE,OAAO;EAClBC,aAAa,EAAE,OAAO;EACtBC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAE,GAAG;EAAE;EACfC,SAAS,EAAE,KAAK;EAChBC,UAAU,EAAE,KAAK;EACjBC,QAAQ,EAAE,KAAK;EACfC,UAAU,EAAE,MAAM;EAClBC,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBC,SAAS,EAAE,IAAI;EACfC,cAAc,EAAE,IAAI;EAEpBC,SAAS,EAAEA,CAAA,KAAM;IACf,MAAMC,KAAK,GAAGjB,GAAG,CAAC,CAAC;;IAEnB;IACA,IAAIiB,KAAK,CAACH,SAAS,EAAEI,aAAa,CAACD,KAAK,CAACH,SAAS,CAAC;IACnD,IAAIG,KAAK,CAACF,cAAc,EAAEG,aAAa,CAACD,KAAK,CAACF,cAAc,CAAC;;IAE7D;IAC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