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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useCallback","useMemo","View","StyleSheet","Dimensions","GestureHandlerRootView","useSpaceFighterStore","createSpaceFighterService","getDifficultySettings","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","jsx","_jsx","jsxs","_jsxs","width","height","get","SpaceFighter","settings","onSettingsChange","difficulty","isPlaying","state","gameOver","score","setOffset","startGame","stopGame","resetGame","decrementTime","addAsteroids","removeAsteroid","updateAsteroid","updateSpacecraft","offset","wrapFunction","safeExecute","SPACE_FIGHTER","gameService","INITIALIZATION_ERROR","handleResetGame","cleanup","difficultySettings","handleStartGame","updateDifficultySettings","asteroidSpeed","asteroidSpawnInterval","startGameTimer","startAsteroidSpawning","startPhysicsLoop","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useCallback","useMemo","View","StyleSheet","Dimensions","GestureHandlerRootView","useSpaceFighterStore","createSpaceFighterService","getDifficultySettings","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","jsx","_jsx","jsxs","_jsxs","width","height","get","SpaceFighter","settings","onSettingsChange","onEndGame","difficulty","isPlaying","state","gameOver","score","gameReportedRef","useRef","reportGameEnd","status","current","currentState","getState","toString","setOffset","startGame","stopGame","resetGame","decrementTime","addAsteroids","removeAsteroid","updateAsteroid","updateSpacecraft","offset","wrapFunction","safeExecute","SPACE_FIGHTER","gameService","INITIALIZATION_ERROR","handleResetGame","cleanup","lives","difficultySettings","handleStartGame","updateDifficultySettings","asteroidSpeed","asteroidSpawnInterval","startGameTimer","startAsteroidSpawning","startPhysicsLoop","spacecraft","asteroids","handleStopGame","UNKNOWN_ERROR","initialSpacecraft","getInitialSpacecraft","gameControlButtonProps","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","buttonTextColor","gameSettingsModalProps","gameId","style","styles","container","children","create","flex"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighter.tsx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AEvC,MAAMqC,sBAAsB,GAAG9F,OAAO,CAAC,OAAO;IAC5C+F,MAAM,EAAE/E,QAAQ,CAACsC,aAAa;IAC9B5B,QAAQ,EAAEA,QAAQ,IAAIT,qBAAqB;IAC3CU;EACF,CAAC,CAAC,EAAE,CAACD,QAAQ,EAAEC,gBAAgB,CAAC,CAAC;EAEjC,oBACER,IAAA,CAAClB,IAAI;IAAC+F,KAAK,EAAEC,MAAM,CAACC,SAAU;IAAAC,QAAA,eAC5BhF,IAAA,CAACf,sBAAsB;MAAA+F,QAAA,eACrB9E,KAAA,CAACX,cAAc;QAAAyF,QAAA,gBAEbhF,IAAA,CAACV,QAAQ,IAAE,CAAC,eAEZU,IAAA,CAACX,UAAU;UAAC2C,MAAM,EAAEA;QAAO,CAAE,CAAC,eAG9BhC,IAAA,CAACR,iBAAiB;UAAA,GAAK+D;QAAsB,CAAG,CAAC,eAEjDvD,IAAA,CAACP,aAAa;UAAA,GAAKyE;QAAkB,CAAG,CAAC,eAGzClE,IAAA,CAACJ,iBAAiB;UAAA,GAAK+E;QAAsB,CAAG,CAAC;MAAA,CACnC;IAAC,CACK;EAAC,CACrB,CAAC;AAEX,CAAC;AAED,MAAMG,MAAM,GAAG/F,UAAU,CAACkG,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,108 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// Space Fighter Settings Interface
|
|
4
|
-
|
|
5
|
-
// Space Fighter Difficulty Configuration
|
|
6
|
-
export const SPACE_FIGHTER_DIFFICULTY_CONFIG = {
|
|
7
|
-
easy: {
|
|
8
|
-
gameDuration: 60,
|
|
9
|
-
asteroidSpawnInterval: 4000,
|
|
10
|
-
// Slower spawn rate
|
|
11
|
-
asteroidSpeed: 1.5 // Slower asteroids
|
|
12
|
-
},
|
|
13
|
-
medium: {
|
|
14
|
-
gameDuration: 60,
|
|
15
|
-
asteroidSpawnInterval: 3000,
|
|
16
|
-
// Balanced spawn rate
|
|
17
|
-
asteroidSpeed: 2 // Normal speed
|
|
18
|
-
},
|
|
19
|
-
hard: {
|
|
20
|
-
gameDuration: 60,
|
|
21
|
-
asteroidSpawnInterval: 2000,
|
|
22
|
-
// Faster spawn rate
|
|
23
|
-
asteroidSpeed: 3 // Faster asteroids for challenge
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Helper function to get difficulty settings
|
|
28
|
-
export const getDifficultySettings = difficulty => {
|
|
29
|
-
return SPACE_FIGHTER_DIFFICULTY_CONFIG[difficulty];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Default Space Fighter Settings
|
|
33
|
-
export const DEFAULT_SPACE_FIGHTER_SETTINGS = {
|
|
34
|
-
difficulty: 'medium',
|
|
35
|
-
soundEnabled: true,
|
|
36
|
-
hapticEnabled: true,
|
|
37
|
-
gameDuration: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.gameDuration,
|
|
38
|
-
asteroidSpawnInterval: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpawnInterval,
|
|
39
|
-
asteroidSpeed: SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpeed
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
// Space Fighter Game Constants
|
|
43
|
-
export const SPACE_FIGHTER_GAME_CONFIG = {
|
|
44
|
-
GAME_DURATION: 120,
|
|
45
|
-
// seconds
|
|
46
|
-
SPACECRAFT_SIZE: 28,
|
|
47
|
-
// Increased from 20 for better visibility
|
|
48
|
-
SPACECRAFT_SPEED: 3,
|
|
49
|
-
ASTEROID_WIDTH: 80,
|
|
50
|
-
ASTEROID_GAP: 120,
|
|
51
|
-
// Increased gap between asteroid pairs for easier navigation
|
|
52
|
-
ASTEROID_SPAWN_INTERVAL: 3000,
|
|
53
|
-
// Increased from 2000ms to 3500ms for better spacing
|
|
54
|
-
ASTEROID_SPEED: 2,
|
|
55
|
-
GRAVITY: 0.3,
|
|
56
|
-
BOUNCE_DAMPING: 0.7,
|
|
57
|
-
FRICTION: 0.98,
|
|
58
|
-
MAX_VELOCITY: 8,
|
|
59
|
-
COLLISION_TOLERANCE: 2,
|
|
60
|
-
COLLISION_COOLDOWN: 2000 // 2 seconds between collisions
|
|
61
|
-
};
|
|
62
|
-
export const SPACE_FIGHTER_COLORS = {
|
|
63
|
-
BACKGROUND: '#0a0a1a',
|
|
64
|
-
// Deep space black
|
|
65
|
-
SPACECRAFT: '#00d4ff',
|
|
66
|
-
// Bright cyan for spacecraft
|
|
67
|
-
ASTEROID: '#8b4513',
|
|
68
|
-
// Brown for asteroids
|
|
69
|
-
ASTEROID_SHADOW: '#654321',
|
|
70
|
-
// Darker brown shadow
|
|
71
|
-
SCORE: '#ffd700',
|
|
72
|
-
// Gold for score
|
|
73
|
-
UI: '#9370db',
|
|
74
|
-
// Purple for UI elements
|
|
75
|
-
STARS: '#ffffff' // White for stars
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Space Fighter Game Theme - Matches scoreboard purple
|
|
79
|
-
export const SPACE_FIGHTER_THEME = {
|
|
80
|
-
backgroundColor: '#1a1b3a',
|
|
81
|
-
// Lighter space purple for better visibility in modal
|
|
82
|
-
headerBackgroundColor: 'rgba(147, 112, 219, 0.9)',
|
|
83
|
-
// Purple header to match scoreboard
|
|
84
|
-
headerTextColor: '#ffffff',
|
|
85
|
-
sectionBackgroundColor: 'rgba(147, 112, 219, 0.4)',
|
|
86
|
-
// Match scoreboard transparency
|
|
87
|
-
sectionTitleColor: '#ffffff',
|
|
88
|
-
// White text on purple sections
|
|
89
|
-
buttonSelectedColor: '#9370db',
|
|
90
|
-
// Match start button purple
|
|
91
|
-
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
92
|
-
buttonSelectedTextColor: '#ffffff',
|
|
93
|
-
buttonUnselectedTextColor: '#ffffff',
|
|
94
|
-
// White text for space theme
|
|
95
|
-
switchTrackColorFalse: 'rgba(147, 112, 219, 0.5)',
|
|
96
|
-
switchTrackColorTrue: '#9370db',
|
|
97
|
-
// Match start button
|
|
98
|
-
switchThumbColor: '#ffffff',
|
|
99
|
-
infoTextColor: '#ffffff' // White text for readability on dark background
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Space Fighter Difficulty Descriptions
|
|
103
|
-
export const SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS = {
|
|
104
|
-
easy: 'Slow asteroids, relaxed gameplay',
|
|
105
|
-
medium: 'Normal asteroid speed, balanced challenge',
|
|
106
|
-
hard: 'Fast asteroids, quick reflexes needed!'
|
|
107
|
-
};
|
|
108
|
-
//# sourceMappingURL=SpaceFighterConstants.js.map
|
|
1
|
+
"use strict";export const SPACE_FIGHTER_DIFFICULTY_CONFIG ={easy:{gameDuration:60,asteroidSpawnInterval:4000,asteroidSpeed:1.5},medium:{gameDuration:60,asteroidSpawnInterval:3000,asteroidSpeed:2},hard:{gameDuration:60,asteroidSpawnInterval:2000,asteroidSpeed:3}};export const getDifficultySettings = difficulty =>{return SPACE_FIGHTER_DIFFICULTY_CONFIG[difficulty];};export const DEFAULT_SPACE_FIGHTER_SETTINGS ={difficulty:'medium',soundEnabled:true,hapticEnabled:true,gameDuration:SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.gameDuration,asteroidSpawnInterval:SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpawnInterval,asteroidSpeed:SPACE_FIGHTER_DIFFICULTY_CONFIG.medium.asteroidSpeed};export const SPACE_FIGHTER_GAME_CONFIG ={GAME_DURATION:120,SPACECRAFT_SIZE:28,SPACECRAFT_SPEED:3,ASTEROID_WIDTH:80,ASTEROID_GAP:120,ASTEROID_SPAWN_INTERVAL:3000,ASTEROID_SPEED:2,GRAVITY:0.3,BOUNCE_DAMPING:0.7,FRICTION:0.98,MAX_VELOCITY:8,COLLISION_TOLERANCE:2,COLLISION_COOLDOWN:2000};export const SPACE_FIGHTER_COLORS ={BACKGROUND:'#0a0a1a',SPACECRAFT:'#00d4ff',ASTEROID:'#8b4513',ASTEROID_SHADOW:'#654321',SCORE:'#ffd700',UI:'#9370db',STARS:'#ffffff'};export const SPACE_FIGHTER_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#9370db',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(147,112,219,0.15)',sectionTitleColor:'#9370db',buttonSelectedColor:'#9370db',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(147,112,219,0.3)',switchTrackColorTrue:'#9370db',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS ={easy:'Slow asteroids,relaxed gameplay',medium:'Normal asteroid speed,balanced challenge',hard:'Fast asteroids,quick reflexes needed!'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SPACE_FIGHTER_DIFFICULTY_CONFIG","easy","gameDuration","asteroidSpawnInterval","asteroidSpeed","medium","hard","getDifficultySettings","difficulty","DEFAULT_SPACE_FIGHTER_SETTINGS","soundEnabled","hapticEnabled","SPACE_FIGHTER_GAME_CONFIG","GAME_DURATION","SPACECRAFT_SIZE","SPACECRAFT_SPEED","ASTEROID_WIDTH","ASTEROID_GAP","ASTEROID_SPAWN_INTERVAL","ASTEROID_SPEED","GRAVITY","BOUNCE_DAMPING","FRICTION","MAX_VELOCITY","COLLISION_TOLERANCE","COLLISION_COOLDOWN","SPACE_FIGHTER_COLORS","BACKGROUND","SPACECRAFT","ASTEROID","ASTEROID_SHADOW","SCORE","UI","STARS","SPACE_FIGHTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighterConstants.ts"],"mappings":";;AAEA;;AAUA;AACA,OAAO,MAAMA,+BAA+B,GAAG;EAC7CC,IAAI,EAAE;IACJC,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,GAAG,CAAE;EACtB,CAAC;EACDC,MAAM,EAAE;IACNH,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,CAAC,CAAE;EACpB,CAAC;EACDE,IAAI,EAAE;IACJJ,YAAY,EAAE,EAAE;IAChBC,qBAAqB,EAAE,IAAI;IAAE;IAC7BC,aAAa,EAAE,CAAC,CAAE;EACpB;AACF,CAAU;;AAEV;AACA,OAAO,MAAMG,qBAAqB,GAAIC,UAAsC,IAAK;EAC/E,OAAOR,+BAA+B,CAACQ,UAAU,CAAC;AACpD,CAAC;;AAED;AACA,OAAO,MAAMC,8BAAoD,GAAG;EAClED,UAAU,EAAE,QAAQ;EACpBE,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBT,YAAY,EAAEF,+BAA+B,CAACK,MAAM,CAACH,YAAY;EACjEC,qBAAqB,EAAEH,+BAA+B,CAACK,MAAM,CAACF,qBAAqB;EACnFC,aAAa,EAAEJ,+BAA+B,CAACK,MAAM,CAACD;AACxD,CAAC;;AAED;AACA,OAAO,MAAMQ,yBAAyB,GAAG;EACvCC,aAAa,EAAE,GAAG;EAAE;EACpBC,eAAe,EAAE,EAAE;EAAE;EACrBC,gBAAgB,EAAE,CAAC;EACnBC,cAAc,EAAE,EAAE;EAClBC,YAAY,EAAE,GAAG;EAAE;EACnBC,uBAAuB,EAAE,IAAI;EAAE;EAC/BC,cAAc,EAAE,CAAC;EACjBC,OAAO,EAAE,GAAG;EACZC,cAAc,EAAE,GAAG;EACnBC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,kBAAkB,EAAE,IAAI,CAAC;AAC3B,CAAU;AAEV,OAAO,MAAMC,oBAAoB,GAAG;EAClCC,UAAU,EAAE,SAAS;EAAE;EACvBC,UAAU,EAAE,SAAS;EAAE;EACvBC,QAAQ,EAAE,SAAS;EAAE;EACrBC,eAAe,EAAE,SAAS;EAAE;EAC5BC,KAAK,EAAE,SAAS;EAAE;EAClBC,EAAE,EAAE,SAAS;EAAE;EACfC,KAAK,EAAE,SAAS,CAAC;AACnB,CAAU;;AAEV;AACA,OAAO,MAAMC,mBAAsC,GAAG;EACpDC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"names":["SPACE_FIGHTER_DIFFICULTY_CONFIG","easy","gameDuration","asteroidSpawnInterval","asteroidSpeed","medium","hard","getDifficultySettings","difficulty","DEFAULT_SPACE_FIGHTER_SETTINGS","soundEnabled","hapticEnabled","SPACE_FIGHTER_GAME_CONFIG","GAME_DURATION","SPACECRAFT_SIZE","SPACECRAFT_SPEED","ASTEROID_WIDTH","ASTEROID_GAP","ASTEROID_SPAWN_INTERVAL","ASTEROID_SPEED","GRAVITY","BOUNCE_DAMPING","FRICTION","MAX_VELOCITY","COLLISION_TOLERANCE","COLLISION_COOLDOWN","SPACE_FIGHTER_COLORS","BACKGROUND","SPACECRAFT","ASTEROID","ASTEROID_SHADOW","SCORE","UI","STARS","SPACE_FIGHTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","SPACE_FIGHTER_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/space-fighter/SpaceFighterConstants.ts"],"mappings":";;AAEA;;AAUA;AACA,OAAO,MAAMA,+BAA+B,GAAG;EAC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SAAS;EAAE;EACvBC,UAAU,EAAE,SAAS;EAAE;EACvBC,QAAQ,EAAE,SAAS;EAAE;EACrBC,eAAe,EAAE,SAAS;EAAE;EAC5BC,KAAK,EAAE,SAAS;EAAE;EAClBC,EAAE,EAAE,SAAS;EAAE;EACfC,KAAK,EAAE,SAAS,CAAC;AACnB,CAAU;;AAEV;AACA,OAAO,MAAMC,mBAAsC,GAAG;EACpDC,eAAe,EAAE,oBAAoB;EAAE;EACvCC,qBAAqB,EAAE,SAAS;EAAE;EAClCC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,2BAA2B;EAAE;EACrDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,0BAA0B;EAAE;EACvDC,qBAAqB,EAAE,0BAA0B;EACjDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,0BAA0B,CAAE;AAC7C,CAAC;;AAED;AACA,OAAO,MAAMC,qCAAqC,GAAG;EACnD/C,IAAI,EAAE,kCAAkC;EACxCI,MAAM,EAAE,2CAA2C;EACnDC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
|
|
@@ -1,326 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { SPACE_FIGHTER_GAME_CONFIG as GAME_CONFIG, SPACE_FIGHTER_COLORS as COLORS } from "./SpaceFighterConstants.js";
|
|
4
|
-
|
|
5
|
-
// Constants now imported from SpaceFighterConstants.ts
|
|
6
|
-
// Re-export for backward compatibility
|
|
7
|
-
export { GAME_CONFIG, COLORS };
|
|
8
|
-
|
|
9
|
-
// Asteroid Types (space obstacles)
|
|
10
|
-
|
|
11
|
-
// Game Service Class
|
|
12
|
-
class SpaceFighterGameService {
|
|
13
|
-
gameTimer = null;
|
|
14
|
-
asteroidSpawnTimer = null;
|
|
15
|
-
physicsTimer = null;
|
|
16
|
-
particles = [];
|
|
17
|
-
lastCollisionTime = 0;
|
|
18
|
-
currentAsteroidSpeed = GAME_CONFIG.ASTEROID_SPEED;
|
|
19
|
-
currentSpawnInterval = GAME_CONFIG.ASTEROID_SPAWN_INTERVAL;
|
|
20
|
-
constructor(screenWidth, screenHeight) {
|
|
21
|
-
this.width = screenWidth;
|
|
22
|
-
this.height = screenHeight;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// Game Control
|
|
26
|
-
startGame() {
|
|
27
|
-
this.cleanup();
|
|
28
|
-
}
|
|
29
|
-
cleanup() {
|
|
30
|
-
if (this.gameTimer) {
|
|
31
|
-
clearInterval(this.gameTimer);
|
|
32
|
-
this.gameTimer = null;
|
|
33
|
-
}
|
|
34
|
-
if (this.asteroidSpawnTimer) {
|
|
35
|
-
clearInterval(this.asteroidSpawnTimer);
|
|
36
|
-
this.asteroidSpawnTimer = null;
|
|
37
|
-
}
|
|
38
|
-
if (this.physicsTimer) {
|
|
39
|
-
clearInterval(this.physicsTimer);
|
|
40
|
-
this.physicsTimer = null;
|
|
41
|
-
}
|
|
42
|
-
this.particles = [];
|
|
43
|
-
this.lastCollisionTime = 0; // Reset collision cooldown
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Timer Management
|
|
47
|
-
startGameTimer(decrementTime) {
|
|
48
|
-
this.gameTimer = setInterval(decrementTime, 1000);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Method to update difficulty settings
|
|
52
|
-
updateDifficultySettings(asteroidSpeed, spawnInterval) {
|
|
53
|
-
this.currentAsteroidSpeed = asteroidSpeed;
|
|
54
|
-
this.currentSpawnInterval = spawnInterval;
|
|
55
|
-
}
|
|
56
|
-
startAsteroidSpawning(spawnAsteroid) {
|
|
57
|
-
// Spawn first asteroid pair immediately
|
|
58
|
-
const initialAsteroids = this.generateAsteroidPair();
|
|
59
|
-
spawnAsteroid(initialAsteroids);
|
|
60
|
-
|
|
61
|
-
// Then continue spawning at regular intervals using dynamic spawn interval
|
|
62
|
-
this.asteroidSpawnTimer = setInterval(() => {
|
|
63
|
-
const asteroids = this.generateAsteroidPair();
|
|
64
|
-
spawnAsteroid(asteroids);
|
|
65
|
-
}, this.currentSpawnInterval);
|
|
66
|
-
}
|
|
67
|
-
startPhysicsLoop(updateSpacecraft, updateAsteroid, removeAsteroid, getSpacecraft, getAsteroids) {
|
|
68
|
-
this.physicsTimer = setInterval(() => {
|
|
69
|
-
this.updatePhysics(updateSpacecraft, updateAsteroid, removeAsteroid, getSpacecraft, getAsteroids);
|
|
70
|
-
}, 16); // ~60 FPS
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Asteroid Generation - Horizontal asteroids for portrait mode
|
|
74
|
-
generateAsteroidPair() {
|
|
75
|
-
const pairId = `asteroid_pair_${Date.now()}_${Math.random()}`;
|
|
76
|
-
// Make gap position truly random across 80% of screen width for better gameplay
|
|
77
|
-
const minGapX = this.width * 0.1; // 10% from left edge
|
|
78
|
-
const maxGapX = this.width * 0.9 - GAME_CONFIG.ASTEROID_GAP; // 10% from right edge
|
|
79
|
-
const gapX = Math.random() * (maxGapX - minGapX) + minGapX;
|
|
80
|
-
const leftAsteroid = {
|
|
81
|
-
id: `${pairId}_left`,
|
|
82
|
-
x: 0,
|
|
83
|
-
y: -250,
|
|
84
|
-
// Start well above screen (200px above)
|
|
85
|
-
width: gapX,
|
|
86
|
-
height: GAME_CONFIG.ASTEROID_WIDTH,
|
|
87
|
-
type: 'left',
|
|
88
|
-
pairId,
|
|
89
|
-
passed: false,
|
|
90
|
-
spawnTime: Date.now()
|
|
91
|
-
};
|
|
92
|
-
const rightAsteroid = {
|
|
93
|
-
id: `${pairId}_right`,
|
|
94
|
-
x: gapX + GAME_CONFIG.ASTEROID_GAP,
|
|
95
|
-
y: -250,
|
|
96
|
-
// Start well above screen (200px above)
|
|
97
|
-
width: this.width - (gapX + GAME_CONFIG.ASTEROID_GAP),
|
|
98
|
-
height: GAME_CONFIG.ASTEROID_WIDTH,
|
|
99
|
-
type: 'right',
|
|
100
|
-
pairId,
|
|
101
|
-
passed: false,
|
|
102
|
-
spawnTime: Date.now()
|
|
103
|
-
};
|
|
104
|
-
return [leftAsteroid, rightAsteroid];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Physics Update
|
|
108
|
-
updatePhysics(updateSpacecraft, updateAsteroid, removeAsteroid, getSpacecraft, getAsteroids) {
|
|
109
|
-
const spacecraft = getSpacecraft();
|
|
110
|
-
const asteroids = getAsteroids();
|
|
111
|
-
|
|
112
|
-
// Update spacecraft physics - Horizontal movement only, Y position locked
|
|
113
|
-
let newSpacecraft = {
|
|
114
|
-
...spacecraft
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// Spacecraft never moves vertically - Y position is always locked to current position
|
|
118
|
-
// The store manages the Y position based on offset, so we just maintain it
|
|
119
|
-
newSpacecraft.y = spacecraft.y; // Keep Y position as set by store
|
|
120
|
-
newSpacecraft.velocityY = 0;
|
|
121
|
-
|
|
122
|
-
// Only allow horizontal movement when being controlled
|
|
123
|
-
if (!newSpacecraft.isControlled) {
|
|
124
|
-
// Stop horizontal movement when not being controlled
|
|
125
|
-
newSpacecraft.velocityX = 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Horizontal boundary constraints only
|
|
129
|
-
if (newSpacecraft.x <= newSpacecraft.size / 2) {
|
|
130
|
-
newSpacecraft.x = newSpacecraft.size / 2;
|
|
131
|
-
newSpacecraft.velocityX = 0;
|
|
132
|
-
}
|
|
133
|
-
if (newSpacecraft.x >= this.width - newSpacecraft.size / 2) {
|
|
134
|
-
newSpacecraft.x = this.width - newSpacecraft.size / 2;
|
|
135
|
-
newSpacecraft.velocityX = 0;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Y position is always forced to correct position - never changes
|
|
139
|
-
|
|
140
|
-
updateSpacecraft(newSpacecraft);
|
|
141
|
-
|
|
142
|
-
// Update asteroids - move vertically from top to bottom using dynamic speed
|
|
143
|
-
// Optimized: Use for-loop instead of forEach for better performance
|
|
144
|
-
for (let i = 0; i < asteroids.length; i++) {
|
|
145
|
-
const asteroid = asteroids[i];
|
|
146
|
-
if (!asteroid) continue; // Safety check for undefined asteroid
|
|
147
|
-
|
|
148
|
-
const newY = asteroid.y + this.currentAsteroidSpeed;
|
|
149
|
-
if (newY > this.height) {
|
|
150
|
-
removeAsteroid(asteroid.id);
|
|
151
|
-
} else {
|
|
152
|
-
updateAsteroid(asteroid.id, {
|
|
153
|
-
y: newY
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Update particles
|
|
159
|
-
this.updateParticles();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Spacecraft Control - Direct horizontal drag movement
|
|
163
|
-
controlSpacecraft(spacecraft, targetX, _targetY) {
|
|
164
|
-
// Direct movement - spacecraft follows finger immediately for responsive drag
|
|
165
|
-
// Constrain X position to screen bounds
|
|
166
|
-
const minX = spacecraft.size / 2;
|
|
167
|
-
const maxX = this.width - spacecraft.size / 2;
|
|
168
|
-
const constrainedX = Math.max(minX, Math.min(maxX, targetX));
|
|
169
|
-
return {
|
|
170
|
-
...spacecraft,
|
|
171
|
-
x: constrainedX,
|
|
172
|
-
y: spacecraft.y,
|
|
173
|
-
// Explicitly maintain Y position - no vertical movement
|
|
174
|
-
velocityX: 0,
|
|
175
|
-
velocityY: 0,
|
|
176
|
-
isControlled: true
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
releaseSpacecraft(spacecraft) {
|
|
180
|
-
// Return a new spacecraft object instead of mutating
|
|
181
|
-
return {
|
|
182
|
-
...spacecraft,
|
|
183
|
-
isControlled: false
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Collision Detection with 5-second cooldown
|
|
188
|
-
checkCollision(spacecraft, asteroids) {
|
|
189
|
-
const currentTime = Date.now();
|
|
190
|
-
|
|
191
|
-
// Check if we're still in collision cooldown period
|
|
192
|
-
if (currentTime - this.lastCollisionTime < GAME_CONFIG.COLLISION_COOLDOWN) {
|
|
193
|
-
return {
|
|
194
|
-
collision: false
|
|
195
|
-
}; // Immunity period - no collision detected
|
|
196
|
-
}
|
|
197
|
-
for (const asteroid of asteroids) {
|
|
198
|
-
if (this.spacecraftAsteroidCollision(spacecraft, asteroid)) {
|
|
199
|
-
this.lastCollisionTime = currentTime; // Record collision time
|
|
200
|
-
return {
|
|
201
|
-
collision: true,
|
|
202
|
-
asteroidId: asteroid.id
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return {
|
|
207
|
-
collision: false
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
spacecraftAsteroidCollision(spacecraft, asteroid) {
|
|
211
|
-
const spacecraftLeft = spacecraft.x - spacecraft.size / 2;
|
|
212
|
-
const spacecraftRight = spacecraft.x + spacecraft.size / 2;
|
|
213
|
-
const spacecraftTop = spacecraft.y - spacecraft.size / 2;
|
|
214
|
-
const spacecraftBottom = spacecraft.y + spacecraft.size / 2;
|
|
215
|
-
const asteroidLeft = asteroid.x;
|
|
216
|
-
const asteroidRight = asteroid.x + asteroid.width;
|
|
217
|
-
const asteroidTop = asteroid.y;
|
|
218
|
-
const asteroidBottom = asteroid.y + asteroid.height;
|
|
219
|
-
return spacecraftRight > asteroidLeft && spacecraftLeft < asteroidRight && spacecraftBottom > asteroidTop && spacecraftTop < asteroidBottom;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Scoring - Updated for horizontal asteroids moving vertically
|
|
223
|
-
checkAsteroidPass(spacecraft, asteroids) {
|
|
224
|
-
const passedAsteroids = [];
|
|
225
|
-
|
|
226
|
-
// Optimized: Use for-loop instead of forEach for better performance
|
|
227
|
-
for (let i = 0; i < asteroids.length; i++) {
|
|
228
|
-
const asteroid = asteroids[i];
|
|
229
|
-
if (!asteroid) continue; // Safety check for undefined asteroid
|
|
230
|
-
|
|
231
|
-
if (!asteroid.passed && spacecraft.y > asteroid.y + asteroid.height) {
|
|
232
|
-
passedAsteroids.push(asteroid.pairId);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return passedAsteroids;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Particles - Enhanced collision particles for dramatic effect
|
|
239
|
-
createCollisionParticles(x, y) {
|
|
240
|
-
// Create more particles for bigger explosion effect
|
|
241
|
-
for (let i = 0; i < 15; i++) {
|
|
242
|
-
const particle = {
|
|
243
|
-
id: `particle_${Date.now()}_${i}`,
|
|
244
|
-
x,
|
|
245
|
-
y,
|
|
246
|
-
velocityX: (Math.random() - 0.5) * 15,
|
|
247
|
-
// Increased velocity spread
|
|
248
|
-
velocityY: (Math.random() - 0.5) * 15,
|
|
249
|
-
color: i < 5 ? '#ff6600' : i < 10 ? COLORS.SPACECRAFT : '#ffff00',
|
|
250
|
-
// Mix of colors
|
|
251
|
-
life: 1200,
|
|
252
|
-
// Longer life for better visibility
|
|
253
|
-
maxLife: 1200,
|
|
254
|
-
size: 8 + Math.random() * 12 // Much bigger particles (8-20px)
|
|
255
|
-
};
|
|
256
|
-
this.particles.push(particle);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// Add some extra large explosion particles
|
|
260
|
-
for (let i = 0; i < 5; i++) {
|
|
261
|
-
const bigParticle = {
|
|
262
|
-
id: `big_particle_${Date.now()}_${i}`,
|
|
263
|
-
x: x + (Math.random() - 0.5) * 20,
|
|
264
|
-
y: y + (Math.random() - 0.5) * 20,
|
|
265
|
-
velocityX: (Math.random() - 0.5) * 8,
|
|
266
|
-
velocityY: (Math.random() - 0.5) * 8,
|
|
267
|
-
color: '#ff0000',
|
|
268
|
-
// Red explosion particles
|
|
269
|
-
life: 1500,
|
|
270
|
-
maxLife: 1500,
|
|
271
|
-
size: 15 + Math.random() * 10 // Very large particles (15-25px)
|
|
272
|
-
};
|
|
273
|
-
this.particles.push(bigParticle);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
updateParticles() {
|
|
277
|
-
// Optimized: Use for-loop with manual filtering for better performance
|
|
278
|
-
const activeParticles = [];
|
|
279
|
-
for (let i = 0; i < this.particles.length; i++) {
|
|
280
|
-
const particle = this.particles[i];
|
|
281
|
-
if (!particle) continue; // Safety check for undefined particle
|
|
282
|
-
|
|
283
|
-
particle.x += particle.velocityX;
|
|
284
|
-
particle.y += particle.velocityY;
|
|
285
|
-
particle.velocityY += 0.2; // gravity
|
|
286
|
-
particle.life -= 16;
|
|
287
|
-
if (particle.life > 0) {
|
|
288
|
-
activeParticles.push(particle);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
this.particles = activeParticles;
|
|
292
|
-
}
|
|
293
|
-
getParticles() {
|
|
294
|
-
return this.particles;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Check if spacecraft is currently immune to collisions
|
|
298
|
-
isInCollisionImmunity() {
|
|
299
|
-
const currentTime = Date.now();
|
|
300
|
-
return currentTime - this.lastCollisionTime < GAME_CONFIG.COLLISION_COOLDOWN;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Get remaining immunity time in milliseconds
|
|
304
|
-
getRemainingImmunityTime() {
|
|
305
|
-
const currentTime = Date.now();
|
|
306
|
-
const elapsed = currentTime - this.lastCollisionTime;
|
|
307
|
-
return Math.max(0, GAME_CONFIG.COLLISION_COOLDOWN - elapsed);
|
|
308
|
-
}
|
|
309
|
-
// Initial Spacecraft Position - Centered horizontally, positioned at bottom above start button
|
|
310
|
-
getInitialSpacecraft() {
|
|
311
|
-
return {
|
|
312
|
-
x: this.width / 2,
|
|
313
|
-
// Ensure exact center
|
|
314
|
-
y: this.height * 0.77,
|
|
315
|
-
// Fixed position at 77% from top
|
|
316
|
-
velocityX: 0,
|
|
317
|
-
velocityY: 0,
|
|
318
|
-
size: GAME_CONFIG.SPACECRAFT_SIZE,
|
|
319
|
-
isControlled: false
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
export const createSpaceFighterService = (width, height) => {
|
|
324
|
-
return new SpaceFighterGameService(width, height);
|
|
325
|
-
};
|
|
326
|
-
//# sourceMappingURL=SpaceFighterService.js.map
|
|
1
|
+
"use strict";import{SPACE_FIGHTER_GAME_CONFIG as GAME_CONFIG,SPACE_FIGHTER_COLORS as COLORS}from "./SpaceFighterConstants.js";export{GAME_CONFIG,COLORS};class SpaceFighterGameService{gameTimer = null;asteroidSpawnTimer = null;physicsTimer = null;particles = [];lastCollisionTime = 0;currentAsteroidSpeed = GAME_CONFIG.ASTEROID_SPEED;currentSpawnInterval = GAME_CONFIG.ASTEROID_SPAWN_INTERVAL;constructor(screenWidth,screenHeight){this.width = screenWidth;this.height = screenHeight;}startGame(){this.cleanup();}cleanup(){if(this.gameTimer){clearInterval(this.gameTimer);this.gameTimer = null;}if(this.asteroidSpawnTimer){clearInterval(this.asteroidSpawnTimer);this.asteroidSpawnTimer = null;}if(this.physicsTimer){clearInterval(this.physicsTimer);this.physicsTimer = null;}this.particles = [];this.lastCollisionTime = 0;}startGameTimer(decrementTime){this.gameTimer = setInterval(decrementTime,1000);}updateDifficultySettings(asteroidSpeed,spawnInterval){this.currentAsteroidSpeed = asteroidSpeed;this.currentSpawnInterval = spawnInterval;}startAsteroidSpawning(spawnAsteroid){const initialAsteroids = this.generateAsteroidPair();spawnAsteroid(initialAsteroids);this.asteroidSpawnTimer = setInterval(()=>{const asteroids = this.generateAsteroidPair();spawnAsteroid(asteroids);},this.currentSpawnInterval);}startPhysicsLoop(updateSpacecraft,updateAsteroid,removeAsteroid,getSpacecraft,getAsteroids){this.physicsTimer = setInterval(()=>{this.updatePhysics(updateSpacecraft,updateAsteroid,removeAsteroid,getSpacecraft,getAsteroids);},16);}generateAsteroidPair(){const pairId = `asteroid_pair_${Date.now()}_${Math.random()}`;const minGapX = this.width * 0.1;const maxGapX = this.width * 0.9 - GAME_CONFIG.ASTEROID_GAP;const gapX = Math.random()*(maxGapX - minGapX)+ minGapX;const leftAsteroid ={id:`${pairId}_left`,x:0,y:-250,width:gapX,height:GAME_CONFIG.ASTEROID_WIDTH,type:'left',pairId,passed:false,spawnTime:Date.now()};const rightAsteroid ={id:`${pairId}_right`,x:gapX + GAME_CONFIG.ASTEROID_GAP,y:-250,width:this.width -(gapX + GAME_CONFIG.ASTEROID_GAP),height:GAME_CONFIG.ASTEROID_WIDTH,type:'right',pairId,passed:false,spawnTime:Date.now()};return [leftAsteroid,rightAsteroid];}updatePhysics(updateSpacecraft,updateAsteroid,removeAsteroid,getSpacecraft,getAsteroids){const spacecraft = getSpacecraft();const asteroids = getAsteroids();let newSpacecraft ={...spacecraft};newSpacecraft.y = spacecraft.y;newSpacecraft.velocityY = 0;if(!newSpacecraft.isControlled){newSpacecraft.velocityX = 0;}if(newSpacecraft.x <= newSpacecraft.size / 2){newSpacecraft.x = newSpacecraft.size / 2;newSpacecraft.velocityX = 0;}if(newSpacecraft.x >= this.width - newSpacecraft.size / 2){newSpacecraft.x = this.width - newSpacecraft.size / 2;newSpacecraft.velocityX = 0;}updateSpacecraft(newSpacecraft);for(let i = 0;i < asteroids.length;i++){const asteroid = asteroids[i];if(!asteroid)continue;const newY = asteroid.y + this.currentAsteroidSpeed;if(newY > this.height){removeAsteroid(asteroid.id);}else{updateAsteroid(asteroid.id,{y:newY});}}this.updateParticles();}controlSpacecraft(spacecraft,targetX,_targetY){const minX = spacecraft.size / 2;const maxX = this.width - spacecraft.size / 2;const constrainedX = Math.max(minX,Math.min(maxX,targetX));return{...spacecraft,x:constrainedX,y:spacecraft.y,velocityX:0,velocityY:0,isControlled:true};}releaseSpacecraft(spacecraft){return{...spacecraft,isControlled:false};}checkCollision(spacecraft,asteroids){const currentTime = Date.now();if(currentTime - this.lastCollisionTime < GAME_CONFIG.COLLISION_COOLDOWN){return{collision:false};}for(const asteroid of asteroids){if(this.spacecraftAsteroidCollision(spacecraft,asteroid)){this.lastCollisionTime = currentTime;return{collision:true,asteroidId:asteroid.id};}}return{collision:false};}spacecraftAsteroidCollision(spacecraft,asteroid){const spacecraftLeft = spacecraft.x - spacecraft.size / 2;const spacecraftRight = spacecraft.x + spacecraft.size / 2;const spacecraftTop = spacecraft.y - spacecraft.size / 2;const spacecraftBottom = spacecraft.y + spacecraft.size / 2;const asteroidLeft = asteroid.x;const asteroidRight = asteroid.x + asteroid.width;const asteroidTop = asteroid.y;const asteroidBottom = asteroid.y + asteroid.height;return spacecraftRight > asteroidLeft && spacecraftLeft < asteroidRight && spacecraftBottom > asteroidTop && spacecraftTop < asteroidBottom;}checkAsteroidPass(spacecraft,asteroids){const passedAsteroids = [];for(let i = 0;i < asteroids.length;i++){const asteroid = asteroids[i];if(!asteroid)continue;if(!asteroid.passed && spacecraft.y > asteroid.y + asteroid.height){passedAsteroids.push(asteroid.pairId);}}return passedAsteroids;}createCollisionParticles(x,y){for(let i = 0;i < 15;i++){const particle ={id:`particle_${Date.now()}_${i}`,x,y,velocityX:(Math.random()- 0.5)* 15,velocityY:(Math.random()- 0.5)* 15,color:i < 5 ? '#ff6600':i < 10 ? COLORS.SPACECRAFT:'#ffff00',life:1200,maxLife:1200,size:8 + Math.random()* 12};this.particles.push(particle);}for(let i = 0;i < 5;i++){const bigParticle ={id:`big_particle_${Date.now()}_${i}`,x:x +(Math.random()- 0.5)* 20,y:y +(Math.random()- 0.5)* 20,velocityX:(Math.random()- 0.5)* 8,velocityY:(Math.random()- 0.5)* 8,color:'#ff0000',life:1500,maxLife:1500,size:15 + Math.random()* 10};this.particles.push(bigParticle);}}updateParticles(){const activeParticles = [];for(let i = 0;i < this.particles.length;i++){const particle = this.particles[i];if(!particle)continue;particle.x += particle.velocityX;particle.y += particle.velocityY;particle.velocityY += 0.2;particle.life -= 16;if(particle.life > 0){activeParticles.push(particle);}}this.particles = activeParticles;}getParticles(){return this.particles;}isInCollisionImmunity(){const currentTime = Date.now();return currentTime - this.lastCollisionTime < GAME_CONFIG.COLLISION_COOLDOWN;}getRemainingImmunityTime(){const currentTime = Date.now();const elapsed = currentTime - this.lastCollisionTime;return Math.max(0,GAME_CONFIG.COLLISION_COOLDOWN - elapsed);}getInitialSpacecraft(){return{x:this.width / 2,y:this.height * 0.77,velocityX:0,velocityY:0,size:GAME_CONFIG.SPACECRAFT_SIZE,isControlled:false};}}export const createSpaceFighterService =(width,height)=>{return new SpaceFighterGameService(width,height);};
|