react-native-games 0.3.0 → 0.5.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 +134 -130
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +116 -343
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +182 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +123 -101
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +119 -92
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +123 -113
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +137 -23
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameBackground.js +8 -83
- package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +15 -22
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -4
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinja.js +143 -0
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +148 -0
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -0
- package/lib/module/games/{fruit-slicer/FruitSlicerService.js → fruit-ninja/FruitNinjaService.js} +43 -21
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +191 -0
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.js +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js +215 -0
- package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameBackground.js +250 -304
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -0
- package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.js +17 -47
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/fruit-ninja/components/index.js +7 -0
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +184 -169
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +100 -0
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunnerService.js +37 -14
- package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +20 -15
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
- package/lib/module/games/maze-runner/components/GameBackground.js +151 -192
- package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +15 -25
- package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
- package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
- package/lib/module/games/maze-runner/components/index.js +0 -2
- package/lib/module/games/maze-runner/components/index.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +294 -0
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +113 -0
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js +132 -0
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +163 -0
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +198 -0
- package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +165 -0
- package/lib/module/games/popit-fidget/components/FidgetGrid.js.map +1 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js +177 -0
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +75 -0
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/popit-fidget/components/index.js +7 -0
- package/lib/module/games/popit-fidget/components/index.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighter.js +169 -0
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +108 -0
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -0
- package/lib/module/games/{space-traveller/SpaceTravellerService.js → space-fighter/SpaceFighterService.js} +48 -21
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js +195 -0
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/AsteroidComponent.js +7 -5
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -0
- package/lib/module/games/space-fighter/components/GameArea.js +295 -0
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/GameBackground.js +10 -65
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/ScoreBoard.js +20 -26
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/Spacecraft3D.js +72 -111
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +52 -0
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -0
- package/lib/module/games/{space-traveller → space-fighter}/components/index.js +0 -4
- package/lib/module/games/space-fighter/components/index.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js +263 -0
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +115 -0
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +120 -0
- package/lib/module/games/whack-a-mole/WhackAMoleService.js.map +1 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +172 -0
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameBackground.js +31 -91
- package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js +97 -0
- package/lib/module/games/whack-a-mole/components/GameGrid.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/GameHole.js +67 -54
- package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -0
- package/lib/module/games/{cat-popper/components/CatCharacter.js → whack-a-mole/components/MoleCharacter.js} +75 -115
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/ScoreBoard.js +13 -17
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/{cat-popper → whack-a-mole}/components/index.js +1 -3
- package/lib/module/games/whack-a-mole/components/index.js.map +1 -0
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +41 -519
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +35 -23
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +77 -0
- package/lib/module/services/HapticsService.js.map +1 -0
- package/lib/module/services/SoundsService.js +171 -0
- package/lib/module/services/SoundsService.js.map +1 -0
- package/lib/module/shared/helpers/AnimationFrame.js +120 -0
- package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
- package/lib/module/shared/helpers/AnimationTracker.js +89 -0
- package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
- package/lib/module/shared/helpers/ErrorHandler.js +269 -0
- package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
- package/lib/module/shared/helpers/GameControlButton.js +219 -0
- package/lib/module/shared/helpers/GameControlButton.js.map +1 -0
- package/lib/module/{games/balloon-blaster/components → shared/helpers}/GameOverModal.js +25 -17
- package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
- package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
- package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
- package/lib/module/shared/helpers/ParticleBlast.js +133 -0
- package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js +81 -0
- package/lib/module/shared/helpers/ResponsiveScoreBoard.js.map +1 -0
- package/lib/module/shared/helpers/index.js +12 -0
- package/lib/module/shared/helpers/index.js.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +144 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +12 -2
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -4
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +4 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +112 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerService.d.ts → fruit-ninja/FruitNinjaService.d.ts} +13 -5
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer/FruitSlicerStore.d.ts → fruit-ninja/FruitNinjaStore.d.ts} +13 -4
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -0
- package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.d.ts +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/FruitComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +5 -0
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -16
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +41 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +4 -2
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +2 -1
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -2
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +45 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +33 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +36 -0
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts +12 -0
- package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +9 -0
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts +5 -0
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +4 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +71 -0
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerService.d.ts → space-fighter/SpaceFighterService.d.ts} +7 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller/SpaceTravellerStore.d.ts → space-fighter/SpaceFighterStore.d.ts} +12 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +8 -0
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +3 -0
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/Spacecraft3D.d.ts +1 -1
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -0
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -0
- package/lib/typescript/src/games/{space-traveller → space-fighter}/components/index.d.ts +0 -4
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +4 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +79 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts +33 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts +41 -0
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameGrid.d.ts +2 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameHole.d.ts +3 -2
- package/lib/typescript/src/games/whack-a-mole/components/GameHole.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts +7 -0
- package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +6 -0
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +61 -340
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +21 -3
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/HapticsService.d.ts +16 -0
- package/lib/typescript/src/services/HapticsService.d.ts.map +1 -0
- package/lib/typescript/src/services/SoundsService.d.ts +154 -0
- package/lib/typescript/src/services/SoundsService.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
- package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
- package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
- package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts +17 -0
- package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -0
- package/lib/typescript/src/{games/cat-popper/components → shared/helpers}/GameOverModal.d.ts +5 -0
- package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
- package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
- package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts +42 -0
- package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/shared/helpers/index.d.ts +13 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -0
- package/package.json +9 -6
- package/lib/module/games/balloon-blaster/components/GameControls.js +0 -229
- package/lib/module/games/balloon-blaster/components/GameControls.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -52
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
- package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopper.js +0 -230
- package/lib/module/games/cat-popper/CatPopper.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperService.js +0 -100
- package/lib/module/games/cat-popper/CatPopperService.js.map +0 -1
- package/lib/module/games/cat-popper/CatPopperStore.js +0 -113
- package/lib/module/games/cat-popper/CatPopperStore.js.map +0 -1
- package/lib/module/games/cat-popper/components/CatCharacter.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameBackground.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameControls.js +0 -230
- package/lib/module/games/cat-popper/components/GameControls.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameGrid.js +0 -66
- package/lib/module/games/cat-popper/components/GameGrid.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameHole.js.map +0 -1
- package/lib/module/games/cat-popper/components/GameOverModal.js +0 -131
- package/lib/module/games/cat-popper/components/GameOverModal.js.map +0 -1
- package/lib/module/games/cat-popper/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/cat-popper/components/index.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicer.js +0 -411
- package/lib/module/games/fruit-slicer/FruitSlicer.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +0 -1
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js +0 -156
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameArea.js +0 -50
- package/lib/module/games/fruit-slicer/components/GameArea.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameBackground.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameControls.js +0 -230
- package/lib/module/games/fruit-slicer/components/GameControls.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/GameOverModal.js +0 -189
- package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js +0 -52
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/SliceTrail.js +0 -58
- package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +0 -1
- package/lib/module/games/fruit-slicer/components/index.js +0 -11
- package/lib/module/games/fruit-slicer/components/index.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameControls.js +0 -129
- package/lib/module/games/maze-runner/components/GameControls.js.map +0 -1
- package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
- package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTraveller.js +0 -393
- package/lib/module/games/space-traveller/SpaceTraveller.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerService.js.map +0 -1
- package/lib/module/games/space-traveller/SpaceTravellerStore.js +0 -139
- package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +0 -1
- package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameArea.js +0 -75
- package/lib/module/games/space-traveller/components/GameArea.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameBackground.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameControls.js +0 -177
- package/lib/module/games/space-traveller/components/GameControls.js.map +0 -1
- package/lib/module/games/space-traveller/components/GameOverModal.js +0 -182
- package/lib/module/games/space-traveller/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/ParticleComponent.js +0 -34
- package/lib/module/games/space-traveller/components/ParticleComponent.js.map +0 -1
- package/lib/module/games/space-traveller/components/ScoreBoard.js.map +0 -1
- package/lib/module/games/space-traveller/components/SettingsModal.js +0 -222
- package/lib/module/games/space-traveller/components/SettingsModal.js.map +0 -1
- package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +0 -1
- package/lib/module/games/space-traveller/components/SpacecraftPath.js +0 -37
- package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +0 -1
- package/lib/module/games/space-traveller/components/index.js.map +0 -1
- package/lib/module/shared/settings/GameSettings.js +0 -295
- package/lib/module/shared/settings/GameSettings.js.map +0 -1
- package/lib/module/shared/settings/SettingsService.js +0 -119
- package/lib/module/shared/settings/SettingsService.js.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +0 -13
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +0 -32
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +0 -21
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +0 -7
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/cat-popper/components/index.d.ts +0 -8
- package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +0 -16
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +0 -9
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +0 -17
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +0 -10
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +0 -8
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +0 -9
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +0 -1
- package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
- package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
- package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -32
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
- /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → space-fighter}/components/SpacecraftPath.d.ts +0 -0
- /package/lib/typescript/src/games/{space-traveller → whack-a-mole}/components/GameBackground.d.ts +0 -0
- /package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/ScoreBoard.d.ts +0 -0
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef } from 'react';
|
|
4
|
-
import { View, Dimensions, StyleSheet, Modal } from 'react-native';
|
|
5
|
-
import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
|
-
import * as Speech from 'expo-speech';
|
|
7
|
-
import * as Haptics from 'expo-haptics';
|
|
8
|
-
import { useSpaceTravellerStore } from "./SpaceTravellerStore.js";
|
|
9
|
-
import { createSpaceTravellerService } from "./SpaceTravellerService.js";
|
|
10
|
-
import { ScoreBoard, GameArea, GameControls, GameOverModal, GameBackground } from "./components/index.js";
|
|
11
|
-
// Define game-specific types and constants locally
|
|
12
|
-
|
|
13
|
-
import { GameSettings } from "../../shared/settings/GameSettings.js";
|
|
14
|
-
import { createGameSettingsStore } from "../../shared/settings/SettingsService.js";
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
const {
|
|
17
|
-
width,
|
|
18
|
-
height
|
|
19
|
-
} = Dimensions.get('window');
|
|
20
|
-
export const SpaceTraveller = ({
|
|
21
|
-
showSettingsModal = false,
|
|
22
|
-
onToggleSettingsModal,
|
|
23
|
-
settings,
|
|
24
|
-
onSettingsChange
|
|
25
|
-
}) => {
|
|
26
|
-
let gameService = useRef(createSpaceTravellerService(width, height)).current;
|
|
27
|
-
|
|
28
|
-
// Create unified game settings store
|
|
29
|
-
const useSettingsStore = useRef(() => {
|
|
30
|
-
const defaultSettings = {
|
|
31
|
-
difficulty: 'medium',
|
|
32
|
-
soundEnabled: true,
|
|
33
|
-
hapticEnabled: true,
|
|
34
|
-
gameDuration: 120
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// Wrapper function to handle the callback type mismatch
|
|
38
|
-
const handleSettingsChange = onSettingsChange ? newSettings => {
|
|
39
|
-
const spaceTravellerSettings = {
|
|
40
|
-
...settings,
|
|
41
|
-
difficulty: newSettings.difficulty,
|
|
42
|
-
soundEnabled: newSettings.soundEnabled,
|
|
43
|
-
hapticEnabled: newSettings.hapticEnabled,
|
|
44
|
-
gameDuration: newSettings.gameDuration,
|
|
45
|
-
asteroidSpawnInterval: settings?.asteroidSpawnInterval || 1000,
|
|
46
|
-
asteroidSpeed: settings?.asteroidSpeed || 2
|
|
47
|
-
};
|
|
48
|
-
onSettingsChange(spaceTravellerSettings);
|
|
49
|
-
} : undefined;
|
|
50
|
-
return createGameSettingsStore(settings || defaultSettings, handleSettingsChange);
|
|
51
|
-
}).current;
|
|
52
|
-
const settingsStore = useSettingsStore();
|
|
53
|
-
const {
|
|
54
|
-
soundEnabled
|
|
55
|
-
} = settingsStore();
|
|
56
|
-
const {
|
|
57
|
-
score,
|
|
58
|
-
timeLeft,
|
|
59
|
-
isPlaying,
|
|
60
|
-
gameOver,
|
|
61
|
-
asteroids,
|
|
62
|
-
spacecraft,
|
|
63
|
-
spacecraftPath,
|
|
64
|
-
isControllingSpacecraft,
|
|
65
|
-
startGame,
|
|
66
|
-
stopGame,
|
|
67
|
-
resetGame,
|
|
68
|
-
decrementTime,
|
|
69
|
-
addAsteroids,
|
|
70
|
-
removeAsteroid,
|
|
71
|
-
updateAsteroid,
|
|
72
|
-
updateSpacecraft,
|
|
73
|
-
setSpacecraftPath,
|
|
74
|
-
setIsControllingSpacecraft,
|
|
75
|
-
markAsteroidPassed,
|
|
76
|
-
loseLife
|
|
77
|
-
} = useSpaceTravellerStore();
|
|
78
|
-
const currentSpacecraftPath = useRef([]);
|
|
79
|
-
const dragOffset = useRef(null);
|
|
80
|
-
const initialSpacecraftPosition = useRef(null);
|
|
81
|
-
const initialTouchPosition = useRef(null);
|
|
82
|
-
const pendingSpacecraftUpdate = useRef(null);
|
|
83
|
-
const animationFrameId = useRef(null);
|
|
84
|
-
const lastCollisionTime = useRef(0);
|
|
85
|
-
const handleSpacecraftControlStart = (x, y) => {
|
|
86
|
-
const currentSpacecraft = useSpaceTravellerStore.getState().spacecraft;
|
|
87
|
-
const controlledSpacecraft = gameService.controlSpacecraft({
|
|
88
|
-
...currentSpacecraft
|
|
89
|
-
}, x, y);
|
|
90
|
-
updateSpacecraft(controlledSpacecraft);
|
|
91
|
-
setIsControllingSpacecraft(true);
|
|
92
|
-
currentSpacecraftPath.current = [{
|
|
93
|
-
x,
|
|
94
|
-
y
|
|
95
|
-
}];
|
|
96
|
-
setSpacecraftPath([{
|
|
97
|
-
x,
|
|
98
|
-
y
|
|
99
|
-
}]);
|
|
100
|
-
};
|
|
101
|
-
const processPendingSpacecraftUpdate = () => {
|
|
102
|
-
if (pendingSpacecraftUpdate.current) {
|
|
103
|
-
const {
|
|
104
|
-
x,
|
|
105
|
-
y
|
|
106
|
-
} = pendingSpacecraftUpdate.current;
|
|
107
|
-
const currentSpacecraft = useSpaceTravellerStore.getState().spacecraft;
|
|
108
|
-
const controlledSpacecraft = gameService.controlSpacecraft({
|
|
109
|
-
...currentSpacecraft
|
|
110
|
-
}, x, y);
|
|
111
|
-
updateSpacecraft(controlledSpacecraft);
|
|
112
|
-
currentSpacecraftPath.current.push({
|
|
113
|
-
x,
|
|
114
|
-
y
|
|
115
|
-
});
|
|
116
|
-
if (currentSpacecraftPath.current.length > 10) {
|
|
117
|
-
currentSpacecraftPath.current.shift();
|
|
118
|
-
}
|
|
119
|
-
setSpacecraftPath([...currentSpacecraftPath.current]);
|
|
120
|
-
pendingSpacecraftUpdate.current = null;
|
|
121
|
-
}
|
|
122
|
-
animationFrameId.current = null;
|
|
123
|
-
};
|
|
124
|
-
const handleSpacecraftControlMove = (x, y) => {
|
|
125
|
-
pendingSpacecraftUpdate.current = {
|
|
126
|
-
x,
|
|
127
|
-
y
|
|
128
|
-
};
|
|
129
|
-
if (animationFrameId.current === null) {
|
|
130
|
-
animationFrameId.current = requestAnimationFrame(processPendingSpacecraftUpdate);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
const handleSpacecraftControlEnd = () => {
|
|
134
|
-
if (animationFrameId.current !== null) {
|
|
135
|
-
cancelAnimationFrame(animationFrameId.current);
|
|
136
|
-
animationFrameId.current = null;
|
|
137
|
-
}
|
|
138
|
-
if (pendingSpacecraftUpdate.current) {
|
|
139
|
-
processPendingSpacecraftUpdate();
|
|
140
|
-
}
|
|
141
|
-
const currentSpacecraft = useSpaceTravellerStore.getState().spacecraft;
|
|
142
|
-
const releasedSpacecraft = gameService.releaseSpacecraft({
|
|
143
|
-
...currentSpacecraft
|
|
144
|
-
});
|
|
145
|
-
updateSpacecraft(releasedSpacecraft);
|
|
146
|
-
setIsControllingSpacecraft(false);
|
|
147
|
-
dragOffset.current = null;
|
|
148
|
-
initialSpacecraftPosition.current = null;
|
|
149
|
-
setTimeout(() => {
|
|
150
|
-
currentSpacecraftPath.current = [];
|
|
151
|
-
setSpacecraftPath([]);
|
|
152
|
-
}, 500);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// Sound and haptic feedback
|
|
156
|
-
const playSuccessSound = () => {
|
|
157
|
-
if (soundEnabled) {
|
|
158
|
-
Speech.speak('Nice!', {
|
|
159
|
-
pitch: 1.8,
|
|
160
|
-
rate: 2.0,
|
|
161
|
-
volume: 0.6
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
|
|
165
|
-
};
|
|
166
|
-
const playCollisionSound = () => {
|
|
167
|
-
if (soundEnabled) {
|
|
168
|
-
Speech.speak('Ouch!', {
|
|
169
|
-
pitch: 0.8,
|
|
170
|
-
rate: 1.5,
|
|
171
|
-
volume: 0.8
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
|
|
175
|
-
};
|
|
176
|
-
const playGameOverSound = () => {
|
|
177
|
-
if (soundEnabled) {
|
|
178
|
-
Speech.speak('Game Over!', {
|
|
179
|
-
pitch: 1.0,
|
|
180
|
-
rate: 1.2,
|
|
181
|
-
volume: 0.7
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
|
|
185
|
-
};
|
|
186
|
-
const handleStartGame = async () => {
|
|
187
|
-
startGame(settingsStore().gameDuration);
|
|
188
|
-
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
189
|
-
updateSpacecraft(initialSpacecraft);
|
|
190
|
-
gameService.startGameTimer(decrementTime);
|
|
191
|
-
gameService.startAsteroidSpawning(addAsteroids);
|
|
192
|
-
gameService.startPhysicsLoop(updateSpacecraft, updateAsteroid, removeAsteroid, () => useSpaceTravellerStore.getState().spacecraft, () => useSpaceTravellerStore.getState().asteroids);
|
|
193
|
-
if (soundEnabled) {
|
|
194
|
-
if (await Speech.isSpeakingAsync()) {
|
|
195
|
-
Speech.stop();
|
|
196
|
-
}
|
|
197
|
-
Speech.speak('Mission started! Navigate through the asteroid field!');
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
const handleStopGame = () => {
|
|
201
|
-
stopGame();
|
|
202
|
-
gameService.cleanup();
|
|
203
|
-
currentSpacecraftPath.current = [];
|
|
204
|
-
setSpacecraftPath([]);
|
|
205
|
-
setIsControllingSpacecraft(false);
|
|
206
|
-
};
|
|
207
|
-
const handleResetGame = () => {
|
|
208
|
-
resetGame();
|
|
209
|
-
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
210
|
-
updateSpacecraft(initialSpacecraft);
|
|
211
|
-
gameService.cleanup();
|
|
212
|
-
currentSpacecraftPath.current = [];
|
|
213
|
-
setSpacecraftPath([]);
|
|
214
|
-
setIsControllingSpacecraft(false);
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
// Collision detection effect
|
|
218
|
-
useEffect(() => {
|
|
219
|
-
if (!isPlaying) return;
|
|
220
|
-
const interval = setInterval(() => {
|
|
221
|
-
const currentSpacecraft = useSpaceTravellerStore.getState().spacecraft;
|
|
222
|
-
const currentAsteroids = useSpaceTravellerStore.getState().asteroids;
|
|
223
|
-
const collision = gameService.checkCollision(currentSpacecraft, currentAsteroids);
|
|
224
|
-
const now = Date.now();
|
|
225
|
-
if (collision.collision && now - lastCollisionTime.current > 1000) {
|
|
226
|
-
lastCollisionTime.current = now;
|
|
227
|
-
playCollisionSound();
|
|
228
|
-
gameService.createCollisionParticles(currentSpacecraft.x, currentSpacecraft.y);
|
|
229
|
-
loseLife();
|
|
230
|
-
const resetSpacecraft = gameService.getInitialSpacecraft();
|
|
231
|
-
updateSpacecraft(resetSpacecraft);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Check asteroid passes for scoring
|
|
236
|
-
const passedAsteroids = gameService.checkAsteroidPass(currentSpacecraft, currentAsteroids);
|
|
237
|
-
passedAsteroids.forEach(pairId => {
|
|
238
|
-
markAsteroidPassed(pairId);
|
|
239
|
-
playSuccessSound();
|
|
240
|
-
});
|
|
241
|
-
}, 50);
|
|
242
|
-
return () => clearInterval(interval);
|
|
243
|
-
}, [isPlaying]);
|
|
244
|
-
|
|
245
|
-
// Game over effect
|
|
246
|
-
useEffect(() => {
|
|
247
|
-
if (gameOver) {
|
|
248
|
-
playGameOverSound();
|
|
249
|
-
gameService.cleanup();
|
|
250
|
-
}
|
|
251
|
-
}, [gameOver]);
|
|
252
|
-
|
|
253
|
-
// Initialize and cleanup
|
|
254
|
-
useEffect(() => {
|
|
255
|
-
const initialSpacecraft = gameService.getInitialSpacecraft();
|
|
256
|
-
updateSpacecraft(initialSpacecraft);
|
|
257
|
-
return () => {
|
|
258
|
-
gameService.cleanup();
|
|
259
|
-
};
|
|
260
|
-
}, []);
|
|
261
|
-
const panGesture = Gesture.Pan().onStart(event => {
|
|
262
|
-
const currentSpacecraft = useSpaceTravellerStore.getState().spacecraft;
|
|
263
|
-
initialSpacecraftPosition.current = {
|
|
264
|
-
x: currentSpacecraft.x,
|
|
265
|
-
y: currentSpacecraft.y
|
|
266
|
-
};
|
|
267
|
-
initialTouchPosition.current = {
|
|
268
|
-
x: event.absoluteX,
|
|
269
|
-
y: event.absoluteY
|
|
270
|
-
};
|
|
271
|
-
handleSpacecraftControlStart(currentSpacecraft.x, currentSpacecraft.y);
|
|
272
|
-
}).onUpdate(event => {
|
|
273
|
-
if (!initialSpacecraftPosition.current || !initialTouchPosition.current) {
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
const dx = event.absoluteX - initialTouchPosition.current.x;
|
|
277
|
-
const newX = initialSpacecraftPosition.current.x + dx;
|
|
278
|
-
const newY = initialSpacecraftPosition.current.y;
|
|
279
|
-
handleSpacecraftControlMove(newX, newY);
|
|
280
|
-
}).onEnd(() => {
|
|
281
|
-
initialTouchPosition.current = null;
|
|
282
|
-
handleSpacecraftControlEnd();
|
|
283
|
-
}).onFinalize(() => {
|
|
284
|
-
initialTouchPosition.current = null;
|
|
285
|
-
handleSpacecraftControlEnd();
|
|
286
|
-
}).runOnJS(true);
|
|
287
|
-
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
288
|
-
style: {
|
|
289
|
-
flex: 1
|
|
290
|
-
},
|
|
291
|
-
children: /*#__PURE__*/_jsx(GameBackground, {
|
|
292
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
293
|
-
style: styles.container,
|
|
294
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
295
|
-
style: {
|
|
296
|
-
zIndex: 100,
|
|
297
|
-
position: 'relative',
|
|
298
|
-
padding: 20
|
|
299
|
-
},
|
|
300
|
-
children: /*#__PURE__*/_jsx(ScoreBoard, {
|
|
301
|
-
score: score,
|
|
302
|
-
timeLeft: timeLeft
|
|
303
|
-
})
|
|
304
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
305
|
-
style: {
|
|
306
|
-
flex: 1,
|
|
307
|
-
position: 'relative'
|
|
308
|
-
},
|
|
309
|
-
children: [/*#__PURE__*/_jsx(GameArea, {
|
|
310
|
-
asteroids: asteroids,
|
|
311
|
-
spacecraft: spacecraft,
|
|
312
|
-
particles: gameService.getParticles(),
|
|
313
|
-
spacecraftPath: spacecraftPath,
|
|
314
|
-
isControllingSpacecraft: isControllingSpacecraft,
|
|
315
|
-
onSpacecraftControl: handleSpacecraftControlMove,
|
|
316
|
-
onSpacecraftRelease: handleSpacecraftControlEnd
|
|
317
|
-
}), /*#__PURE__*/_jsx(GestureDetector, {
|
|
318
|
-
gesture: panGesture,
|
|
319
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
320
|
-
style: {
|
|
321
|
-
position: 'absolute',
|
|
322
|
-
top: 0,
|
|
323
|
-
left: 0,
|
|
324
|
-
right: 0,
|
|
325
|
-
bottom: 0,
|
|
326
|
-
backgroundColor: 'transparent',
|
|
327
|
-
zIndex: 10
|
|
328
|
-
}
|
|
329
|
-
})
|
|
330
|
-
})]
|
|
331
|
-
}), /*#__PURE__*/_jsx(GameControls, {
|
|
332
|
-
isPlaying: isPlaying,
|
|
333
|
-
gameOver: gameOver,
|
|
334
|
-
onStartGame: handleStartGame,
|
|
335
|
-
onStopGame: handleStopGame
|
|
336
|
-
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
337
|
-
isVisible: gameOver,
|
|
338
|
-
score: score,
|
|
339
|
-
onPlayAgain: handleResetGame
|
|
340
|
-
}), /*#__PURE__*/_jsx(Modal, {
|
|
341
|
-
visible: showSettingsModal,
|
|
342
|
-
animationType: "slide",
|
|
343
|
-
presentationStyle: "pageSheet",
|
|
344
|
-
onRequestClose: onToggleSettingsModal,
|
|
345
|
-
children: /*#__PURE__*/_jsx(GameSettings, {
|
|
346
|
-
gameId: "space-craft",
|
|
347
|
-
onClose: onToggleSettingsModal || (() => {}),
|
|
348
|
-
settingsStore: settingsStore()
|
|
349
|
-
})
|
|
350
|
-
})]
|
|
351
|
-
})
|
|
352
|
-
})
|
|
353
|
-
});
|
|
354
|
-
};
|
|
355
|
-
const styles = StyleSheet.create({
|
|
356
|
-
container: {
|
|
357
|
-
flex: 1
|
|
358
|
-
},
|
|
359
|
-
settingsOverlay: {
|
|
360
|
-
position: 'absolute',
|
|
361
|
-
top: 0,
|
|
362
|
-
left: 0,
|
|
363
|
-
right: 0,
|
|
364
|
-
bottom: 0,
|
|
365
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
366
|
-
justifyContent: 'center',
|
|
367
|
-
alignItems: 'center'
|
|
368
|
-
},
|
|
369
|
-
settingsModal: {
|
|
370
|
-
backgroundColor: '#1e3a8a',
|
|
371
|
-
// bg-blue-900
|
|
372
|
-
padding: 24,
|
|
373
|
-
borderRadius: 16
|
|
374
|
-
},
|
|
375
|
-
settingsTitle: {
|
|
376
|
-
color: '#ffffff',
|
|
377
|
-
fontSize: 20,
|
|
378
|
-
fontWeight: 'bold',
|
|
379
|
-
marginBottom: 16
|
|
380
|
-
},
|
|
381
|
-
closeButton: {
|
|
382
|
-
backgroundColor: '#2563eb',
|
|
383
|
-
// bg-blue-600
|
|
384
|
-
paddingVertical: 8,
|
|
385
|
-
paddingHorizontal: 16,
|
|
386
|
-
borderRadius: 8
|
|
387
|
-
},
|
|
388
|
-
closeButtonText: {
|
|
389
|
-
color: '#ffffff',
|
|
390
|
-
fontWeight: '600'
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
//# sourceMappingURL=SpaceTraveller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useRef","View","Dimensions","StyleSheet","Modal","Gesture","GestureDetector","GestureHandlerRootView","Speech","Haptics","useSpaceTravellerStore","createSpaceTravellerService","ScoreBoard","GameArea","GameControls","GameOverModal","GameBackground","GameSettings","createGameSettingsStore","jsx","_jsx","jsxs","_jsxs","width","height","get","SpaceTraveller","showSettingsModal","onToggleSettingsModal","settings","onSettingsChange","gameService","current","useSettingsStore","defaultSettings","difficulty","soundEnabled","hapticEnabled","gameDuration","handleSettingsChange","newSettings","spaceTravellerSettings","asteroidSpawnInterval","asteroidSpeed","undefined","settingsStore","score","timeLeft","isPlaying","gameOver","asteroids","spacecraft","spacecraftPath","isControllingSpacecraft","startGame","stopGame","resetGame","decrementTime","addAsteroids","removeAsteroid","updateAsteroid","updateSpacecraft","setSpacecraftPath","setIsControllingSpacecraft","markAsteroidPassed","loseLife","currentSpacecraftPath","dragOffset","initialSpacecraftPosition","initialTouchPosition","pendingSpacecraftUpdate","animationFrameId","lastCollisionTime","handleSpacecraftControlStart","x","y","currentSpacecraft","getState","controlledSpacecraft","controlSpacecraft","processPendingSpacecraftUpdate","push","length","shift","handleSpacecraftControlMove","requestAnimationFrame","handleSpacecraftControlEnd","cancelAnimationFrame","releasedSpacecraft","releaseSpacecraft","setTimeout","playSuccessSound","speak","pitch","rate","volume","impactAsync","ImpactFeedbackStyle","Light","playCollisionSound","Heavy","playGameOverSound","handleStartGame","initialSpacecraft","getInitialSpacecraft","startGameTimer","startAsteroidSpawning","startPhysicsLoop","isSpeakingAsync","stop","handleStopGame","cleanup","handleResetGame","interval","setInterval","currentAsteroids","collision","checkCollision","now","Date","createCollisionParticles","resetSpacecraft","passedAsteroids","checkAsteroidPass","forEach","pairId","clearInterval","panGesture","Pan","onStart","event","absoluteX","absoluteY","onUpdate","dx","newX","newY","onEnd","onFinalize","runOnJS","style","flex","children","styles","container","zIndex","position","padding","particles","getParticles","onSpacecraftControl","onSpacecraftRelease","gesture","top","left","right","bottom","backgroundColor","onStartGame","onStopGame","isVisible","onPlayAgain","visible","animationType","presentationStyle","onRequestClose","gameId","onClose","create","settingsOverlay","justifyContent","alignItems","settingsModal","borderRadius","settingsTitle","color","fontSize","fontWeight","marginBottom","closeButton","paddingVertical","paddingHorizontal","closeButtonText"],"sourceRoot":"../../../../src","sources":["games/space-traveller/SpaceTraveller.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AAClE,SAASC,OAAO,EAAEC,eAAe,EAAEC,sBAAsB,QAAQ,8BAA8B;AAC/F,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,sBAAsB,QAAQ,0BAAuB;AAC9D,SAASC,2BAA2B,QAAQ,4BAAyB;AACrE,SAASC,UAAU,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,uBAAc;AAChG;;AAUA,SAASC,YAAY,QAAQ,uCAAoC;AACjE,SAASC,uBAAuB,QAAQ,0CAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhF,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGtB,UAAU,CAACuB,GAAG,CAAC,QAAQ,CAAC;AASlD,OAAO,MAAMC,cAAc,GAAGA,CA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AE,oBAAoB;IACrCa,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDC,aAAa,EAAE;IACbf,eAAe,EAAE,SAAS;IAAE;IAC5BV,OAAO,EAAE,EAAE;IACX0B,YAAY,EAAE;EAChB,CAAC;EACDC,aAAa,EAAE;IACbC,KAAK,EAAE,SAAS;IAChBC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,YAAY,EAAE;EAChB,CAAC;EACDC,WAAW,EAAE;IACXtB,eAAe,EAAE,SAAS;IAAE;IAC5BuB,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,EAAE;IACrBR,YAAY,EAAE;EAChB,CAAC;EACDS,eAAe,EAAE;IACfP,KAAK,EAAE,SAAS;IAChBE,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SPACE_TRAVELLER_GAME_CONFIG","GAME_CONFIG","SPACE_TRAVELLER_COLORS","COLORS","SpaceTravellerGameService","gameTimer","asteroidSpawnTimer","physicsTimer","particles","lastCollisionTime","constructor","screenWidth","screenHeight","width","height","startGame","cleanup","clearInterval","startGameTimer","decrementTime","setInterval","startAsteroidSpawning","spawnAsteroid","initialAsteroids","generateAsteroidPair","asteroids","ASTEROID_SPAWN_INTERVAL","startPhysicsLoop","updateSpacecraft","updateAsteroid","removeAsteroid","getSpacecraft","getAsteroids","updatePhysics","pairId","Date","now","Math","random","minGapX","maxGapX","ASTEROID_GAP","gapX","leftAsteroid","id","x","y","ASTEROID_WIDTH","type","passed","spawnTime","rightAsteroid","spacecraft","newSpacecraft","velocityY","isControlled","velocityX","size","forEach","asteroid","newY","ASTEROID_SPEED","updateParticles","controlSpacecraft","targetX","_targetY","minX","maxX","constrainedX","max","min","releaseSpacecraft","checkCollision","currentTime","COLLISION_COOLDOWN","collision","spacecraftAsteroidCollision","asteroidId","spacecraftLeft","spacecraftRight","spacecraftTop","spacecraftBottom","asteroidLeft","asteroidRight","asteroidTop","asteroidBottom","checkAsteroidPass","passedAsteroids","push","createCollisionParticles","i","particle","color","SPACECRAFT","life","maxLife","bigParticle","filter","getParticles","isInCollisionImmunity","getRemainingImmunityTime","elapsed","getInitialSpacecraft","SPACECRAFT_SIZE","createSpaceTravellerService"],"sourceRoot":"../../../../src","sources":["games/space-traveller/SpaceTravellerService.ts"],"mappings":";;AAAA,SACEA,2BAA2B,IAAIC,WAAW,EAC1CC,sBAAsB,IAAIC,MAAM,QAC3B,kCAA+B;;AAEtC;AACA;AACA,SAASF,WAAW,EAAEE,MAAM;;AAE5B;;AAkCA;AACA,MAAMC,yBAAyB,CAAC;EAGtBC,SAAS,GAA0C,IAAI;EACvDC,kBAAkB,GAA0C,IAAI;EAChEC,YAAY,GAA0C,IAAI;EAC1DC,SAAS,GAAe,EAAE;EAC1BC,iBAAiB,GAAW,CAAC;EAErCC,WAAWA,CAACC,WAAmB,EAAEC,YAAoB,EAAE;IACrD,IAAI,CAACC,KAAK,GAAGF,WAAW;IACxB,IAAI,CAACG,MAAM,GAAGF,YAAY;EAC5B;;EAEA;EACAG,SAASA,CAAA,EAAG;IACV,IAAI,CAACC,OAAO,CAAC,CAAC;EAChB;EAEAA,OAAOA,CAAA,EAAG;IACR,IAAI,IAAI,CAACX,SAAS,EAAE;MAClBY,aAAa,CAAC,IAAI,CAACZ,SAAS,CAAC;MAC7B,IAAI,CAACA,SAAS,GAAG,IAAI;IACvB;IACA,IAAI,IAAI,CAACC,kBAAkB,EAAE;MAC3BW,aAAa,CAAC,IAAI,CAACX,kBAAkB,CAAC;MACtC,IAAI,CAACA,kBAAkB,GAAG,IAAI;IAChC;IACA,IAAI,IAAI,CAACC,YAAY,EAAE;MACrBU,aAAa,CAAC,IAAI,CAACV,YAAY,CAAC;MAChC,IAAI,CAACA,YAAY,GAAG,IAAI;IAC1B;IACA,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,IAAI,CAACC,iBAAiB,GAA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ravellerService.js";
|
|
5
|
-
export const useSpaceTravellerStore = create(set => ({
|
|
6
|
-
// Initial state
|
|
7
|
-
score: 0,
|
|
8
|
-
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
9
|
-
isPlaying: false,
|
|
10
|
-
gameOver: false,
|
|
11
|
-
lives: 3,
|
|
12
|
-
asteroids: [],
|
|
13
|
-
spacecraft: {
|
|
14
|
-
x: 0,
|
|
15
|
-
y: 0,
|
|
16
|
-
velocityX: 0,
|
|
17
|
-
velocityY: 0,
|
|
18
|
-
size: GAME_CONFIG.SPACECRAFT_SIZE,
|
|
19
|
-
isControlled: false
|
|
20
|
-
},
|
|
21
|
-
spacecraftPath: [],
|
|
22
|
-
isControllingSpacecraft: false,
|
|
23
|
-
// Actions
|
|
24
|
-
startGame: gameDuration => {
|
|
25
|
-
const duration = gameDuration || GAME_CONFIG.GAME_DURATION;
|
|
26
|
-
set({
|
|
27
|
-
score: 0,
|
|
28
|
-
timeLeft: duration,
|
|
29
|
-
isPlaying: true,
|
|
30
|
-
gameOver: false,
|
|
31
|
-
lives: 3,
|
|
32
|
-
asteroids: [],
|
|
33
|
-
spacecraftPath: [],
|
|
34
|
-
isControllingSpacecraft: false
|
|
35
|
-
});
|
|
36
|
-
},
|
|
37
|
-
stopGame: () => {
|
|
38
|
-
set({
|
|
39
|
-
score: 0,
|
|
40
|
-
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
41
|
-
isPlaying: false,
|
|
42
|
-
gameOver: false,
|
|
43
|
-
lives: 3,
|
|
44
|
-
asteroids: [],
|
|
45
|
-
spacecraftPath: [],
|
|
46
|
-
isControllingSpacecraft: false
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
resetGame: () => {
|
|
50
|
-
set({
|
|
51
|
-
score: 0,
|
|
52
|
-
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
53
|
-
isPlaying: false,
|
|
54
|
-
gameOver: false,
|
|
55
|
-
lives: 3,
|
|
56
|
-
asteroids: [],
|
|
57
|
-
spacecraftPath: [],
|
|
58
|
-
isControllingSpacecraft: false
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
updateScore: points => {
|
|
62
|
-
set(state => ({
|
|
63
|
-
score: state.score + points
|
|
64
|
-
}));
|
|
65
|
-
},
|
|
66
|
-
decrementTime: () => {
|
|
67
|
-
set(state => {
|
|
68
|
-
const newTimeLeft = state.timeLeft - 1;
|
|
69
|
-
if (newTimeLeft <= 0) {
|
|
70
|
-
return {
|
|
71
|
-
timeLeft: 0,
|
|
72
|
-
isPlaying: false,
|
|
73
|
-
gameOver: true
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
timeLeft: newTimeLeft
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
addAsteroids: asteroids => {
|
|
82
|
-
set(state => ({
|
|
83
|
-
asteroids: [...state.asteroids, ...asteroids]
|
|
84
|
-
}));
|
|
85
|
-
},
|
|
86
|
-
removeAsteroid: asteroidId => {
|
|
87
|
-
set(state => ({
|
|
88
|
-
asteroids: state.asteroids.filter(a => a.id !== asteroidId)
|
|
89
|
-
}));
|
|
90
|
-
},
|
|
91
|
-
updateAsteroid: (asteroidId, updates) => {
|
|
92
|
-
set(state => ({
|
|
93
|
-
asteroids: state.asteroids.map(a => a.id === asteroidId ? {
|
|
94
|
-
...a,
|
|
95
|
-
...updates
|
|
96
|
-
} : a)
|
|
97
|
-
}));
|
|
98
|
-
},
|
|
99
|
-
updateSpacecraft: spacecraft => {
|
|
100
|
-
set({
|
|
101
|
-
spacecraft
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
setSpacecraftPath: path => {
|
|
105
|
-
set({
|
|
106
|
-
spacecraftPath: path
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
setIsControllingSpacecraft: isControlling => {
|
|
110
|
-
set({
|
|
111
|
-
isControllingSpacecraft: isControlling
|
|
112
|
-
});
|
|
113
|
-
},
|
|
114
|
-
markAsteroidPassed: pairId => {
|
|
115
|
-
set(state => ({
|
|
116
|
-
asteroids: state.asteroids.map(a => a.pairId === pairId ? {
|
|
117
|
-
...a,
|
|
118
|
-
passed: true
|
|
119
|
-
} : a),
|
|
120
|
-
score: state.score + 10 // 10 points per asteroid pair passed
|
|
121
|
-
}));
|
|
122
|
-
},
|
|
123
|
-
loseLife: () => {
|
|
124
|
-
set(state => {
|
|
125
|
-
const newLives = state.lives - 1;
|
|
126
|
-
if (newLives <= 0) {
|
|
127
|
-
return {
|
|
128
|
-
lives: 0,
|
|
129
|
-
isPlaying: false,
|
|
130
|
-
gameOver: true
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
lives: newLives
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
}));
|
|
139
|
-
//# sourceMappingURL=SpaceTravellerStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["create","GAME_CONFIG","useSpaceTravellerStore","set","score","timeLeft","GAME_DURATION","isPlaying","gameOver","lives","asteroids","spacecraft","x","y","velocityX","velocityY","size","SPACECRAFT_SIZE","isControlled","spacecraftPath","isControllingSpacecraft","startGame","gameDuration","duration","stopGame","resetGame","updateScore","points","state","decrementTime","newTimeLeft","addAsteroids","removeAsteroid","asteroidId","filter","a","id","updateAsteroid","updates","map","updateSpacecraft","setSpacecraftPath","path","setIsControllingSpacecraft","isControlling","markAsteroidPassed","pairId","passed","loseLife","newLives"],"sourceRoot":"../../../../src","sources":["games/space-traveller/SpaceTravellerStore.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAEhC,SAASC,WAAW,QAAQ,4BAAyB;AAgCrD,OAAO,MAAMC,sBAAsB,GAAGF,MAAM,CAAuBG,GAAG,KAAM;EAC1E;EACAC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAEJ,WAAW,CAACK,aAAa;EACnCC,SAAS,EAAE,KAAK;EAChBC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AC;MAAEQ;IAAW,CAAC,CAAC;EACrB,CAAC;EAED8B,iBAAiB,EAAGC,IAAgC,IAAK;IACvDvC,GAAG,CAAC;MAAEgB,cAAc,EAAEuB;IAAK,CAAC,CAAC;EAC/B,CAAC;EAEDC,0BAA0B,EAAGC,aAAsB,IAAK;IACtDzC,GAAG,CAAC;MAAEiB,uBAAuB,EAAEwB;IAAc,CAAC,CAAC;EACjD,CAAC;EAEDC,kBAAkB,EAAGC,MAAc,IAAK;IACtC3C,GAAG,CAACyB,KAAK,KAAK;MACZlB,SAAS,EAAEkB,KAAK,CAAClB,SAAS,CAAC6B,GAAG,CAACJ,CAAC,IAC9BA,CAAC,CAACW,MAAM,KAAKA,MAAM,GAAG;QAAE,GAAGX,CAAC;QAAEY,MAAM,EAAE;MAAK,CAAC,GAAGZ,CACjD,CAAC;MACD/B,KAAK,EAAEwB,KAAK,CAACxB,KAAK,GAAG,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;EACL,CAAC;EAED4C,QAAQ,EAAEA,CAAA,KAAM;IACd7C,GAAG,CAACyB,KAAK,IAAI;MACX,MAAMqB,QAAQ,GAAGrB,KAAK,CAACnB,KAAK,GAAG,CAAC;MAEhC,IAAIwC,QAAQ,IAAI,CAAC,EAAE;QACjB,OAAO;UACLxC,KAAK,EAAE,CAAC;UACRF,SAAS,EAAE,KAAK;UAChBC,QAAQ,EAAE;QACZ,CAAC;MACH;MAEA,OAAO;QAAEC,KAAK,EAAEwC;MAAS,CAAC;IAC5B,CAAC,CAAC;EACJ;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","jsx","_jsx","jsxs","_jsxs","AsteroidComponent","asteroid","style","position","left","x","top","y","width","height","backgroundColor","borderRadius","shadowColor","shadowOffset","shadowOpacity","shadowRadius","borderWidth","borderColor","children","Math","max","PipeComponent"],"sourceRoot":"../../../../../src","sources":["games/space-traveller/components/AsteroidComponent.tsx"],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AAE,CAAC;QACTC,eAAe,EAAE,wBAAwB;QACzCC,YAAY,EAAE;MAChB;IAAE,CACH,CAAC,eAGFd,IAAA,CAACF,IAAI;MACHO,KAAK,EAAE;QACLC,QAAQ,EAAE,UAAU;QACpBC,IAAI,EAAEH,QAAQ,CAACO,KAAK,GAAG,GAAG;QAC1BF,GAAG,EAAEL,QAAQ,CAACQ,MAAM,GAAG,GAAG;QAC1BD,KAAK,EAAEP,QAAQ,CAACO,KAAK,GAAG,GAAG;QAC3BC,MAAM,EAAER,QAAQ,CAACQ,MAAM,GAAG,GAAG;QAC7BC,eAAe,EAAE,yBAAyB;QAAE;QAC5CC,YAAY,EAAE;MAChB;IAAE,CACH,CAAC;EAAA,CACE,CAAC;AAEX,CAAC;;AAED;AACA,OAAO,MAAMU,aAAa,GAAGrB,iBAAiB","ignoreList":[]}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
-
import { AsteroidComponent } from "./AsteroidComponent.js";
|
|
6
|
-
import { Spacecraft3D } from "./Spacecraft3D.js";
|
|
7
|
-
import { ParticleComponent } from "./ParticleComponent.js";
|
|
8
|
-
import { SpacecraftPath } from "./SpacecraftPath.js";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export const GameArea = ({
|
|
11
|
-
asteroids,
|
|
12
|
-
spacecraft,
|
|
13
|
-
particles,
|
|
14
|
-
spacecraftPath,
|
|
15
|
-
isControllingSpacecraft
|
|
16
|
-
}) => {
|
|
17
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
18
|
-
style: [styles.gameArea],
|
|
19
|
-
children: [/*#__PURE__*/_jsx(SpacecraftPath, {
|
|
20
|
-
path: spacecraftPath
|
|
21
|
-
}), asteroids.map(asteroid => /*#__PURE__*/_jsx(AsteroidComponent, {
|
|
22
|
-
asteroid: asteroid
|
|
23
|
-
}, asteroid.id)), particles.map(particle => /*#__PURE__*/_jsx(ParticleComponent, {
|
|
24
|
-
particle: particle
|
|
25
|
-
}, particle.id)), /*#__PURE__*/_jsx(Spacecraft3D, {
|
|
26
|
-
spacecraft: spacecraft,
|
|
27
|
-
isControlled: isControllingSpacecraft
|
|
28
|
-
}), asteroids.length === 0 && /*#__PURE__*/_jsxs(View, {
|
|
29
|
-
style: styles.instructionsContainer,
|
|
30
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
31
|
-
style: styles.instructionsEmoji,
|
|
32
|
-
children: "\uD83D\uDE80"
|
|
33
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
34
|
-
style: styles.instructionsTitle,
|
|
35
|
-
children: "Navigate your spacecraft through the space!"
|
|
36
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
37
|
-
style: styles.instructionsSubtitle,
|
|
38
|
-
children: "Touch and drag to control your spacecraft"
|
|
39
|
-
})]
|
|
40
|
-
})]
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
const styles = StyleSheet.create({
|
|
44
|
-
gameArea: {
|
|
45
|
-
flex: 1,
|
|
46
|
-
position: 'relative'
|
|
47
|
-
},
|
|
48
|
-
instructionsContainer: {
|
|
49
|
-
position: 'absolute',
|
|
50
|
-
top: '33%',
|
|
51
|
-
left: 0,
|
|
52
|
-
right: 0,
|
|
53
|
-
opacity: 0.6,
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
justifyContent: 'center'
|
|
56
|
-
},
|
|
57
|
-
instructionsEmoji: {
|
|
58
|
-
textAlign: 'center',
|
|
59
|
-
fontSize: 24,
|
|
60
|
-
marginBottom: 12
|
|
61
|
-
},
|
|
62
|
-
instructionsTitle: {
|
|
63
|
-
color: '#ffffff',
|
|
64
|
-
textAlign: 'center',
|
|
65
|
-
fontSize: 18,
|
|
66
|
-
fontWeight: 'bold',
|
|
67
|
-
marginBottom: 8
|
|
68
|
-
},
|
|
69
|
-
instructionsSubtitle: {
|
|
70
|
-
color: '#ffffff',
|
|
71
|
-
textAlign: 'center',
|
|
72
|
-
marginTop: 8
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
//# sourceMappingURL=GameArea.js.map
|