react-native-games 0.6.0 → 0.8.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 +148 -23
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +5 -8
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrush.js +121 -0
- package/lib/module/games/candy-crush/CandyCrush.js.map +1 -0
- package/lib/module/games/candy-crush/CandyCrushConstants.js +125 -0
- package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -0
- package/lib/module/games/candy-crush/CandyCrushService.js +370 -0
- package/lib/module/games/candy-crush/CandyCrushService.js.map +1 -0
- package/lib/module/games/candy-crush/CandyCrushStore.js +305 -0
- package/lib/module/games/candy-crush/CandyCrushStore.js.map +1 -0
- package/lib/module/games/candy-crush/components/CandyItem.js +191 -0
- package/lib/module/games/candy-crush/components/CandyItem.js.map +1 -0
- package/lib/module/games/candy-crush/components/GameBackground.js +85 -0
- package/lib/module/games/candy-crush/components/GameBackground.js.map +1 -0
- package/lib/module/games/candy-crush/components/GameGrid.js +314 -0
- package/lib/module/games/candy-crush/components/GameGrid.js.map +1 -0
- package/lib/module/games/candy-crush/components/ScoreBoard.js +112 -0
- package/lib/module/games/candy-crush/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/candy-crush/components/index.js +7 -0
- package/lib/module/games/candy-crush/components/index.js.map +1 -0
- package/lib/module/games/candy-crush/index.js +6 -0
- package/lib/module/games/candy-crush/index.js.map +1 -0
- package/lib/module/games/color-sort/ColorSort.js +130 -0
- package/lib/module/games/color-sort/ColorSort.js.map +1 -0
- package/lib/module/games/color-sort/ColorSortConstants.js +68 -0
- package/lib/module/games/color-sort/ColorSortConstants.js.map +1 -0
- package/lib/module/games/color-sort/ColorSortService.js +255 -0
- package/lib/module/games/color-sort/ColorSortService.js.map +1 -0
- package/lib/module/games/color-sort/ColorSortStore.js +258 -0
- package/lib/module/games/color-sort/ColorSortStore.js.map +1 -0
- package/lib/module/games/color-sort/components/ColorContainer.js +140 -0
- package/lib/module/games/color-sort/components/ColorContainer.js.map +1 -0
- package/lib/module/games/color-sort/components/GameBackground.js +135 -0
- package/lib/module/games/color-sort/components/GameBackground.js.map +1 -0
- package/lib/module/games/color-sort/components/ScoreBoard.js +78 -0
- package/lib/module/games/color-sort/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/color-sort/components/index.js +6 -0
- package/lib/module/games/color-sort/components/index.js.map +1 -0
- package/lib/module/games/dino-jump/DinoJump.js +209 -0
- package/lib/module/games/dino-jump/DinoJump.js.map +1 -0
- package/lib/module/games/dino-jump/DinoJumpConstants.js +179 -0
- package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -0
- package/lib/module/games/dino-jump/DinoJumpService.js +268 -0
- package/lib/module/games/dino-jump/DinoJumpService.js.map +1 -0
- package/lib/module/games/dino-jump/DinoJumpStore.js +387 -0
- package/lib/module/games/dino-jump/DinoJumpStore.js.map +1 -0
- package/lib/module/games/dino-jump/components/DinoSprite.js +409 -0
- package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -0
- package/lib/module/games/dino-jump/components/GameArea.js +68 -0
- package/lib/module/games/dino-jump/components/GameArea.js.map +1 -0
- package/lib/module/games/dino-jump/components/GameBackground.js +421 -0
- package/lib/module/games/dino-jump/components/GameBackground.js.map +1 -0
- package/lib/module/games/dino-jump/components/ObstacleSprite.js +306 -0
- package/lib/module/games/dino-jump/components/ObstacleSprite.js.map +1 -0
- package/lib/module/games/dino-jump/components/ScoreBoard.js +107 -0
- package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/dino-jump/components/StarSprite.js +45 -0
- package/lib/module/games/dino-jump/components/StarSprite.js.map +1 -0
- package/lib/module/games/dino-jump/components/index.js +9 -0
- package/lib/module/games/dino-jump/components/index.js.map +1 -0
- package/lib/module/games/flappy-bird/FlappyBird.js +131 -0
- package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -0
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js +90 -0
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -0
- package/lib/module/games/flappy-bird/FlappyBirdStore.js +276 -0
- package/lib/module/games/flappy-bird/FlappyBirdStore.js.map +1 -0
- package/lib/module/games/flappy-bird/components/Bird.js +87 -0
- package/lib/module/games/flappy-bird/components/Bird.js.map +1 -0
- package/lib/module/games/flappy-bird/components/GameArea.js +86 -0
- package/lib/module/games/flappy-bird/components/GameArea.js.map +1 -0
- package/lib/module/games/flappy-bird/components/GameBackground.js +112 -0
- package/lib/module/games/flappy-bird/components/GameBackground.js.map +1 -0
- package/lib/module/games/flappy-bird/components/Pipes.js +175 -0
- package/lib/module/games/flappy-bird/components/Pipes.js.map +1 -0
- package/lib/module/games/flappy-bird/components/ScoreBoard.js +72 -0
- package/lib/module/games/flappy-bird/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/flappy-bird/components/index.js +8 -0
- package/lib/module/games/flappy-bird/components/index.js.map +1 -0
- package/lib/module/games/fruit-merger/FruitMerger.js +112 -0
- package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -0
- package/lib/module/games/fruit-merger/FruitMergerConstants.js +119 -0
- package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -0
- package/lib/module/games/fruit-merger/FruitMergerService.js +13 -0
- package/lib/module/games/fruit-merger/FruitMergerService.js.map +1 -0
- package/lib/module/games/fruit-merger/FruitMergerStore.js +318 -0
- package/lib/module/games/fruit-merger/FruitMergerStore.js.map +1 -0
- package/lib/module/games/fruit-merger/components/FruitItem.js +102 -0
- package/lib/module/games/fruit-merger/components/FruitItem.js.map +1 -0
- package/lib/module/games/fruit-merger/components/GameArea.js +123 -0
- package/lib/module/games/fruit-merger/components/GameArea.js.map +1 -0
- package/lib/module/games/fruit-merger/components/GameBackground.js +477 -0
- package/lib/module/games/fruit-merger/components/GameBackground.js.map +1 -0
- package/lib/module/games/fruit-merger/components/ScoreBoard.js +66 -0
- package/lib/module/games/fruit-merger/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/fruit-merger/components/index.js +7 -0
- package/lib/module/games/fruit-merger/components/index.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinja.js +6 -9
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/game-2048/Game2048.js +120 -0
- package/lib/module/games/game-2048/Game2048.js.map +1 -0
- package/lib/module/games/game-2048/Game2048Constants.js +263 -0
- package/lib/module/games/game-2048/Game2048Constants.js.map +1 -0
- package/lib/module/games/game-2048/Game2048Service.js +457 -0
- package/lib/module/games/game-2048/Game2048Service.js.map +1 -0
- package/lib/module/games/game-2048/Game2048Store.js +238 -0
- package/lib/module/games/game-2048/Game2048Store.js.map +1 -0
- package/lib/module/games/game-2048/components/GameBackground.js +247 -0
- package/lib/module/games/game-2048/components/GameBackground.js.map +1 -0
- package/lib/module/games/game-2048/components/GameGrid.js +139 -0
- package/lib/module/games/game-2048/components/GameGrid.js.map +1 -0
- package/lib/module/games/game-2048/components/GameTile.js +72 -0
- package/lib/module/games/game-2048/components/GameTile.js.map +1 -0
- package/lib/module/games/game-2048/components/ScoreBoard.js +70 -0
- package/lib/module/games/game-2048/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/game-2048/components/index.js +7 -0
- package/lib/module/games/game-2048/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +33 -31
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +34 -32
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbers.js +161 -0
- package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +207 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js +248 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js.map +1 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +275 -0
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js.map +1 -0
- package/lib/module/games/sliding-numbers/components/GameBackground.js +259 -0
- package/lib/module/games/sliding-numbers/components/GameBackground.js.map +1 -0
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js +174 -0
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js.map +1 -0
- package/lib/module/games/sliding-numbers/components/NumbersTile.js +116 -0
- package/lib/module/games/sliding-numbers/components/NumbersTile.js.map +1 -0
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js +66 -0
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/sliding-numbers/components/index.js +7 -0
- package/lib/module/games/sliding-numbers/components/index.js.map +1 -0
- package/lib/module/games/snake/Snake.js +192 -0
- package/lib/module/games/snake/Snake.js.map +1 -0
- package/lib/module/games/snake/SnakeConstants.js +138 -0
- package/lib/module/games/snake/SnakeConstants.js.map +1 -0
- package/lib/module/games/snake/SnakeService.js +148 -0
- package/lib/module/games/snake/SnakeService.js.map +1 -0
- package/lib/module/games/snake/SnakeStore.js +184 -0
- package/lib/module/games/snake/SnakeStore.js.map +1 -0
- package/lib/module/games/snake/components/GameBackground.js +221 -0
- package/lib/module/games/snake/components/GameBackground.js.map +1 -0
- package/lib/module/games/snake/components/GameGrid.js +153 -0
- package/lib/module/games/snake/components/GameGrid.js.map +1 -0
- package/lib/module/games/snake/components/ScoreBoard.js +57 -0
- package/lib/module/games/snake/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/snake/components/index.js +6 -0
- package/lib/module/games/snake/components/index.js.map +1 -0
- package/lib/module/games/snake/index.js +6 -0
- package/lib/module/games/snake/index.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighter.js +7 -10
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMole.js +6 -6
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/GameBackground.js +7 -8
- package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -1
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +58 -2
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +40 -0
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/SoundsService.js +132 -1
- package/lib/module/services/SoundsService.js.map +1 -1
- package/lib/module/shared/helpers/GameOverModal.js +6 -3
- package/lib/module/shared/helpers/GameOverModal.js.map +1 -1
- package/lib/module/shared/helpers/GameSettingsModal.js +3 -3
- package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -1
- package/lib/module/shared/helpers/ParticleBlast.js +3 -2
- package/lib/module/shared/helpers/ParticleBlast.js.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts +4 -0
- package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +104 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushService.d.ts +40 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushService.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushStore.d.ts +48 -0
- package/lib/typescript/src/games/candy-crush/CandyCrushStore.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/components/CandyItem.d.ts +13 -0
- package/lib/typescript/src/games/candy-crush/components/CandyItem.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/components/GameBackground.d.ts +5 -0
- package/lib/typescript/src/games/candy-crush/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/components/GameGrid.d.ts +3 -0
- package/lib/typescript/src/games/candy-crush/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/candy-crush/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/components/index.d.ts +5 -0
- package/lib/typescript/src/games/candy-crush/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/candy-crush/index.d.ts +4 -0
- package/lib/typescript/src/games/candy-crush/index.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/ColorSort.d.ts +4 -0
- package/lib/typescript/src/games/color-sort/ColorSort.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/ColorSortConstants.d.ts +52 -0
- package/lib/typescript/src/games/color-sort/ColorSortConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/ColorSortService.d.ts +66 -0
- package/lib/typescript/src/games/color-sort/ColorSortService.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/ColorSortStore.d.ts +48 -0
- package/lib/typescript/src/games/color-sort/ColorSortStore.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/components/ColorContainer.d.ts +11 -0
- package/lib/typescript/src/games/color-sort/components/ColorContainer.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/color-sort/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/color-sort/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/color-sort/components/index.d.ts +4 -0
- package/lib/typescript/src/games/color-sort/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts +4 -0
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpConstants.d.ts +95 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpService.d.ts +40 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpService.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpStore.d.ts +103 -0
- package/lib/typescript/src/games/dino-jump/DinoJumpStore.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts +3 -0
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/GameArea.d.ts +8 -0
- package/lib/typescript/src/games/dino-jump/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/dino-jump/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/ObstacleSprite.d.ts +3 -0
- package/lib/typescript/src/games/dino-jump/components/ObstacleSprite.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/dino-jump/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/StarSprite.d.ts +3 -0
- package/lib/typescript/src/games/dino-jump/components/StarSprite.d.ts.map +1 -0
- package/lib/typescript/src/games/dino-jump/components/index.d.ts +7 -0
- package/lib/typescript/src/games/dino-jump/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts +4 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts +83 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBirdStore.d.ts +53 -0
- package/lib/typescript/src/games/flappy-bird/FlappyBirdStore.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/Bird.d.ts +8 -0
- package/lib/typescript/src/games/flappy-bird/components/Bird.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/GameArea.d.ts +8 -0
- package/lib/typescript/src/games/flappy-bird/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/flappy-bird/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/Pipes.d.ts +8 -0
- package/lib/typescript/src/games/flappy-bird/components/Pipes.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/flappy-bird/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/flappy-bird/components/index.d.ts +6 -0
- package/lib/typescript/src/games/flappy-bird/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts +4 -0
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts +115 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerService.d.ts +5 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerService.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerStore.d.ts +43 -0
- package/lib/typescript/src/games/fruit-merger/FruitMergerStore.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/components/FruitItem.d.ts +10 -0
- package/lib/typescript/src/games/fruit-merger/components/FruitItem.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/components/GameArea.d.ts +8 -0
- package/lib/typescript/src/games/fruit-merger/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/fruit-merger/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/fruit-merger/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-merger/components/index.d.ts +5 -0
- package/lib/typescript/src/games/fruit-merger/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/game-2048/Game2048.d.ts +4 -0
- package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/Game2048Constants.d.ts +163 -0
- package/lib/typescript/src/games/game-2048/Game2048Constants.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/Game2048Service.d.ts +113 -0
- package/lib/typescript/src/games/game-2048/Game2048Service.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/Game2048Store.d.ts +48 -0
- package/lib/typescript/src/games/game-2048/Game2048Store.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/game-2048/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/components/GameGrid.d.ts +7 -0
- package/lib/typescript/src/games/game-2048/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/components/GameTile.d.ts +13 -0
- package/lib/typescript/src/games/game-2048/components/GameTile.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/game-2048/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/game-2048/components/index.d.ts +5 -0
- package/lib/typescript/src/games/game-2048/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts +4 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersConstants.d.ts +108 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersService.d.ts +34 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersService.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersStore.d.ts +56 -0
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbersStore.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/sliding-numbers/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/components/NumbersGrid.d.ts +7 -0
- package/lib/typescript/src/games/sliding-numbers/components/NumbersGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/components/NumbersTile.d.ts +11 -0
- package/lib/typescript/src/games/sliding-numbers/components/NumbersTile.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/sliding-numbers/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/sliding-numbers/components/index.d.ts +5 -0
- package/lib/typescript/src/games/sliding-numbers/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/Snake.d.ts +4 -0
- package/lib/typescript/src/games/snake/Snake.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/SnakeConstants.d.ts +93 -0
- package/lib/typescript/src/games/snake/SnakeConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/SnakeService.d.ts +30 -0
- package/lib/typescript/src/games/snake/SnakeService.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/SnakeStore.d.ts +43 -0
- package/lib/typescript/src/games/snake/SnakeStore.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/components/GameBackground.d.ts +5 -0
- package/lib/typescript/src/games/snake/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/components/GameGrid.d.ts +3 -0
- package/lib/typescript/src/games/snake/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/components/index.d.ts +4 -0
- package/lib/typescript/src/games/snake/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/snake/index.d.ts +4 -0
- package/lib/typescript/src/games/snake/index.d.ts.map +1 -0
- 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/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +156 -0
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +10 -2
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/SoundsService.d.ts +103 -0
- package/lib/typescript/src/services/SoundsService.d.ts.map +1 -1
- package/lib/typescript/src/shared/helpers/GameOverModal.d.ts +2 -0
- package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -1
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, StyleSheet } from 'react-native';
|
|
5
|
+
import { GameControlButton, GameOverModal, GameSettingsModal } from "../../shared/helpers/index.js";
|
|
6
|
+
import { GAME_IDS, DEFAULT_GAME_SETTINGS } from "../../services/GamesService.js";
|
|
7
|
+
import { GameBackground, GameGrid, ScoreBoard } from "./components/index.js";
|
|
8
|
+
import { Game2048Service } from "./Game2048Service.js";
|
|
9
|
+
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
10
|
+
import { useGame2048Store, useScore, useIsPlaying, useIsGameOver, useIsWon } from "./Game2048Store.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
export const Game2048 = /*#__PURE__*/React.memo(({
|
|
13
|
+
settings,
|
|
14
|
+
onSettingsChange
|
|
15
|
+
}) => {
|
|
16
|
+
// Zustand store selectors for optimal re-renders
|
|
17
|
+
const score = useScore();
|
|
18
|
+
const isPlaying = useIsPlaying();
|
|
19
|
+
const isGameOver = useIsGameOver();
|
|
20
|
+
const isWon = useIsWon();
|
|
21
|
+
|
|
22
|
+
// Store actions
|
|
23
|
+
const {
|
|
24
|
+
startGame,
|
|
25
|
+
resetGame,
|
|
26
|
+
initializeGame,
|
|
27
|
+
updateSettings
|
|
28
|
+
} = useGame2048Store();
|
|
29
|
+
|
|
30
|
+
// Memoize settings for better performance
|
|
31
|
+
const gameSettings = React.useMemo(() => ({
|
|
32
|
+
difficulty: settings?.difficulty || 'easy',
|
|
33
|
+
enableSounds: settings?.enableSounds ?? true,
|
|
34
|
+
enableHaptics: settings?.enableHaptics ?? true
|
|
35
|
+
}), [settings?.difficulty, settings?.enableSounds, settings?.enableHaptics]);
|
|
36
|
+
|
|
37
|
+
// Memoized game initialization
|
|
38
|
+
const initGame = React.useCallback(() => {
|
|
39
|
+
initializeGame(gameSettings.difficulty);
|
|
40
|
+
}, [initializeGame, gameSettings.difficulty]);
|
|
41
|
+
|
|
42
|
+
// Update settings when they change
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
updateSettings(gameSettings.enableSounds, gameSettings.enableHaptics);
|
|
45
|
+
}, [updateSettings, gameSettings.enableSounds, gameSettings.enableHaptics]);
|
|
46
|
+
|
|
47
|
+
// Initialize on mount and when difficulty changes
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
initGame();
|
|
50
|
+
}, [initGame]);
|
|
51
|
+
|
|
52
|
+
// Cleanup on unmount
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
const gameService = new Game2048Service();
|
|
55
|
+
return () => {
|
|
56
|
+
gameService.cleanup();
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
return /*#__PURE__*/_jsx(GameBackground, {
|
|
60
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
61
|
+
style: styles.container,
|
|
62
|
+
children: [/*#__PURE__*/_jsx(ScoreBoard, {}), /*#__PURE__*/_jsx(GameGrid, {
|
|
63
|
+
difficulty: gameSettings.difficulty
|
|
64
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
65
|
+
style: styles.controlsContainer,
|
|
66
|
+
children: /*#__PURE__*/_jsx(GameControlButton, {
|
|
67
|
+
isPlaying: isPlaying,
|
|
68
|
+
gameOver: isGameOver,
|
|
69
|
+
onStartGame: React.useCallback(() => {
|
|
70
|
+
if (!isPlaying) {
|
|
71
|
+
playHaptic(HapticType.SELECTION, gameSettings.enableHaptics);
|
|
72
|
+
startGame();
|
|
73
|
+
}
|
|
74
|
+
}, [isPlaying, gameSettings.enableHaptics, startGame]),
|
|
75
|
+
onStopGame: React.useCallback(() => {
|
|
76
|
+
playHaptic(HapticType.SELECTION, gameSettings.enableHaptics);
|
|
77
|
+
resetGame();
|
|
78
|
+
}, [gameSettings.enableHaptics, resetGame]),
|
|
79
|
+
startButtonText: isPlaying ? 'PLAYING' : 'START GAME',
|
|
80
|
+
stopButtonText: "STOP GAME",
|
|
81
|
+
startButtonSubtext: isPlaying ? 'Swipe to play' : 'Tap to start',
|
|
82
|
+
stopButtonSubtext: "Stop game and reset",
|
|
83
|
+
startButtonColor: isPlaying ? '#27ae60' : '#3498db',
|
|
84
|
+
stopButtonColor: "#e74c3c",
|
|
85
|
+
startButtonBorderColor: "#2980b9",
|
|
86
|
+
stopButtonBorderColor: "#c0392b"
|
|
87
|
+
})
|
|
88
|
+
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
89
|
+
isVisible: isGameOver || isWon,
|
|
90
|
+
score: score,
|
|
91
|
+
onPlayAgain: resetGame,
|
|
92
|
+
buttonText: isWon ? "Continue Playing!" : "Play Again!",
|
|
93
|
+
primaryColor: isWon ? "rgba(46, 204, 113, 0.95)" : "rgba(231, 76, 60, 0.95)",
|
|
94
|
+
borderColor: isWon ? "rgba(39, 174, 96, 0.9)" : "rgba(192, 57, 43, 0.9)",
|
|
95
|
+
buttonColor: isWon ? "#f39c12" : "#3498db",
|
|
96
|
+
buttonBorderColor: isWon ? "#e67e22" : "#2980b9"
|
|
97
|
+
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
98
|
+
gameId: GAME_IDS.GAME_2048,
|
|
99
|
+
settings: settings || DEFAULT_GAME_SETTINGS,
|
|
100
|
+
onSettingsChange: onSettingsChange
|
|
101
|
+
})]
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
const styles = StyleSheet.create({
|
|
106
|
+
container: {
|
|
107
|
+
flex: 1,
|
|
108
|
+
paddingHorizontal: 15,
|
|
109
|
+
paddingTop: 20,
|
|
110
|
+
paddingBottom: 10,
|
|
111
|
+
position: 'relative'
|
|
112
|
+
},
|
|
113
|
+
controlsContainer: {
|
|
114
|
+
marginTop: 25,
|
|
115
|
+
zIndex: 10,
|
|
116
|
+
position: 'relative'
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
Game2048.displayName = 'Game2048';
|
|
120
|
+
//# sourceMappingURL=Game2048.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","GameControlButton","GameOverModal","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","GameBackground","GameGrid","ScoreBoard","Game2048Service","playHaptic","HapticType","useGame2048Store","useScore","useIsPlaying","useIsGameOver","useIsWon","jsx","_jsx","jsxs","_jsxs","Game2048","memo","settings","onSettingsChange","score","isPlaying","isGameOver","isWon","startGame","resetGame","initializeGame","updateSettings","gameSettings","useMemo","difficulty","enableSounds","enableHaptics","initGame","useCallback","useEffect","gameService","cleanup","children","style","styles","container","controlsContainer","gameOver","onStartGame","SELECTION","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameId","GAME_2048","create","flex","paddingHorizontal","paddingTop","paddingBottom","position","marginTop","zIndex","displayName"],"sourceRoot":"../../../../src","sources":["games/game-2048/Game2048.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,iBAAiB,QAAQ,+BAAsB;AAC1F,SAASC,QAAQ,EAAkBC,qBAAqB,QAAQ,gCAA6B;AAC7F,SAASC,cAAc,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,uBAAc;AACnE,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AACtE,SACEC,gBAAgB,EAChBC,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,QAAQ,QACH,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzB,OAAO,MAAMC,QAA6B,gBAAGvB,KAAK,CAACwB,IAAI,CAAC,CAAC;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,KAAK;EAC1F;EACA,MAAMC,KAAK,GAAGZ,QAAQ,CAAC,CAAC;EACxB,MAAMa,SAAS,GAAGZ,YAAY,CAAC,CAAC;EAChC,MAAMa,UAAU,GAAGZ,aAAa,CAAC,CAAC;EAClC,MAAMa,KAAK,GAAGZ,QAAQ,CAAC,CAAC;;EAExB;EACA,MAAM;IAAEa,SAAS;IAAEC,SAAS;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGpB,gBAAgB,CAAC,CAAC;;EAEnF;EACA,MAAMqB,YAAY,GAAGnC,KAAK,CAACo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oC,WAAW,EAAEpC,KAAK,GAAG,wBAAwB,GAAG,wBAAyB;QACzEqC,WAAW,EAAErC,KAAK,GAAG,SAAS,GAAG,SAAU;QAC3CsC,iBAAiB,EAAEtC,KAAK,GAAG,SAAS,GAAG;MAAU,CAClD,CAAC,eAGFV,IAAA,CAACf,iBAAiB;QAChBgE,MAAM,EAAE/D,QAAQ,CAACgE,SAAU;QAC3B7C,QAAQ,EAAEA,QAAQ,IAAIlB,qBAAsB;QAC5CmB,gBAAgB,EAAEA;MAAiB,CACpC,CAAC;IAAA,CACE;EAAC,CACO,CAAC;AAErB,CAAC,CAAC;AAEF,MAAMqB,MAAM,GAAG7C,UAAU,CAACqE,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,IAAI,EAAE,CAAC;IACPC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,EAAE;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACD3B,iBAAiB,EAAE;IACjB4B,SAAS,EAAE,EAAE;IACbC,MAAM,EAAE,EAAE;IACVF,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEFrD,QAAQ,CAACwD,WAAW,GAAG,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const GAME_2048_COLORS = {
|
|
4
|
+
// Background colors
|
|
5
|
+
BACKGROUND: '#faf8ef',
|
|
6
|
+
GRID_BACKGROUND: '#bbada0',
|
|
7
|
+
// Tile colors based on value
|
|
8
|
+
TILE_COLORS: {
|
|
9
|
+
2: {
|
|
10
|
+
background: '#eee4da',
|
|
11
|
+
text: '#776e65'
|
|
12
|
+
},
|
|
13
|
+
4: {
|
|
14
|
+
background: '#ede0c8',
|
|
15
|
+
text: '#776e65'
|
|
16
|
+
},
|
|
17
|
+
8: {
|
|
18
|
+
background: '#f2b179',
|
|
19
|
+
text: '#f9f6f2'
|
|
20
|
+
},
|
|
21
|
+
16: {
|
|
22
|
+
background: '#f59563',
|
|
23
|
+
text: '#f9f6f2'
|
|
24
|
+
},
|
|
25
|
+
32: {
|
|
26
|
+
background: '#f67c5f',
|
|
27
|
+
text: '#f9f6f2'
|
|
28
|
+
},
|
|
29
|
+
64: {
|
|
30
|
+
background: '#f65e3b',
|
|
31
|
+
text: '#f9f6f2'
|
|
32
|
+
},
|
|
33
|
+
128: {
|
|
34
|
+
background: '#edcf72',
|
|
35
|
+
text: '#f9f6f2'
|
|
36
|
+
},
|
|
37
|
+
256: {
|
|
38
|
+
background: '#edcc61',
|
|
39
|
+
text: '#f9f6f2'
|
|
40
|
+
},
|
|
41
|
+
512: {
|
|
42
|
+
background: '#edc850',
|
|
43
|
+
text: '#f9f6f2'
|
|
44
|
+
},
|
|
45
|
+
1024: {
|
|
46
|
+
background: '#edc53f',
|
|
47
|
+
text: '#f9f6f2'
|
|
48
|
+
},
|
|
49
|
+
2048: {
|
|
50
|
+
background: '#edc22e',
|
|
51
|
+
text: '#f9f6f2'
|
|
52
|
+
},
|
|
53
|
+
4096: {
|
|
54
|
+
background: '#3c3a32',
|
|
55
|
+
text: '#f9f6f2'
|
|
56
|
+
},
|
|
57
|
+
8192: {
|
|
58
|
+
background: '#3c3a32',
|
|
59
|
+
text: '#f9f6f2'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
// UI colors
|
|
63
|
+
SCOREBOARD_BACKGROUND: 'rgba(187, 173, 160, 0.9)',
|
|
64
|
+
SCOREBOARD_TEXT: '#776e65',
|
|
65
|
+
BUTTON_BACKGROUND: '#8f7a66',
|
|
66
|
+
BUTTON_TEXT: '#f9f6f2',
|
|
67
|
+
BUTTON_BORDER: '#776e65',
|
|
68
|
+
// Game over overlay
|
|
69
|
+
GAME_OVER_OVERLAY: 'rgba(238, 228, 218, 0.95)',
|
|
70
|
+
GAME_WIN_OVERLAY: 'rgba(237, 194, 46, 0.95)'
|
|
71
|
+
};
|
|
72
|
+
export const GAME_2048_SETTINGS = {
|
|
73
|
+
// Grid configuration
|
|
74
|
+
GRID_SIZE: 4,
|
|
75
|
+
TILE_SIZE: 70,
|
|
76
|
+
TILE_MARGIN: 8,
|
|
77
|
+
TILE_BORDER_RADIUS: 6,
|
|
78
|
+
// Animation settings - minimal for stability
|
|
79
|
+
ANIMATION_DURATION: 50,
|
|
80
|
+
MERGE_ANIMATION_DURATION: 30,
|
|
81
|
+
SPAWN_ANIMATION_DURATION: 50,
|
|
82
|
+
// Game mechanics
|
|
83
|
+
INITIAL_TILES: 2,
|
|
84
|
+
NEW_TILE_PROBABILITY_4: 0.1,
|
|
85
|
+
// 10% chance for 4, 90% for 2
|
|
86
|
+
|
|
87
|
+
// Scoring
|
|
88
|
+
SCORE_MULTIPLIER: {
|
|
89
|
+
easy: 1,
|
|
90
|
+
medium: 1.5,
|
|
91
|
+
hard: 2
|
|
92
|
+
},
|
|
93
|
+
// Difficulty settings
|
|
94
|
+
DIFFICULTY_SETTINGS: {
|
|
95
|
+
easy: {
|
|
96
|
+
gridSize: 4,
|
|
97
|
+
targetTile: 1024
|
|
98
|
+
},
|
|
99
|
+
medium: {
|
|
100
|
+
gridSize: 4,
|
|
101
|
+
targetTile: 2048
|
|
102
|
+
},
|
|
103
|
+
hard: {
|
|
104
|
+
gridSize: 4,
|
|
105
|
+
targetTile: 4096
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
export const GAME_2048_GESTURES = {
|
|
110
|
+
// Minimum distance for swipe recognition
|
|
111
|
+
MIN_SWIPE_DISTANCE: 50,
|
|
112
|
+
// Maximum time for swipe gesture
|
|
113
|
+
MAX_SWIPE_TIME: 300,
|
|
114
|
+
// Velocity threshold for swipe
|
|
115
|
+
MIN_VELOCITY: 0.5
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// Frozen objects for better performance and immutability
|
|
119
|
+
export const GAME_2048_SOUNDS = Object.freeze({
|
|
120
|
+
TILE_MOVE: Object.freeze({
|
|
121
|
+
text: 'swipe',
|
|
122
|
+
pitch: 1.2,
|
|
123
|
+
rate: 1.5
|
|
124
|
+
}),
|
|
125
|
+
TILE_MERGE: Object.freeze({
|
|
126
|
+
text: 'merge',
|
|
127
|
+
pitch: 1.5,
|
|
128
|
+
rate: 1.2
|
|
129
|
+
}),
|
|
130
|
+
GAME_WIN: Object.freeze({
|
|
131
|
+
text: 'victory!',
|
|
132
|
+
pitch: 1.8,
|
|
133
|
+
rate: 0.8
|
|
134
|
+
}),
|
|
135
|
+
GAME_OVER: Object.freeze({
|
|
136
|
+
text: 'game over',
|
|
137
|
+
pitch: 0.8,
|
|
138
|
+
rate: 0.9
|
|
139
|
+
}),
|
|
140
|
+
NEW_TILE: Object.freeze({
|
|
141
|
+
text: 'pop',
|
|
142
|
+
pitch: 1.6,
|
|
143
|
+
rate: 1.8
|
|
144
|
+
}),
|
|
145
|
+
INVALID_MOVE: Object.freeze({
|
|
146
|
+
text: 'blocked',
|
|
147
|
+
pitch: 0.6,
|
|
148
|
+
rate: 1.5
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// Memoized helper function to get tile color for better performance
|
|
153
|
+
const tileColorCache = new Map();
|
|
154
|
+
export const getTileColor = value => {
|
|
155
|
+
if (tileColorCache.has(value)) {
|
|
156
|
+
return tileColorCache.get(value);
|
|
157
|
+
}
|
|
158
|
+
let result;
|
|
159
|
+
if (value === 0) {
|
|
160
|
+
result = {
|
|
161
|
+
background: 'rgba(238, 228, 218, 0.35)',
|
|
162
|
+
text: '#776e65'
|
|
163
|
+
};
|
|
164
|
+
} else {
|
|
165
|
+
const colors = GAME_2048_COLORS.TILE_COLORS;
|
|
166
|
+
result = colors[value] || colors[8192];
|
|
167
|
+
}
|
|
168
|
+
tileColorCache.set(value, result);
|
|
169
|
+
return result;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// Helper function to format large numbers
|
|
173
|
+
export const formatScore = score => {
|
|
174
|
+
if (score >= 1000000) {
|
|
175
|
+
return `${(score / 1000000).toFixed(1)}M`;
|
|
176
|
+
} else if (score >= 1000) {
|
|
177
|
+
return `${(score / 1000).toFixed(1)}K`;
|
|
178
|
+
}
|
|
179
|
+
return score.toString();
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// Helper function to get grid dimensions based on difficulty
|
|
183
|
+
// 2048-themed vibrant colors for background elements
|
|
184
|
+
export const BACKGROUND_TILE_COLORS = ['#E91E63',
|
|
185
|
+
// Vibrant pink (2)
|
|
186
|
+
'#F44336',
|
|
187
|
+
// Bright red (4)
|
|
188
|
+
'#FF5722',
|
|
189
|
+
// Deep orange (8)
|
|
190
|
+
'#FF9800',
|
|
191
|
+
// Orange (16)
|
|
192
|
+
'#FFC107',
|
|
193
|
+
// Amber/yellow (32)
|
|
194
|
+
'#CDDC39',
|
|
195
|
+
// Lime (64)
|
|
196
|
+
'#4CAF50',
|
|
197
|
+
// Green (128)
|
|
198
|
+
'#009688',
|
|
199
|
+
// Teal (256)
|
|
200
|
+
'#00BCD4',
|
|
201
|
+
// Cyan (512)
|
|
202
|
+
'#2196F3',
|
|
203
|
+
// Blue (1024)
|
|
204
|
+
'#3F51B5',
|
|
205
|
+
// Indigo (2048)
|
|
206
|
+
'#9C27B0' // Purple (4096+)
|
|
207
|
+
];
|
|
208
|
+
|
|
209
|
+
// Game configuration constants
|
|
210
|
+
export const GAME_CONFIG = {
|
|
211
|
+
GRID_SIZE: 4,
|
|
212
|
+
INITIAL_TILES: 2,
|
|
213
|
+
NEW_TILE_PROBABILITY_4: 0.1,
|
|
214
|
+
// 10% chance for 4, 90% for 2
|
|
215
|
+
TILE_SIZE: 70,
|
|
216
|
+
TILE_MARGIN: 8,
|
|
217
|
+
ANIMATION_CONFIG: {
|
|
218
|
+
TENSION: 200,
|
|
219
|
+
FRICTION: 10
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
// 2048 Game Theme - Matches the colorful tile design
|
|
224
|
+
export const GAME_2048_THEME = {
|
|
225
|
+
backgroundColor: '#667eea',
|
|
226
|
+
// Purple gradient background
|
|
227
|
+
headerBackgroundColor: 'rgba(255, 255, 255, 0.4)',
|
|
228
|
+
// Semi-transparent white header
|
|
229
|
+
headerTextColor: '#2c3e50',
|
|
230
|
+
sectionBackgroundColor: 'rgba(52, 152, 219, 0.4)',
|
|
231
|
+
// Blue sections to match difficulty box
|
|
232
|
+
sectionTitleColor: '#ffffff',
|
|
233
|
+
buttonSelectedColor: '#3498db',
|
|
234
|
+
// Match game button colors
|
|
235
|
+
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
236
|
+
buttonSelectedTextColor: '#ffffff',
|
|
237
|
+
buttonUnselectedTextColor: '#2c3e50',
|
|
238
|
+
switchTrackColorFalse: 'rgba(52, 152, 219, 0.5)',
|
|
239
|
+
switchTrackColorTrue: '#3498db',
|
|
240
|
+
switchThumbColor: '#ffffff',
|
|
241
|
+
infoTextColor: '#2c3e50'
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
// 2048 Difficulty Descriptions
|
|
245
|
+
export const GAME_2048_DIFFICULTY_DESCRIPTIONS = {
|
|
246
|
+
easy: 'Reach 1024 tile on 4x4 grid',
|
|
247
|
+
medium: 'Reach 2048 tile on 4x4 grid',
|
|
248
|
+
hard: 'Reach 4096 tile on 4x4 grid'
|
|
249
|
+
};
|
|
250
|
+
export const getGridDimensions = difficulty => {
|
|
251
|
+
const settings = GAME_2048_SETTINGS.DIFFICULTY_SETTINGS[difficulty];
|
|
252
|
+
const gridSize = settings.gridSize;
|
|
253
|
+
const tileSize = GAME_2048_SETTINGS.TILE_SIZE;
|
|
254
|
+
const margin = GAME_2048_SETTINGS.TILE_MARGIN;
|
|
255
|
+
const totalSize = tileSize * gridSize + margin * (gridSize + 1);
|
|
256
|
+
return {
|
|
257
|
+
gridSize,
|
|
258
|
+
tileSize,
|
|
259
|
+
margin,
|
|
260
|
+
totalSize
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=Game2048Constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GAME_2048_COLORS","BACKGROUND","GRID_BACKGROUND","TILE_COLORS","background","text","SCOREBOARD_BACKGROUND","SCOREBOARD_TEXT","BUTTON_BACKGROUND","BUTTON_TEXT","BUTTON_BORDER","GAME_OVER_OVERLAY","GAME_WIN_OVERLAY","GAME_2048_SETTINGS","GRID_SIZE","TILE_SIZE","TILE_MARGIN","TILE_BORDER_RADIUS","ANIMATION_DURATION","MERGE_ANIMATION_DURATION","SPAWN_ANIMATION_DURATION","INITIAL_TILES","NEW_TILE_PROBABILITY_4","SCORE_MULTIPLIER","easy","medium","hard","DIFFICULTY_SETTINGS","gridSize","targetTile","GAME_2048_GESTURES","MIN_SWIPE_DISTANCE","MAX_SWIPE_TIME","MIN_VELOCITY","GAME_2048_SOUNDS","Object","freeze","TILE_MOVE","pitch","rate","TILE_MERGE","GAME_WIN","GAME_OVER","NEW_TILE","INVALID_MOVE","tileColorCache","Map","getTileColor","value","has","get","result","colors","set","formatScore","score","toFixed","toString","BACKGROUND_TILE_COLORS","GAME_CONFIG","ANIMATION_CONFIG","TENSION","FRICTION","GAME_2048_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","GAME_2048_DIFFICULTY_DESCRIPTIONS","getGridDimensions","difficulty","settings","tileSize","margin","totalSize"],"sourceRoot":"../../../../src","sources":["games/game-2048/Game2048Constants.ts"],"mappings":";;AAEA,OAAO,MAAMA,gBAAgB,GAAG;EAC9B;EACAC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAE1B;EACAC,WAAW,EAAE;IACX,CAAC,EAAE;MAAEC,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC7C,CAAC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