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,239 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Dimensions } from 'react-native';
|
|
5
|
-
import { Canvas, LinearGradient, Rect, Circle, Group, Shadow, vec } from '@shopify/react-native-skia';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const {
|
|
8
|
-
width,
|
|
9
|
-
height
|
|
10
|
-
} = Dimensions.get('window');
|
|
11
|
-
export const GameBackground = /*#__PURE__*/React.memo(({
|
|
12
|
-
children
|
|
13
|
-
}) => {
|
|
14
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
15
|
-
style: {
|
|
16
|
-
flex: 1
|
|
17
|
-
},
|
|
18
|
-
children: [/*#__PURE__*/_jsxs(Canvas, {
|
|
19
|
-
style: {
|
|
20
|
-
position: 'absolute',
|
|
21
|
-
top: 0,
|
|
22
|
-
left: 0,
|
|
23
|
-
right: 0,
|
|
24
|
-
bottom: 0,
|
|
25
|
-
width,
|
|
26
|
-
height
|
|
27
|
-
},
|
|
28
|
-
children: [/*#__PURE__*/_jsx(Rect, {
|
|
29
|
-
x: 0,
|
|
30
|
-
y: 0,
|
|
31
|
-
width: width,
|
|
32
|
-
height: height,
|
|
33
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
34
|
-
start: vec(0, 0),
|
|
35
|
-
end: vec(0, height),
|
|
36
|
-
colors: ['#0c0a1f', '#1a1b3a', '#2d1b69', '#1e1b4b', '#0c0a1f']
|
|
37
|
-
})
|
|
38
|
-
}), /*#__PURE__*/_jsx(Group, {
|
|
39
|
-
children: Array.from({
|
|
40
|
-
length: 40
|
|
41
|
-
}, (_, i) => {
|
|
42
|
-
const x = width / 8 * (i % 8) + i % 5 * 25;
|
|
43
|
-
const y = height / 5 * Math.floor(i / 8) + i % 3 * 40;
|
|
44
|
-
const size = 1 + i % 3 * 0.4;
|
|
45
|
-
return /*#__PURE__*/_jsx(Circle, {
|
|
46
|
-
cx: x,
|
|
47
|
-
cy: y,
|
|
48
|
-
r: size,
|
|
49
|
-
color: "#ffffff",
|
|
50
|
-
opacity: 0.6
|
|
51
|
-
}, `star-${i}`);
|
|
52
|
-
})
|
|
53
|
-
}), /*#__PURE__*/_jsx(Group, {
|
|
54
|
-
children: Array.from({
|
|
55
|
-
length: 8
|
|
56
|
-
}, (_, i) => {
|
|
57
|
-
const positions = [{
|
|
58
|
-
x: width * 0.15,
|
|
59
|
-
y: height * 0.2
|
|
60
|
-
}, {
|
|
61
|
-
x: width * 0.8,
|
|
62
|
-
y: height * 0.3
|
|
63
|
-
}, {
|
|
64
|
-
x: width * 0.3,
|
|
65
|
-
y: height * 0.5
|
|
66
|
-
}, {
|
|
67
|
-
x: width * 0.7,
|
|
68
|
-
y: height * 0.6
|
|
69
|
-
}, {
|
|
70
|
-
x: width * 0.2,
|
|
71
|
-
y: height * 0.7
|
|
72
|
-
}, {
|
|
73
|
-
x: width * 0.85,
|
|
74
|
-
y: height * 0.8
|
|
75
|
-
}, {
|
|
76
|
-
x: width * 0.5,
|
|
77
|
-
y: height * 0.15
|
|
78
|
-
}, {
|
|
79
|
-
x: width * 0.6,
|
|
80
|
-
y: height * 0.85
|
|
81
|
-
}];
|
|
82
|
-
const pos = positions[i];
|
|
83
|
-
if (!pos) return null;
|
|
84
|
-
const size = 2.5 + i % 2 * 0.5;
|
|
85
|
-
return /*#__PURE__*/_jsx(Group, {
|
|
86
|
-
children: /*#__PURE__*/_jsx(Circle, {
|
|
87
|
-
cx: pos.x,
|
|
88
|
-
cy: pos.y,
|
|
89
|
-
r: size,
|
|
90
|
-
color: "#ffffff",
|
|
91
|
-
opacity: 0.8,
|
|
92
|
-
children: /*#__PURE__*/_jsx(Shadow, {
|
|
93
|
-
dx: 0,
|
|
94
|
-
dy: 0,
|
|
95
|
-
blur: 10,
|
|
96
|
-
color: "#ffffff"
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
}, `bright-star-${i}`);
|
|
100
|
-
})
|
|
101
|
-
}), /*#__PURE__*/_jsxs(Group, {
|
|
102
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
103
|
-
cx: width * 0.85,
|
|
104
|
-
cy: height * 0.2,
|
|
105
|
-
r: 32,
|
|
106
|
-
color: "#4c1d95",
|
|
107
|
-
opacity: 0.8,
|
|
108
|
-
children: /*#__PURE__*/_jsx(Shadow, {
|
|
109
|
-
dx: -2,
|
|
110
|
-
dy: 2,
|
|
111
|
-
blur: 8,
|
|
112
|
-
color: "rgba(0,0,0,0.5)"
|
|
113
|
-
})
|
|
114
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
115
|
-
cx: width * 0.85 - 6,
|
|
116
|
-
cy: height * 0.2 - 4,
|
|
117
|
-
r: 10,
|
|
118
|
-
color: "#5b21b6",
|
|
119
|
-
opacity: 0.6
|
|
120
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
121
|
-
cx: width * 0.85 + 4,
|
|
122
|
-
cy: height * 0.2 + 6,
|
|
123
|
-
r: 6,
|
|
124
|
-
color: "#6d28d9",
|
|
125
|
-
opacity: 0.5
|
|
126
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
127
|
-
cx: width * 0.85 - 8,
|
|
128
|
-
cy: height * 0.2 - 8,
|
|
129
|
-
r: 6,
|
|
130
|
-
color: "#a855f7",
|
|
131
|
-
opacity: 0.3
|
|
132
|
-
})]
|
|
133
|
-
}), /*#__PURE__*/_jsxs(Group, {
|
|
134
|
-
children: [/*#__PURE__*/_jsxs(Group, {
|
|
135
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
136
|
-
cx: width * 0.2,
|
|
137
|
-
cy: height * 0.6,
|
|
138
|
-
r: 40,
|
|
139
|
-
color: "#7c3aed",
|
|
140
|
-
opacity: 0.12,
|
|
141
|
-
children: /*#__PURE__*/_jsx(Shadow, {
|
|
142
|
-
dx: 0,
|
|
143
|
-
dy: 0,
|
|
144
|
-
blur: 15,
|
|
145
|
-
color: "#7c3aed"
|
|
146
|
-
})
|
|
147
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
148
|
-
cx: width * 0.24,
|
|
149
|
-
cy: height * 0.58,
|
|
150
|
-
r: 28,
|
|
151
|
-
color: "#a855f7",
|
|
152
|
-
opacity: 0.1
|
|
153
|
-
})]
|
|
154
|
-
}), /*#__PURE__*/_jsxs(Group, {
|
|
155
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
156
|
-
cx: width * 0.7,
|
|
157
|
-
cy: height * 0.4,
|
|
158
|
-
r: 30,
|
|
159
|
-
color: "#3b82f6",
|
|
160
|
-
opacity: 0.1,
|
|
161
|
-
children: /*#__PURE__*/_jsx(Shadow, {
|
|
162
|
-
dx: 0,
|
|
163
|
-
dy: 0,
|
|
164
|
-
blur: 12,
|
|
165
|
-
color: "#3b82f6"
|
|
166
|
-
})
|
|
167
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
168
|
-
cx: width * 0.72,
|
|
169
|
-
cy: height * 0.38,
|
|
170
|
-
r: 20,
|
|
171
|
-
color: "#60a5fa",
|
|
172
|
-
opacity: 0.08
|
|
173
|
-
})]
|
|
174
|
-
})]
|
|
175
|
-
}), /*#__PURE__*/_jsx(Group, {
|
|
176
|
-
children: Array.from({
|
|
177
|
-
length: 5
|
|
178
|
-
}, (_, i) => {
|
|
179
|
-
const positions = [{
|
|
180
|
-
x: width * 0.15,
|
|
181
|
-
y: height * 0.3
|
|
182
|
-
}, {
|
|
183
|
-
x: width * 0.85,
|
|
184
|
-
y: height * 0.5
|
|
185
|
-
}, {
|
|
186
|
-
x: width * 0.3,
|
|
187
|
-
y: height * 0.75
|
|
188
|
-
}, {
|
|
189
|
-
x: width * 0.75,
|
|
190
|
-
y: height * 0.2
|
|
191
|
-
}, {
|
|
192
|
-
x: width * 0.5,
|
|
193
|
-
y: height * 0.85
|
|
194
|
-
}];
|
|
195
|
-
const pos = positions[i];
|
|
196
|
-
if (!pos) return null;
|
|
197
|
-
const size = 3 + i % 3;
|
|
198
|
-
return /*#__PURE__*/_jsxs(Group, {
|
|
199
|
-
children: [/*#__PURE__*/_jsx(Circle, {
|
|
200
|
-
cx: pos.x,
|
|
201
|
-
cy: pos.y,
|
|
202
|
-
r: size,
|
|
203
|
-
color: "#6b7280",
|
|
204
|
-
opacity: 0.5,
|
|
205
|
-
children: /*#__PURE__*/_jsx(Shadow, {
|
|
206
|
-
dx: 1,
|
|
207
|
-
dy: 1,
|
|
208
|
-
blur: 2,
|
|
209
|
-
color: "rgba(0,0,0,0.3)"
|
|
210
|
-
})
|
|
211
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
212
|
-
cx: pos.x - size * 0.25,
|
|
213
|
-
cy: pos.y - size * 0.25,
|
|
214
|
-
r: size * 0.3,
|
|
215
|
-
color: "#9ca3af",
|
|
216
|
-
opacity: 0.3
|
|
217
|
-
})]
|
|
218
|
-
}, `asteroid-${i}`);
|
|
219
|
-
})
|
|
220
|
-
}), /*#__PURE__*/_jsx(Group, {
|
|
221
|
-
children: Array.from({
|
|
222
|
-
length: 15
|
|
223
|
-
}, (_, i) => {
|
|
224
|
-
const x = width / 5 * (i % 5) + i % 3 * 20;
|
|
225
|
-
const y = height / 3 * Math.floor(i / 5) + i % 4 * 30;
|
|
226
|
-
const size = 0.5 + i % 2 * 0.2;
|
|
227
|
-
return /*#__PURE__*/_jsx(Circle, {
|
|
228
|
-
cx: x,
|
|
229
|
-
cy: y,
|
|
230
|
-
r: size,
|
|
231
|
-
color: "#e5e7eb",
|
|
232
|
-
opacity: 0.25
|
|
233
|
-
}, `dust-${i}`);
|
|
234
|
-
})
|
|
235
|
-
})]
|
|
236
|
-
}), children]
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
//# sourceMappingURL=GameBackground.js.map
|
|
1
|
+
"use strict";import React from 'react';import{View,Dimensions}from 'react-native';import{Canvas,LinearGradient,Rect,Circle,Group,Shadow,vec}from '@shopify/react-native-skia';import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const{width,height}= Dimensions.get('window');export const GameBackground = React.memo(({children})=>{return _jsxs(View,{style:{flex:1},children:[_jsxs(Canvas,{style:{position:'absolute',top:0,left:0,right:0,bottom:0,width,height},children:[_jsx(Rect,{x:0,y:0,width:width,height:height,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(0,height),colors:['#0c0a1f','#1a1b3a','#2d1b69','#1e1b4b','#0c0a1f']})}),_jsx(Group,{children:Array.from({length:40},(_,i)=>{const x = width / 8 *(i % 8)+ i % 5 * 25;const y = height / 5 * Math.floor(i / 8)+ i % 3 * 40;const size = 1 + i % 3 * 0.4;return _jsx(Circle,{cx:x,cy:y,r:size,color:"#ffffff",opacity:0.6},`star-${i}`);})}),_jsx(Group,{children:Array.from({length:8},(_,i)=>{const positions = [{x:width * 0.15,y:height * 0.2},{x:width * 0.8,y:height * 0.3},{x:width * 0.3,y:height * 0.5},{x:width * 0.7,y:height * 0.6},{x:width * 0.2,y:height * 0.7},{x:width * 0.85,y:height * 0.8},{x:width * 0.5,y:height * 0.15},{x:width * 0.6,y:height * 0.85}];const pos = positions[i];if(!pos)return null;const size = 2.5 + i % 2 * 0.5;return _jsx(Group,{children:_jsx(Circle,{cx:pos.x,cy:pos.y,r:size,color:"#ffffff",opacity:0.8,children:_jsx(Shadow,{dx:0,dy:0,blur:10,color:"#ffffff"})})},`bright-star-${i}`);})}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.85,cy:height * 0.2,r:32,color:"#4c1d95",opacity:0.8,children:_jsx(Shadow,{dx:-2,dy:2,blur:8,color:"rgba(0,0,0,0.5)"})}),_jsx(Circle,{cx:width * 0.85 - 6,cy:height * 0.2 - 4,r:10,color:"#5b21b6",opacity:0.6}),_jsx(Circle,{cx:width * 0.85 + 4,cy:height * 0.2 + 6,r:6,color:"#6d28d9",opacity:0.5}),_jsx(Circle,{cx:width * 0.85 - 8,cy:height * 0.2 - 8,r:6,color:"#a855f7",opacity:0.3})]}),_jsxs(Group,{children:[_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.2,cy:height * 0.6,r:40,color:"#7c3aed",opacity:0.12,children:_jsx(Shadow,{dx:0,dy:0,blur:15,color:"#7c3aed"})}),_jsx(Circle,{cx:width * 0.24,cy:height * 0.58,r:28,color:"#a855f7",opacity:0.1})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.7,cy:height * 0.4,r:30,color:"#3b82f6",opacity:0.1,children:_jsx(Shadow,{dx:0,dy:0,blur:12,color:"#3b82f6"})}),_jsx(Circle,{cx:width * 0.72,cy:height * 0.38,r:20,color:"#60a5fa",opacity:0.08})]})]}),_jsx(Group,{children:Array.from({length:5},(_,i)=>{const positions = [{x:width * 0.15,y:height * 0.3},{x:width * 0.85,y:height * 0.5},{x:width * 0.3,y:height * 0.75},{x:width * 0.75,y:height * 0.2},{x:width * 0.5,y:height * 0.85}];const pos = positions[i];if(!pos)return null;const size = 3 + i % 3;return _jsxs(Group,{children:[_jsx(Circle,{cx:pos.x,cy:pos.y,r:size,color:"#6b7280",opacity:0.5,children:_jsx(Shadow,{dx:1,dy:1,blur:2,color:"rgba(0,0,0,0.3)"})}),_jsx(Circle,{cx:pos.x - size * 0.25,cy:pos.y - size * 0.25,r:size * 0.3,color:"#9ca3af",opacity:0.3})]},`asteroid-${i}`);})}),_jsx(Group,{children:Array.from({length:15},(_,i)=>{const x = width / 5 *(i % 5)+ i % 3 * 20;const y = height / 3 * Math.floor(i / 5)+ i % 4 * 30;const size = 0.5 + i % 2 * 0.2;return _jsx(Circle,{cx:x,cy:y,r:size,color:"#e5e7eb",opacity:0.25},`dust-${i}`);})})]}),children]});});
|
|
@@ -1,136 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
-
import { useSpaceFighterStore } from "../SpaceFighterStore.js";
|
|
6
|
-
import { ScoreBoardContainer } from "../../../helpers/index.js";
|
|
7
|
-
|
|
8
|
-
// Self-contained ScoreBoard component that reads directly from store
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export const ScoreBoard = /*#__PURE__*/React.memo(({
|
|
11
|
-
offset = 0
|
|
12
|
-
}) => {
|
|
13
|
-
// Read state directly from store to minimize re-renders
|
|
14
|
-
const score = useSpaceFighterStore(state => state.score);
|
|
15
|
-
const timeLeft = useSpaceFighterStore(state => state.timeLeft);
|
|
16
|
-
const currentLives = useSpaceFighterStore(state => state.lives);
|
|
17
|
-
const maxLives = 3;
|
|
18
|
-
return /*#__PURE__*/_jsx(ScoreBoardContainer, {
|
|
19
|
-
offset: offset,
|
|
20
|
-
backgroundColor: "rgba(147, 112, 219, 0.4)",
|
|
21
|
-
borderColor: "rgba(139, 92, 246, 0.3)",
|
|
22
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
23
|
-
style: styles.scoreBoard,
|
|
24
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
25
|
-
style: styles.scoreItem,
|
|
26
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
27
|
-
style: styles.scoreLabel,
|
|
28
|
-
children: "Score"
|
|
29
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
30
|
-
style: styles.scoreValue,
|
|
31
|
-
children: score
|
|
32
|
-
})]
|
|
33
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
34
|
-
style: styles.scoreItem,
|
|
35
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
36
|
-
style: styles.scoreLabel,
|
|
37
|
-
children: "Time"
|
|
38
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
39
|
-
style: styles.timeValue,
|
|
40
|
-
children: timeLeft
|
|
41
|
-
})]
|
|
42
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
43
|
-
style: styles.scoreItem,
|
|
44
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
45
|
-
style: styles.scoreLabel,
|
|
46
|
-
children: "Lives"
|
|
47
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
48
|
-
style: styles.livesContainer,
|
|
49
|
-
children: Array.from({
|
|
50
|
-
length: maxLives
|
|
51
|
-
}, (_, i) => /*#__PURE__*/_jsx(Text, {
|
|
52
|
-
style: [styles.lifeIcon, i < currentLives ? styles.lifeActive : styles.lifeInactive],
|
|
53
|
-
children: i < currentLives ? '❤️' : '🖤'
|
|
54
|
-
}, i))
|
|
55
|
-
})]
|
|
56
|
-
})]
|
|
57
|
-
})
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
const styles = StyleSheet.create({
|
|
61
|
-
scoreBoard: {
|
|
62
|
-
flexDirection: 'row',
|
|
63
|
-
justifyContent: 'space-between',
|
|
64
|
-
alignItems: 'center'
|
|
65
|
-
},
|
|
66
|
-
scoreItem: {
|
|
67
|
-
alignItems: 'center',
|
|
68
|
-
flex: 1
|
|
69
|
-
},
|
|
70
|
-
scoreLabel: {
|
|
71
|
-
fontSize: 18,
|
|
72
|
-
fontWeight: 'bold',
|
|
73
|
-
color: '#e2e8f0',
|
|
74
|
-
// Light space gray
|
|
75
|
-
marginBottom: 6,
|
|
76
|
-
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
77
|
-
textShadowOffset: {
|
|
78
|
-
width: 1,
|
|
79
|
-
height: 1
|
|
80
|
-
},
|
|
81
|
-
textShadowRadius: 2
|
|
82
|
-
},
|
|
83
|
-
scoreValue: {
|
|
84
|
-
fontSize: 30,
|
|
85
|
-
fontWeight: 'bold',
|
|
86
|
-
color: '#fbbf24',
|
|
87
|
-
// Bright yellow for score
|
|
88
|
-
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
89
|
-
textShadowOffset: {
|
|
90
|
-
width: 1,
|
|
91
|
-
height: 1
|
|
92
|
-
},
|
|
93
|
-
textShadowRadius: 2
|
|
94
|
-
},
|
|
95
|
-
timeValue: {
|
|
96
|
-
fontSize: 30,
|
|
97
|
-
fontWeight: 'bold',
|
|
98
|
-
color: '#34d399',
|
|
99
|
-
// Bright green for time
|
|
100
|
-
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
101
|
-
textShadowOffset: {
|
|
102
|
-
width: 1,
|
|
103
|
-
height: 1
|
|
104
|
-
},
|
|
105
|
-
textShadowRadius: 2
|
|
106
|
-
},
|
|
107
|
-
livesContainer: {
|
|
108
|
-
flexDirection: 'row',
|
|
109
|
-
justifyContent: 'center'
|
|
110
|
-
},
|
|
111
|
-
lifeIcon: {
|
|
112
|
-
fontSize: 22,
|
|
113
|
-
marginHorizontal: 2
|
|
114
|
-
},
|
|
115
|
-
lifeActive: {
|
|
116
|
-
color: '#ef4444',
|
|
117
|
-
// Bright red for active lives
|
|
118
|
-
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
119
|
-
textShadowOffset: {
|
|
120
|
-
width: 1,
|
|
121
|
-
height: 1
|
|
122
|
-
},
|
|
123
|
-
textShadowRadius: 2
|
|
124
|
-
},
|
|
125
|
-
lifeInactive: {
|
|
126
|
-
color: '#374151',
|
|
127
|
-
// Dark gray for lost lives
|
|
128
|
-
textShadowColor: 'rgba(255,255,255,0.2)',
|
|
129
|
-
textShadowOffset: {
|
|
130
|
-
width: 1,
|
|
131
|
-
height: 1
|
|
132
|
-
},
|
|
133
|
-
textShadowRadius: 1
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
//# sourceMappingURL=ScoreBoard.js.map
|
|
1
|
+
"use strict";import React from 'react';import{View,Text,StyleSheet}from 'react-native';import{useSpaceFighterStore}from "../SpaceFighterStore.js";import{ScoreBoardContainer}from "../../../helpers/index.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const ScoreBoard = React.memo(({offset = 0})=>{const score = useSpaceFighterStore(state => state.score);const timeLeft = useSpaceFighterStore(state => state.timeLeft);const currentLives = useSpaceFighterStore(state => state.lives);const maxLives = 3;return _jsx(ScoreBoardContainer,{offset:offset,backgroundColor:"rgba(147,112,219,0.4)",borderColor:"rgba(139,92,246,0.3)",children:_jsxs(View,{style:styles.scoreBoard,children:[_jsxs(View,{style:styles.scoreItem,children:[_jsx(Text,{style:styles.scoreLabel,children:"Score"}),_jsx(Text,{style:styles.scoreValue,children:score})]}),_jsxs(View,{style:styles.scoreItem,children:[_jsx(Text,{style:styles.scoreLabel,children:"Time"}),_jsx(Text,{style:styles.timeValue,children:timeLeft})]}),_jsxs(View,{style:styles.scoreItem,children:[_jsx(Text,{style:styles.scoreLabel,children:"Lives"}),_jsx(View,{style:styles.livesContainer,children:Array.from({length:maxLives},(_,i)=> _jsx(Text,{style:[styles.lifeIcon,i < currentLives ? styles.lifeActive:styles.lifeInactive],children:i < currentLives ? '❤️':'🖤'},i))})]})]})});});const styles = StyleSheet.create({scoreBoard:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},scoreItem:{alignItems:'center',flex:1},scoreLabel:{fontSize:16,fontWeight:'bold',color:'#e2e8f0',marginBottom:6,textShadowColor:'rgba(0,0,0,0.5)',textShadowOffset:{width:1,height:1},textShadowRadius:2},scoreValue:{fontSize:25,fontWeight:'bold',color:'#fbbf24',textShadowColor:'rgba(0,0,0,0.5)',textShadowOffset:{width:1,height:1},textShadowRadius:2},timeValue:{fontSize:25,fontWeight:'bold',color:'#34d399',textShadowColor:'rgba(0,0,0,0.5)',textShadowOffset:{width:1,height:1},textShadowRadius:2},livesContainer:{flexDirection:'row',justifyContent:'center'},lifeIcon:{fontSize:22,marginHorizontal:2},lifeActive:{color:'#ef4444',textShadowColor:'rgba(0,0,0,0.5)',textShadowOffset:{width:1,height:1},textShadowRadius:2},lifeInactive:{color:'#374151',textShadowColor:'rgba(255,255,255,0.2)',textShadowOffset:{width:1,height:1},textShadowRadius:1}});
|
|
@@ -1,202 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useMemo } from 'react';
|
|
4
|
-
import { Canvas, Circle, Path, Skia, vec, Group, LinearGradient, RadialGradient } from '@shopify/react-native-skia';
|
|
5
|
-
import { View } from 'react-native';
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
// Highly optimized static Spacecraft3D component - no animations for maximum performance
|
|
8
|
-
export const Spacecraft3D = /*#__PURE__*/React.memo(({
|
|
9
|
-
spacecraft,
|
|
10
|
-
isControlled
|
|
11
|
-
}) => {
|
|
12
|
-
const size = spacecraft.size;
|
|
13
|
-
const canvasSize = size * 2; // Reduced canvas size for better performance
|
|
14
|
-
|
|
15
|
-
// Memoized static spacecraft paths - original design without animations
|
|
16
|
-
const spacecraftPaths = useMemo(() => {
|
|
17
|
-
const centerX = canvasSize / 2;
|
|
18
|
-
const centerY = canvasSize / 2;
|
|
19
|
-
|
|
20
|
-
// Main body path - original oval shape
|
|
21
|
-
const bodyPath = Skia.Path.Make();
|
|
22
|
-
const bodyWidth = size * 0.8;
|
|
23
|
-
const bodyHeight = size * 1.2;
|
|
24
|
-
bodyPath.addOval({
|
|
25
|
-
x: centerX - bodyWidth / 2,
|
|
26
|
-
y: centerY - bodyHeight / 2,
|
|
27
|
-
width: bodyWidth,
|
|
28
|
-
height: bodyHeight
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// Original wing paths
|
|
32
|
-
const leftWing = Skia.Path.Make();
|
|
33
|
-
const rightWing = Skia.Path.Make();
|
|
34
|
-
const wingWidth = size * 0.6;
|
|
35
|
-
const wingHeight = size * 0.3;
|
|
36
|
-
|
|
37
|
-
// Left wing (original design)
|
|
38
|
-
leftWing.moveTo(centerX - size * 0.3, centerY);
|
|
39
|
-
leftWing.lineTo(centerX - size * 0.3 - wingWidth, centerY - wingHeight / 2);
|
|
40
|
-
leftWing.lineTo(centerX - size * 0.3 - wingWidth * 0.8, centerY + wingHeight / 2);
|
|
41
|
-
leftWing.close();
|
|
42
|
-
|
|
43
|
-
// Right wing (original design)
|
|
44
|
-
rightWing.moveTo(centerX + size * 0.3, centerY);
|
|
45
|
-
rightWing.lineTo(centerX + size * 0.3 + wingWidth, centerY - wingHeight / 2);
|
|
46
|
-
rightWing.lineTo(centerX + size * 0.3 + wingWidth * 0.8, centerY + wingHeight / 2);
|
|
47
|
-
rightWing.close();
|
|
48
|
-
|
|
49
|
-
// Original cockpit
|
|
50
|
-
const cockpitPath = Skia.Path.Make();
|
|
51
|
-
const cockpitSize = size * 0.4;
|
|
52
|
-
cockpitPath.addOval({
|
|
53
|
-
x: centerX - cockpitSize / 2,
|
|
54
|
-
y: centerY - size * 0.4 - cockpitSize / 2,
|
|
55
|
-
width: cockpitSize,
|
|
56
|
-
height: cockpitSize * 0.8
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// Thruster flame paths - static flames
|
|
60
|
-
const leftFlame = Skia.Path.Make();
|
|
61
|
-
const rightFlame = Skia.Path.Make();
|
|
62
|
-
const flameLength = size * 0.4;
|
|
63
|
-
|
|
64
|
-
// Left thruster flame (triangular)
|
|
65
|
-
leftFlame.moveTo(centerX - size * 0.15, centerY + size * 0.5);
|
|
66
|
-
leftFlame.lineTo(centerX - size * 0.1, centerY + size * 0.5 + flameLength);
|
|
67
|
-
leftFlame.lineTo(centerX - size * 0.2, centerY + size * 0.5 + flameLength);
|
|
68
|
-
leftFlame.close();
|
|
69
|
-
|
|
70
|
-
// Right thruster flame (triangular)
|
|
71
|
-
rightFlame.moveTo(centerX + size * 0.15, centerY + size * 0.5);
|
|
72
|
-
rightFlame.lineTo(centerX + size * 0.2, centerY + size * 0.5 + flameLength);
|
|
73
|
-
rightFlame.lineTo(centerX + size * 0.1, centerY + size * 0.5 + flameLength);
|
|
74
|
-
rightFlame.close();
|
|
75
|
-
return {
|
|
76
|
-
bodyPath,
|
|
77
|
-
leftWing,
|
|
78
|
-
rightWing,
|
|
79
|
-
cockpitPath,
|
|
80
|
-
leftFlame,
|
|
81
|
-
rightFlame,
|
|
82
|
-
centerX,
|
|
83
|
-
centerY
|
|
84
|
-
};
|
|
85
|
-
}, [canvasSize, size]);
|
|
86
|
-
const {
|
|
87
|
-
bodyPath,
|
|
88
|
-
leftWing,
|
|
89
|
-
rightWing,
|
|
90
|
-
cockpitPath,
|
|
91
|
-
leftFlame,
|
|
92
|
-
rightFlame,
|
|
93
|
-
centerX,
|
|
94
|
-
centerY
|
|
95
|
-
} = spacecraftPaths;
|
|
96
|
-
return /*#__PURE__*/_jsx(View, {
|
|
97
|
-
style: {
|
|
98
|
-
position: 'absolute',
|
|
99
|
-
left: spacecraft.x - canvasSize / 2,
|
|
100
|
-
top: spacecraft.y - canvasSize / 2,
|
|
101
|
-
width: canvasSize,
|
|
102
|
-
height: canvasSize,
|
|
103
|
-
transform: [{
|
|
104
|
-
scale: isControlled ? 1.05 : 1
|
|
105
|
-
}] // Simple static scale for controlled state
|
|
106
|
-
},
|
|
107
|
-
children: /*#__PURE__*/_jsx(Canvas, {
|
|
108
|
-
style: {
|
|
109
|
-
width: canvasSize,
|
|
110
|
-
height: canvasSize
|
|
111
|
-
},
|
|
112
|
-
children: /*#__PURE__*/_jsxs(Group, {
|
|
113
|
-
children: [/*#__PURE__*/_jsx(Path, {
|
|
114
|
-
path: leftFlame,
|
|
115
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
116
|
-
start: vec(centerX - size * 0.15, centerY + size * 0.5),
|
|
117
|
-
end: vec(centerX - size * 0.15, centerY + size * 0.9),
|
|
118
|
-
colors: isControlled ? ['#ffffff', '#ffff00', '#ff6600', '#ff0000'] : ['#ffaa00', '#ff6600', '#cc4400', '#990000']
|
|
119
|
-
})
|
|
120
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
121
|
-
path: rightFlame,
|
|
122
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
123
|
-
start: vec(centerX + size * 0.15, centerY + size * 0.5),
|
|
124
|
-
end: vec(centerX + size * 0.15, centerY + size * 0.9),
|
|
125
|
-
colors: isControlled ? ['#ffffff', '#ffff00', '#ff6600', '#ff0000'] : ['#ffaa00', '#ff6600', '#cc4400', '#990000']
|
|
126
|
-
})
|
|
127
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
128
|
-
path: leftWing,
|
|
129
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
130
|
-
start: vec(centerX - size * 0.8, centerY - size * 0.2),
|
|
131
|
-
end: vec(centerX - size * 0.2, centerY + size * 0.2),
|
|
132
|
-
colors: isControlled ? ['#00ccff', '#0099cc', '#006699', '#003366'] : ['#0099cc', '#006699', '#003366', '#001133']
|
|
133
|
-
})
|
|
134
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
135
|
-
path: rightWing,
|
|
136
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
137
|
-
start: vec(centerX + size * 0.2, centerY - size * 0.2),
|
|
138
|
-
end: vec(centerX + size * 0.8, centerY + size * 0.2),
|
|
139
|
-
colors: isControlled ? ['#00ccff', '#0099cc', '#006699', '#003366'] : ['#0099cc', '#006699', '#003366', '#001133']
|
|
140
|
-
})
|
|
141
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
142
|
-
path: bodyPath,
|
|
143
|
-
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
144
|
-
start: vec(centerX - size * 0.4, centerY - size * 0.6),
|
|
145
|
-
end: vec(centerX + size * 0.4, centerY + size * 0.6),
|
|
146
|
-
colors: isControlled ? ['#00ffff', '#00d4ff', '#0099ff', '#0066cc', '#003399'] : ['#00d4ff', '#0099ff', '#0066cc', '#003399', '#001166']
|
|
147
|
-
})
|
|
148
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
149
|
-
path: cockpitPath,
|
|
150
|
-
children: /*#__PURE__*/_jsx(RadialGradient, {
|
|
151
|
-
c: vec(centerX, centerY - size * 0.4),
|
|
152
|
-
r: size * 0.3,
|
|
153
|
-
colors: ['rgba(255,255,255,0.8)', 'rgba(100,200,255,0.6)', 'rgba(0,100,200,0.8)']
|
|
154
|
-
})
|
|
155
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
156
|
-
cx: centerX - size * 0.15,
|
|
157
|
-
cy: centerY + size * 0.5,
|
|
158
|
-
r: size * 0.08,
|
|
159
|
-
children: /*#__PURE__*/_jsx(RadialGradient, {
|
|
160
|
-
c: vec(centerX - size * 0.15, centerY + size * 0.5),
|
|
161
|
-
r: size * 0.08,
|
|
162
|
-
colors: ['#ffffff', '#ffff00', '#ff6600', '#ff0000']
|
|
163
|
-
})
|
|
164
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
165
|
-
cx: centerX + size * 0.15,
|
|
166
|
-
cy: centerY + size * 0.5,
|
|
167
|
-
r: size * 0.08,
|
|
168
|
-
children: /*#__PURE__*/_jsx(RadialGradient, {
|
|
169
|
-
c: vec(centerX + size * 0.15, centerY + size * 0.5),
|
|
170
|
-
r: size * 0.08,
|
|
171
|
-
colors: ['#ffffff', '#ffff00', '#ff6600', '#ff0000']
|
|
172
|
-
})
|
|
173
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
174
|
-
cx: centerX - size * 0.8,
|
|
175
|
-
cy: centerY,
|
|
176
|
-
r: size * 0.06,
|
|
177
|
-
color: isControlled ? '#00ff00' : '#00cc00'
|
|
178
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
179
|
-
cx: centerX + size * 0.8,
|
|
180
|
-
cy: centerY,
|
|
181
|
-
r: size * 0.06,
|
|
182
|
-
color: isControlled ? '#ff0000' : '#cc0000'
|
|
183
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
184
|
-
cx: centerX,
|
|
185
|
-
cy: centerY,
|
|
186
|
-
r: size * 0.08,
|
|
187
|
-
children: /*#__PURE__*/_jsx(RadialGradient, {
|
|
188
|
-
c: vec(centerX, centerY),
|
|
189
|
-
r: size * 0.08,
|
|
190
|
-
colors: isControlled ? ['#ffffff', '#00ffff', '#0099ff'] : ['#cccccc', '#0099ff', '#006699']
|
|
191
|
-
})
|
|
192
|
-
}), /*#__PURE__*/_jsx(Circle, {
|
|
193
|
-
cx: centerX - size * 0.1,
|
|
194
|
-
cy: centerY - size * 0.45,
|
|
195
|
-
r: size * 0.08,
|
|
196
|
-
color: "rgba(255,255,255,0.8)"
|
|
197
|
-
})]
|
|
198
|
-
})
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
//# sourceMappingURL=Spacecraft3D.js.map
|
|
1
|
+
"use strict";import React,{useMemo}from 'react';import{Canvas,Circle,Path,Skia,vec,Group,LinearGradient,RadialGradient}from '@shopify/react-native-skia';import{View}from 'react-native';import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const Spacecraft3D = React.memo(({spacecraft,isControlled})=>{const size = spacecraft.size;const canvasSize = size * 2;const spacecraftPaths = useMemo(()=>{const centerX = canvasSize / 2;const centerY = canvasSize / 2;const bodyPath = Skia.Path.Make();const bodyWidth = size * 0.8;const bodyHeight = size * 1.2;bodyPath.addOval({x:centerX - bodyWidth / 2,y:centerY - bodyHeight / 2,width:bodyWidth,height:bodyHeight});const leftWing = Skia.Path.Make();const rightWing = Skia.Path.Make();const wingWidth = size * 0.6;const wingHeight = size * 0.3;leftWing.moveTo(centerX - size * 0.3,centerY);leftWing.lineTo(centerX - size * 0.3 - wingWidth,centerY - wingHeight / 2);leftWing.lineTo(centerX - size * 0.3 - wingWidth * 0.8,centerY + wingHeight / 2);leftWing.close();rightWing.moveTo(centerX + size * 0.3,centerY);rightWing.lineTo(centerX + size * 0.3 + wingWidth,centerY - wingHeight / 2);rightWing.lineTo(centerX + size * 0.3 + wingWidth * 0.8,centerY + wingHeight / 2);rightWing.close();const cockpitPath = Skia.Path.Make();const cockpitSize = size * 0.4;cockpitPath.addOval({x:centerX - cockpitSize / 2,y:centerY - size * 0.4 - cockpitSize / 2,width:cockpitSize,height:cockpitSize * 0.8});const leftFlame = Skia.Path.Make();const rightFlame = Skia.Path.Make();const flameLength = size * 0.4;leftFlame.moveTo(centerX - size * 0.15,centerY + size * 0.5);leftFlame.lineTo(centerX - size * 0.1,centerY + size * 0.5 + flameLength);leftFlame.lineTo(centerX - size * 0.2,centerY + size * 0.5 + flameLength);leftFlame.close();rightFlame.moveTo(centerX + size * 0.15,centerY + size * 0.5);rightFlame.lineTo(centerX + size * 0.2,centerY + size * 0.5 + flameLength);rightFlame.lineTo(centerX + size * 0.1,centerY + size * 0.5 + flameLength);rightFlame.close();return{bodyPath,leftWing,rightWing,cockpitPath,leftFlame,rightFlame,centerX,centerY};},[canvasSize,size]);const{bodyPath,leftWing,rightWing,cockpitPath,leftFlame,rightFlame,centerX,centerY}= spacecraftPaths;return _jsx(View,{style:{position:'absolute',left:spacecraft.x - canvasSize / 2,top:spacecraft.y - canvasSize / 2,width:canvasSize,height:canvasSize,transform:[{scale:isControlled ? 1.05:1}]},children:_jsx(Canvas,{style:{width:canvasSize,height:canvasSize},children:_jsxs(Group,{children:[_jsx(Path,{path:leftFlame,children:_jsx(LinearGradient,{start:vec(centerX - size * 0.15,centerY + size * 0.5),end:vec(centerX - size * 0.15,centerY + size * 0.9),colors:isControlled ? ['#ffffff','#ffff00','#ff6600','#ff0000']:['#ffaa00','#ff6600','#cc4400','#990000']})}),_jsx(Path,{path:rightFlame,children:_jsx(LinearGradient,{start:vec(centerX + size * 0.15,centerY + size * 0.5),end:vec(centerX + size * 0.15,centerY + size * 0.9),colors:isControlled ? ['#ffffff','#ffff00','#ff6600','#ff0000']:['#ffaa00','#ff6600','#cc4400','#990000']})}),_jsx(Path,{path:leftWing,children:_jsx(LinearGradient,{start:vec(centerX - size * 0.8,centerY - size * 0.2),end:vec(centerX - size * 0.2,centerY + size * 0.2),colors:isControlled ? ['#00ccff','#0099cc','#006699','#003366']:['#0099cc','#006699','#003366','#001133']})}),_jsx(Path,{path:rightWing,children:_jsx(LinearGradient,{start:vec(centerX + size * 0.2,centerY - size * 0.2),end:vec(centerX + size * 0.8,centerY + size * 0.2),colors:isControlled ? ['#00ccff','#0099cc','#006699','#003366']:['#0099cc','#006699','#003366','#001133']})}),_jsx(Path,{path:bodyPath,children:_jsx(LinearGradient,{start:vec(centerX - size * 0.4,centerY - size * 0.6),end:vec(centerX + size * 0.4,centerY + size * 0.6),colors:isControlled ? ['#00ffff','#00d4ff','#0099ff','#0066cc','#003399']:['#00d4ff','#0099ff','#0066cc','#003399','#001166']})}),_jsx(Path,{path:cockpitPath,children:_jsx(RadialGradient,{c:vec(centerX,centerY - size * 0.4),r:size * 0.3,colors:['rgba(255,255,255,0.8)','rgba(100,200,255,0.6)','rgba(0,100,200,0.8)']})}),_jsx(Circle,{cx:centerX - size * 0.15,cy:centerY + size * 0.5,r:size * 0.08,children:_jsx(RadialGradient,{c:vec(centerX - size * 0.15,centerY + size * 0.5),r:size * 0.08,colors:['#ffffff','#ffff00','#ff6600','#ff0000']})}),_jsx(Circle,{cx:centerX + size * 0.15,cy:centerY + size * 0.5,r:size * 0.08,children:_jsx(RadialGradient,{c:vec(centerX + size * 0.15,centerY + size * 0.5),r:size * 0.08,colors:['#ffffff','#ffff00','#ff6600','#ff0000']})}),_jsx(Circle,{cx:centerX - size * 0.8,cy:centerY,r:size * 0.06,color:isControlled ? '#00ff00':'#00cc00'}),_jsx(Circle,{cx:centerX + size * 0.8,cy:centerY,r:size * 0.06,color:isControlled ? '#ff0000':'#cc0000'}),_jsx(Circle,{cx:centerX,cy:centerY,r:size * 0.08,children:_jsx(RadialGradient,{c:vec(centerX,centerY),r:size * 0.08,colors:isControlled ? ['#ffffff','#00ffff','#0099ff']:['#cccccc','#0099ff','#006699']})}),_jsx(Circle,{cx:centerX - size * 0.1,cy:centerY - size * 0.45,r:size * 0.08,color:"rgba(255,255,255,0.8)"})]})})});});
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useMemo } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
5
|
-
import { COLORS } from "../SpaceFighterService.js";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
// Optimized SpacecraftPath with performance improvements
|
|
8
|
-
export const SpacecraftPath = /*#__PURE__*/React.memo(({
|
|
9
|
-
path
|
|
10
|
-
}) => {
|
|
11
|
-
// Early return for performance
|
|
12
|
-
if (path.length < 2) return null;
|
|
13
|
-
|
|
14
|
-
// Memoize path points to prevent recalculation on every render
|
|
15
|
-
const pathPoints = useMemo(() => {
|
|
16
|
-
return path.slice(1).map((point, index) => ({
|
|
17
|
-
key: `path-${index}`,
|
|
18
|
-
x: point.x - 2,
|
|
19
|
-
y: point.y - 2,
|
|
20
|
-
opacity: (index + 1) / path.length * 0.5
|
|
21
|
-
}));
|
|
22
|
-
}, [path]);
|
|
23
|
-
return /*#__PURE__*/_jsx(View, {
|
|
24
|
-
style: styles.container,
|
|
25
|
-
children: pathPoints.map(point => /*#__PURE__*/_jsx(View, {
|
|
26
|
-
style: [styles.pathPoint, {
|
|
27
|
-
left: point.x,
|
|
28
|
-
top: point.y,
|
|
29
|
-
opacity: point.opacity
|
|
30
|
-
}]
|
|
31
|
-
}, point.key))
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Optimized styles using StyleSheet
|
|
36
|
-
const styles = StyleSheet.create({
|
|
37
|
-
container: {
|
|
38
|
-
position: 'absolute',
|
|
39
|
-
top: 0,
|
|
40
|
-
left: 0,
|
|
41
|
-
right: 0,
|
|
42
|
-
bottom: 0
|
|
43
|
-
},
|
|
44
|
-
pathPoint: {
|
|
45
|
-
position: 'absolute',
|
|
46
|
-
width: 4,
|
|
47
|
-
height: 4,
|
|
48
|
-
borderRadius: 2,
|
|
49
|
-
backgroundColor: COLORS.SPACECRAFT
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=SpacecraftPath.js.map
|
|
1
|
+
"use strict";import React,{useMemo}from 'react';import{View,StyleSheet}from 'react-native';import{COLORS}from "../SpaceFighterService.js";import{jsx as _jsx}from "react/jsx-runtime";export const SpacecraftPath = React.memo(({path})=>{if(path.length < 2)return null;const pathPoints = useMemo(()=>{return path.slice(1).map((point,index)=>({key:`path-${index}`,x:point.x - 2,y:point.y - 2,opacity:(index + 1)/ path.length * 0.5}));},[path]);return _jsx(View,{style:styles.container,children:pathPoints.map(point => _jsx(View,{style:[styles.pathPoint,{left:point.x,top:point.y,opacity:point.opacity}]},point.key))});});const styles = StyleSheet.create({container:{position:'absolute',top:0,left:0,right:0,bottom:0},pathPoint:{position:'absolute',width:4,height:4,borderRadius:2,backgroundColor:COLORS.SPACECRAFT}});
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export { ScoreBoard } from "./ScoreBoard.js";
|
|
4
|
-
export { AsteroidComponent } from "./AsteroidComponent.js";
|
|
5
|
-
export { Spacecraft3D } from "./Spacecraft3D.js";
|
|
6
|
-
export { SpacecraftPath } from "./SpacecraftPath.js";
|
|
7
|
-
export { GameArea } from "./GameArea.js";
|
|
8
|
-
export { GameBackground } from "./GameBackground.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export{ScoreBoard}from "./ScoreBoard.js";export{AsteroidComponent}from "./AsteroidComponent.js";export{Spacecraft3D}from "./Spacecraft3D.js";export{SpacecraftPath}from "./SpacecraftPath.js";export{GameArea}from "./GameArea.js";export{GameBackground}from "./GameBackground.js";
|