react-native-games 0.4.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 +121 -130
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +111 -423
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +27 -28
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +42 -117
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +12 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +102 -75
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/GameArea.js +139 -30
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +7 -6
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +0 -3
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinja.js +94 -376
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +19 -22
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +30 -9
- package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +29 -4
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/GameArea.js +194 -29
- package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/GameBackground.js +107 -190
- package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +9 -30
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/index.js +0 -3
- package/lib/module/games/fruit-ninja/components/index.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunner.js +106 -109
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +19 -24
- package/lib/module/games/maze-runner/MazeRunnerConstants.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 +16 -7
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
- package/lib/module/games/maze-runner/components/ScoreBoard.js +8 -3
- 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 -1
- package/lib/module/games/maze-runner/components/index.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidget.js +113 -112
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +20 -23
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +0 -59
- package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +0 -27
- package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -1
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +24 -22
- package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -1
- package/lib/module/games/popit-fidget/components/GameBackground.js +4 -1
- package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -1
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +9 -2
- package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/popit-fidget/components/index.js +0 -2
- package/lib/module/games/popit-fidget/components/index.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighter.js +121 -369
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +21 -23
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +30 -11
- package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterStore.js +54 -2
- package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -1
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +7 -5
- package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -1
- package/lib/module/games/space-fighter/components/GameArea.js +234 -14
- package/lib/module/games/space-fighter/components/GameArea.js.map +1 -1
- package/lib/module/games/space-fighter/components/GameBackground.js +10 -65
- package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -1
- package/lib/module/games/space-fighter/components/ScoreBoard.js +9 -7
- package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +72 -111
- package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -1
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +42 -27
- package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -1
- package/lib/module/games/space-fighter/components/index.js +0 -3
- package/lib/module/games/space-fighter/components/index.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMole.js +63 -73
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +17 -19
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +20 -7
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/GameHole.js +2 -2
- package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +5 -1
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/index.js +0 -1
- package/lib/module/games/whack-a-mole/components/index.js.map +1 -1
- package/lib/module/services/GamesConstants.js +13 -21
- package/lib/module/services/GamesConstants.js.map +1 -1
- package/lib/module/services/GamesService.js +30 -26
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/SoundsService.js +21 -21
- 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 +67 -58
- package/lib/module/shared/helpers/GameControlButton.js.map +1 -1
- package/lib/module/{games/whack-a-mole/components → shared/helpers}/GameOverModal.js +23 -13
- 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/index.js +7 -0
- package/lib/module/shared/helpers/index.js.map +1 -1
- 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 +8 -7
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +0 -2
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
- 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/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 -3
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +2 -14
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +5 -5
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts +9 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts +1 -0
- package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +1 -7
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +0 -3
- package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -8
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +4 -4
- package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.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/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 -1
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +2 -8
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +4 -4
- package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +0 -21
- package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +1 -5
- package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +2 -2
- package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +2 -2
- package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts +0 -2
- package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +3 -8
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +4 -4
- package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +0 -1
- package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +1 -15
- package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +1 -6
- package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/components/index.d.ts +0 -3
- package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +2 -11
- 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 +2 -2
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +0 -1
- package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +47 -38
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesService.d.ts +20 -3
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
- package/lib/typescript/src/services/SoundsService.d.ts +20 -20
- 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.map +1 -1
- package/lib/typescript/src/{games/balloon-blaster/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/index.d.ts +9 -0
- package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/lib/module/games/balloon-blaster/components/GameOverModal.js +0 -133
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -55
- 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/fruit-ninja/components/GameOverModal.js +0 -189
- package/lib/module/games/fruit-ninja/components/GameOverModal.js.map +0 -1
- package/lib/module/games/fruit-ninja/components/ParticleSystem.js +0 -52
- package/lib/module/games/fruit-ninja/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/fruit-ninja/components/SliceTrail.js +0 -58
- package/lib/module/games/fruit-ninja/components/SliceTrail.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/popit-fidget/components/GameOverModal.js +0 -132
- package/lib/module/games/popit-fidget/components/GameOverModal.js.map +0 -1
- package/lib/module/games/popit-fidget/components/ParticleSystem.js +0 -89
- package/lib/module/games/popit-fidget/components/ParticleSystem.js.map +0 -1
- package/lib/module/games/space-fighter/components/GameOverModal.js +0 -182
- package/lib/module/games/space-fighter/components/GameOverModal.js.map +0 -1
- package/lib/module/games/space-fighter/components/ParticleComponent.js +0 -34
- package/lib/module/games/space-fighter/components/ParticleComponent.js.map +0 -1
- package/lib/module/games/space-fighter/components/SettingsModal.js +0 -222
- package/lib/module/games/space-fighter/components/SettingsModal.js.map +0 -1
- package/lib/module/games/whack-a-mole/components/GameOverModal.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 -125
- package/lib/module/shared/settings/SettingsService.js.map +0 -1
- 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/fruit-ninja/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts +0 -8
- package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts +0 -11
- package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.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/popit-fidget/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts +0 -9
- package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts +0 -8
- package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts.map +0 -1
- package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts +0 -9
- package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts.map +0 -1
- package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts +0 -9
- package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.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 -33
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { View, Text, StyleSheet } from 'react-native';
|
|
5
5
|
import { GAME_CONFIG } from "../FruitNinjaService.js";
|
|
6
|
+
import { useFruitNinjaStore } from "../FruitNinjaStore.js";
|
|
6
7
|
import { RESPONSIVE_SCOREBOARD_CONTAINER, RESPONSIVE_SCOREBOARD_FONTS } from "../../../shared/helpers/index.js";
|
|
7
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
export const ScoreBoard = ({
|
|
9
|
-
score
|
|
10
|
-
timeLeft
|
|
11
|
-
lives
|
|
12
|
-
}) => {
|
|
9
|
+
export const ScoreBoard = /*#__PURE__*/React.memo(() => {
|
|
10
|
+
const score = useFruitNinjaStore(state => state.score);
|
|
11
|
+
const timeLeft = useFruitNinjaStore(state => state.timeLeft);
|
|
12
|
+
const lives = useFruitNinjaStore(state => state.lives);
|
|
13
13
|
return /*#__PURE__*/_jsxs(View, {
|
|
14
14
|
style: styles.scoreBoard,
|
|
15
15
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
@@ -40,13 +40,13 @@ export const ScoreBoard = ({
|
|
|
40
40
|
children: Array.from({
|
|
41
41
|
length: GAME_CONFIG.MAX_LIVES
|
|
42
42
|
}).map((_, index) => /*#__PURE__*/_jsx(Text, {
|
|
43
|
-
style:
|
|
44
|
-
children:
|
|
43
|
+
style: styles.heartIcon,
|
|
44
|
+
children: index < lives ? '❤️' : '🖤'
|
|
45
45
|
}, index))
|
|
46
46
|
})]
|
|
47
47
|
})]
|
|
48
48
|
});
|
|
49
|
-
};
|
|
49
|
+
});
|
|
50
50
|
const styles = StyleSheet.create({
|
|
51
51
|
scoreBoard: {
|
|
52
52
|
...RESPONSIVE_SCOREBOARD_CONTAINER,
|
|
@@ -85,28 +85,7 @@ const styles = StyleSheet.create({
|
|
|
85
85
|
},
|
|
86
86
|
heartIcon: {
|
|
87
87
|
fontSize: 24,
|
|
88
|
-
marginHorizontal: 3
|
|
89
|
-
fontWeight: 'bold'
|
|
90
|
-
},
|
|
91
|
-
heartActive: {
|
|
92
|
-
color: '#ef4444',
|
|
93
|
-
// Bright red hearts for available lives
|
|
94
|
-
textShadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
95
|
-
textShadowOffset: {
|
|
96
|
-
width: 1,
|
|
97
|
-
height: 1
|
|
98
|
-
},
|
|
99
|
-
textShadowRadius: 2
|
|
100
|
-
},
|
|
101
|
-
heartInactive: {
|
|
102
|
-
color: '#1f2937',
|
|
103
|
-
// Dark black hearts for lost lives
|
|
104
|
-
textShadowColor: 'rgba(255, 255, 255, 0.3)',
|
|
105
|
-
textShadowOffset: {
|
|
106
|
-
width: 1,
|
|
107
|
-
height: 1
|
|
108
|
-
},
|
|
109
|
-
textShadowRadius: 1
|
|
88
|
+
marginHorizontal: 3
|
|
110
89
|
}
|
|
111
90
|
});
|
|
112
91
|
//# sourceMappingURL=ScoreBoard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","StyleSheet","GAME_CONFIG","RESPONSIVE_SCOREBOARD_CONTAINER","RESPONSIVE_SCOREBOARD_FONTS","jsx","_jsx","jsxs","_jsxs","ScoreBoard","score","timeLeft","lives","style","styles","scoreBoard","children","scoreSection","scoreLabel","scoreValue","timeValue","livesRow","Array","from","length","MAX_LIVES","map","_","index","heartIcon","
|
|
1
|
+
{"version":3,"names":["React","View","Text","StyleSheet","GAME_CONFIG","useFruitNinjaStore","RESPONSIVE_SCOREBOARD_CONTAINER","RESPONSIVE_SCOREBOARD_FONTS","jsx","_jsx","jsxs","_jsxs","ScoreBoard","memo","score","state","timeLeft","lives","style","styles","scoreBoard","children","scoreSection","scoreLabel","scoreValue","timeValue","livesRow","Array","from","length","MAX_LIVES","map","_","index","heartIcon","create","flexDirection","justifyContent","alignItems","backgroundColor","marginBottom","borderWidth","borderColor","flex","fontSize","labelSize","fontWeight","color","valueSize","timeSize","marginHorizontal"],"sourceRoot":"../../../../../src","sources":["games/fruit-ninja/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,kBAAkB,QAAQ,uBAAoB;AACv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AAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDrB,QAAQ,EAAE;IACRU,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDH,SAAS,EAAE;IACTU,QAAQ,EAAE,EAAE;IACZM,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
export { ScoreBoard } from "./ScoreBoard.js";
|
|
4
4
|
export { FruitComponent } from "./FruitComponent.js";
|
|
5
|
-
export { SliceTrail } from "./SliceTrail.js";
|
|
6
|
-
export { ParticleSystem } from "./ParticleSystem.js";
|
|
7
5
|
export { GameArea } from "./GameArea.js";
|
|
8
|
-
export { GameOverModal } from "./GameOverModal.js";
|
|
9
6
|
export { GameBackground } from "./GameBackground.js";
|
|
10
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ScoreBoard","FruitComponent","
|
|
1
|
+
{"version":3,"names":["ScoreBoard","FruitComponent","GameArea","GameBackground"],"sourceRoot":"../../../../../src","sources":["games/fruit-ninja/components/index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAc;AACzC,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,QAAQ,QAAQ,eAAY;AACrC,SAASC,cAAc,QAAQ,qBAAkB","ignoreList":[]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
4
|
-
import { View, StyleSheet,
|
|
4
|
+
import { View, StyleSheet, Dimensions } from 'react-native';
|
|
5
5
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
6
|
import { playSound, GAME_SOUNDS } from "../../services/SoundsService.js";
|
|
7
7
|
import { playHaptic, HapticType } from "../../services/HapticsService.js";
|
|
8
8
|
import { MazeRunnerService } from "./MazeRunnerService.js";
|
|
9
9
|
import { DEFAULT_MAZE_RUNNER_SETTINGS, MAZE_RUNNER_DIFFICULTY_CONFIG } from "./MazeRunnerConstants.js";
|
|
10
|
-
import { GameBackground, ScoreBoard, EnhancedGameArea
|
|
11
|
-
import { GameControlButton } from "../../shared/helpers/index.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { GameBackground, ScoreBoard, EnhancedGameArea } from "./components/index.js";
|
|
11
|
+
import { GameControlButton, GameOverModal } from "../../shared/helpers/index.js";
|
|
12
|
+
import { GameSettingsModal } from "../../shared/helpers/index.js";
|
|
13
|
+
import { GAME_IDS } from "../../services/GamesService.js";
|
|
14
14
|
|
|
15
|
-
//
|
|
15
|
+
// Optimized hook to handle responsive dimensions with memoization
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const useResponsiveDimensions = () => {
|
|
18
18
|
const [dimensions, setDimensions] = useState(() => {
|
|
@@ -26,23 +26,28 @@ const useResponsiveDimensions = () => {
|
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
useEffect(() => {
|
|
29
|
-
const
|
|
29
|
+
const handleDimensionChange = ({
|
|
30
30
|
window
|
|
31
31
|
}) => {
|
|
32
|
-
setDimensions({
|
|
33
|
-
|
|
34
|
-
height
|
|
32
|
+
setDimensions(prev => {
|
|
33
|
+
// Only update if dimensions actually changed to prevent unnecessary re-renders
|
|
34
|
+
if (prev.width !== window.width || prev.height !== window.height) {
|
|
35
|
+
return {
|
|
36
|
+
width: window.width,
|
|
37
|
+
height: window.height
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return prev;
|
|
35
41
|
});
|
|
36
|
-
}
|
|
42
|
+
};
|
|
43
|
+
const subscription = Dimensions.addEventListener('change', handleDimensionChange);
|
|
37
44
|
return () => subscription?.remove();
|
|
38
45
|
}, []);
|
|
39
46
|
return dimensions;
|
|
40
47
|
};
|
|
41
48
|
export const MazeRunner = ({
|
|
42
|
-
settings
|
|
43
|
-
onSettingsChange
|
|
44
|
-
showSettingsModal = false,
|
|
45
|
-
onToggleSettingsModal
|
|
49
|
+
settings,
|
|
50
|
+
onSettingsChange
|
|
46
51
|
}) => {
|
|
47
52
|
// Use responsive dimensions hook inside the component
|
|
48
53
|
const {
|
|
@@ -50,28 +55,6 @@ export const MazeRunner = ({
|
|
|
50
55
|
height: screenHeight
|
|
51
56
|
} = useResponsiveDimensions();
|
|
52
57
|
|
|
53
|
-
// Create unified game settings store
|
|
54
|
-
const settingsStore = useMemo(() => {
|
|
55
|
-
const defaultSettings = {
|
|
56
|
-
...DEFAULT_MAZE_RUNNER_SETTINGS,
|
|
57
|
-
...externalSettings
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// Wrapper function to handle the callback type mismatch
|
|
61
|
-
const handleSettingsChange = onSettingsChange ? newSettings => {
|
|
62
|
-
const mazeRunnerSettings = {
|
|
63
|
-
...DEFAULT_MAZE_RUNNER_SETTINGS,
|
|
64
|
-
...externalSettings,
|
|
65
|
-
difficulty: newSettings.difficulty,
|
|
66
|
-
soundEnabled: newSettings.soundEnabled,
|
|
67
|
-
hapticEnabled: newSettings.hapticEnabled,
|
|
68
|
-
gameDuration: newSettings.gameDuration
|
|
69
|
-
};
|
|
70
|
-
onSettingsChange(mazeRunnerSettings);
|
|
71
|
-
} : undefined;
|
|
72
|
-
return createGameSettingsStore(defaultSettings, handleSettingsChange);
|
|
73
|
-
}, [externalSettings, onSettingsChange]);
|
|
74
|
-
|
|
75
58
|
// Memoize responsive game area dimensions calculation
|
|
76
59
|
const responsiveDimensions = useMemo(() => {
|
|
77
60
|
// Reserve space for scoreboard (~80px), control button (~100px), and padding (~40px)
|
|
@@ -90,11 +73,11 @@ export const MazeRunner = ({
|
|
|
90
73
|
};
|
|
91
74
|
}, [screenWidth, screenHeight]);
|
|
92
75
|
|
|
93
|
-
//
|
|
94
|
-
const
|
|
76
|
+
// Memoized game service initialization to prevent recreation
|
|
77
|
+
const gameService = useMemo(() => {
|
|
95
78
|
const currentSettings = {
|
|
96
79
|
...DEFAULT_MAZE_RUNNER_SETTINGS,
|
|
97
|
-
...
|
|
80
|
+
...settings
|
|
98
81
|
};
|
|
99
82
|
// Calculate initial dimensions for service creation
|
|
100
83
|
const {
|
|
@@ -108,7 +91,7 @@ export const MazeRunner = ({
|
|
|
108
91
|
const gameAreaSize = Math.max(300, Math.min(maxDimension, 600));
|
|
109
92
|
return new MazeRunnerService(currentSettings.gridSize, gameAreaSize, gameAreaSize, currentSettings.gameDuration // Pass game duration for countdown timer
|
|
110
93
|
);
|
|
111
|
-
});
|
|
94
|
+
}, []); // Empty dependency array to create only once
|
|
112
95
|
|
|
113
96
|
// Game state
|
|
114
97
|
const [gameState, setGameState] = useState(gameService.getGameState());
|
|
@@ -116,12 +99,36 @@ export const MazeRunner = ({
|
|
|
116
99
|
const [walls, setWalls] = useState(() => gameService.getWalls());
|
|
117
100
|
const completionHandledRef = useRef(false);
|
|
118
101
|
|
|
119
|
-
// Settings
|
|
120
|
-
const settings = settingsStore();
|
|
102
|
+
// Settings are already available from the global store hook above
|
|
121
103
|
|
|
122
104
|
// Memoize game config (updates when dimensions change)
|
|
123
105
|
const gameConfig = useMemo(() => gameService.getGameConfig(), [gameService, responsiveDimensions]);
|
|
124
106
|
|
|
107
|
+
// Memoize game control button props to prevent unnecessary re-renders
|
|
108
|
+
const gameControlButtonProps = useMemo(() => ({
|
|
109
|
+
isPlaying: gameState.isPlaying,
|
|
110
|
+
gameOver: gameState.isCompleted || gameState.gameOver,
|
|
111
|
+
startButtonText: "START MAZE",
|
|
112
|
+
stopButtonText: "STOP GAME",
|
|
113
|
+
startButtonSubtext: "Navigate the maze!",
|
|
114
|
+
stopButtonSubtext: "End current game",
|
|
115
|
+
startButtonColor: "#8b4513",
|
|
116
|
+
stopButtonColor: "#dc2626",
|
|
117
|
+
startButtonBorderColor: "#cd853f",
|
|
118
|
+
stopButtonBorderColor: "#f87171"
|
|
119
|
+
}), [gameState.isPlaying, gameState.isCompleted, gameState.gameOver]);
|
|
120
|
+
|
|
121
|
+
// Memoize game over modal props to prevent unnecessary re-renders
|
|
122
|
+
const gameOverModalProps = useMemo(() => ({
|
|
123
|
+
isVisible: showGameOverModal,
|
|
124
|
+
score: gameState.score,
|
|
125
|
+
buttonText: gameState.isCompleted ? "Navigate Again!" : "Try Again!",
|
|
126
|
+
primaryColor: "rgba(139, 69, 19, 0.8)",
|
|
127
|
+
borderColor: "rgba(139, 69, 19, 0.9)",
|
|
128
|
+
buttonColor: "#8b4513",
|
|
129
|
+
buttonBorderColor: "#cd853f"
|
|
130
|
+
}), [showGameOverModal, gameState.score, gameState.isCompleted]);
|
|
131
|
+
|
|
125
132
|
// Generate new maze on component mount
|
|
126
133
|
useEffect(() => {
|
|
127
134
|
gameService.resetGame(); // Generate fresh maze on launch
|
|
@@ -129,58 +136,68 @@ export const MazeRunner = ({
|
|
|
129
136
|
|
|
130
137
|
// Update game service when settings change or screen dimensions change
|
|
131
138
|
useEffect(() => {
|
|
132
|
-
const
|
|
133
|
-
const
|
|
139
|
+
const difficultyConfig = MAZE_RUNNER_DIFFICULTY_CONFIG[settings.difficulty];
|
|
140
|
+
const gridSize = difficultyConfig.gridSize;
|
|
141
|
+
const gameDuration = difficultyConfig.gameDuration; // Get from difficulty config
|
|
142
|
+
|
|
134
143
|
gameService.updateSettings(gridSize, gameDuration, responsiveDimensions.width, responsiveDimensions.height);
|
|
135
|
-
}, [settings.difficulty,
|
|
144
|
+
}, [settings.difficulty, gameService, responsiveDimensions]);
|
|
136
145
|
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
146
|
+
// Memoized state change callback to prevent recreation
|
|
147
|
+
const handleStateChange = useCallback(newState => {
|
|
148
|
+
setGameState(prevState => {
|
|
149
|
+
// Handle game completion (only once per level)
|
|
150
|
+
if (newState.isCompleted && !completionHandledRef.current) {
|
|
151
|
+
completionHandledRef.current = true;
|
|
152
|
+
handleGameCompleted();
|
|
153
|
+
// Show game over modal immediately when maze is completed
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
setShowGameOverModal(true);
|
|
156
|
+
}, 500); // Short delay to let completion animation/feedback finish
|
|
157
|
+
}
|
|
150
158
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
+
// Handle game over (if you want to show modal after certain time)
|
|
160
|
+
if (!newState.isPlaying && prevState.isPlaying && !newState.isCompleted) {
|
|
161
|
+
setTimeout(() => {
|
|
162
|
+
setShowGameOverModal(true);
|
|
163
|
+
}, 1000);
|
|
164
|
+
}
|
|
165
|
+
return newState;
|
|
166
|
+
});
|
|
159
167
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
// Update walls whenever game state changes (maze might have been regenerated)
|
|
169
|
+
setWalls(gameService.getWalls());
|
|
170
|
+
}, [gameService]);
|
|
171
|
+
|
|
172
|
+
// Set up game state change callback
|
|
173
|
+
useEffect(() => {
|
|
163
174
|
gameService.setGameStateChangeCallback(handleStateChange);
|
|
164
175
|
return () => {
|
|
176
|
+
// Fully reset game when unmounting (navigate back)
|
|
177
|
+
try {
|
|
178
|
+
gameService.stopGame();
|
|
179
|
+
} catch {}
|
|
180
|
+
try {
|
|
181
|
+
gameService.resetGame();
|
|
182
|
+
} catch {}
|
|
165
183
|
gameService.cleanup();
|
|
166
184
|
};
|
|
167
|
-
}, []);
|
|
168
|
-
|
|
185
|
+
}, [gameService, handleStateChange]);
|
|
169
186
|
const handleGameCompleted = useCallback(() => {
|
|
170
|
-
playSound(GAME_SOUNDS.MAZE_RUNNER.COMPLETE, settings.
|
|
171
|
-
playHaptic(HapticType.SUCCESS, settings.
|
|
172
|
-
}, [settings.
|
|
187
|
+
playSound(GAME_SOUNDS.MAZE_RUNNER.COMPLETE, settings.enableSounds);
|
|
188
|
+
playHaptic(HapticType.SUCCESS, settings.enableHaptics);
|
|
189
|
+
}, [settings.enableSounds, settings.enableHaptics]);
|
|
173
190
|
const handleStartGame = useCallback(() => {
|
|
174
191
|
completionHandledRef.current = false; // Reset completion flag
|
|
175
192
|
gameService.startGame();
|
|
176
193
|
setShowGameOverModal(false);
|
|
177
|
-
playSound(GAME_SOUNDS.MAZE_RUNNER.START, settings.
|
|
178
|
-
playHaptic(HapticType.MEDIUM, settings.
|
|
179
|
-
}, [gameService, settings.
|
|
194
|
+
playSound(GAME_SOUNDS.MAZE_RUNNER.START, settings.enableSounds);
|
|
195
|
+
playHaptic(HapticType.MEDIUM, settings.enableHaptics);
|
|
196
|
+
}, [gameService, settings.enableSounds, settings.enableHaptics]);
|
|
180
197
|
const handleStopGame = useCallback(() => {
|
|
181
198
|
gameService.stopGame();
|
|
182
|
-
playSound(GAME_SOUNDS.MAZE_RUNNER.STOP, settings.
|
|
183
|
-
}, [gameService, settings.
|
|
199
|
+
playSound(GAME_SOUNDS.MAZE_RUNNER.STOP, settings.enableSounds);
|
|
200
|
+
}, [gameService, settings.enableSounds]);
|
|
184
201
|
const handleBallPositionChange = useCallback(position => {
|
|
185
202
|
return gameService.updateBallPosition(position);
|
|
186
203
|
}, [gameService]);
|
|
@@ -189,9 +206,6 @@ export const MazeRunner = ({
|
|
|
189
206
|
setShowGameOverModal(false);
|
|
190
207
|
gameService.resetGame(); // Reset without auto-starting
|
|
191
208
|
}, [gameService]);
|
|
192
|
-
const handleCloseGameOverModal = useCallback(() => {
|
|
193
|
-
setShowGameOverModal(false);
|
|
194
|
-
}, []);
|
|
195
209
|
return /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
196
210
|
style: styles.container,
|
|
197
211
|
children: /*#__PURE__*/_jsxs(View, {
|
|
@@ -208,36 +222,19 @@ export const MazeRunner = ({
|
|
|
208
222
|
gameConfig: gameConfig,
|
|
209
223
|
walls: walls,
|
|
210
224
|
onBallPositionChange: handleBallPositionChange,
|
|
211
|
-
hapticEnabled: settings.
|
|
225
|
+
hapticEnabled: settings.enableHaptics
|
|
212
226
|
})
|
|
213
227
|
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
214
|
-
|
|
215
|
-
gameOver: gameState.isCompleted || gameState.gameOver,
|
|
228
|
+
...gameControlButtonProps,
|
|
216
229
|
onStartGame: handleStartGame,
|
|
217
|
-
onStopGame: handleStopGame
|
|
218
|
-
startButtonText: "START MAZE",
|
|
219
|
-
stopButtonText: "STOP GAME",
|
|
220
|
-
startButtonSubtext: "Navigate the maze!",
|
|
221
|
-
stopButtonSubtext: "End current game",
|
|
222
|
-
startButtonColor: "#8b4513",
|
|
223
|
-
stopButtonColor: "#dc2626",
|
|
224
|
-
startButtonBorderColor: "#cd853f",
|
|
225
|
-
stopButtonBorderColor: "#f87171"
|
|
230
|
+
onStopGame: handleStopGame
|
|
226
231
|
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
animationType: "slide",
|
|
234
|
-
presentationStyle: "pageSheet",
|
|
235
|
-
onRequestClose: onToggleSettingsModal,
|
|
236
|
-
children: /*#__PURE__*/_jsx(GameSettings, {
|
|
237
|
-
gameId: "maze-runner",
|
|
238
|
-
onClose: onToggleSettingsModal || (() => {}),
|
|
239
|
-
settingsStore: settingsStore()
|
|
240
|
-
})
|
|
232
|
+
...gameOverModalProps,
|
|
233
|
+
onPlayAgain: handlePlayAgain
|
|
234
|
+
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
235
|
+
gameId: GAME_IDS.MAZE_RUNNER,
|
|
236
|
+
settings: settings,
|
|
237
|
+
onSettingsChange: onSettingsChange
|
|
241
238
|
})]
|
|
242
239
|
})
|
|
243
240
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useEffect","useCallback","useRef","useMemo","View","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","useState","useEffect","useCallback","useRef","useMemo","View","StyleSheet","Dimensions","GestureHandlerRootView","playSound","GAME_SOUNDS","playHaptic","HapticType","MazeRunnerService","DEFAULT_MAZE_RUNNER_SETTINGS","MAZE_RUNNER_DIFFICULTY_CONFIG","GameBackground","ScoreBoard","EnhancedGameArea","GameControlButton","GameOverModal","GameSettingsModal","GAME_IDS","jsx","_jsx","jsxs","_jsxs","useResponsiveDimensions","dimensions","setDimensions","width","height","get","handleDimensionChange","window","prev","subscription","addEventListener","remove","MazeRunner","settings","onSettingsChange","screenWidth","screenHeight","responsiveDimensions","reservedHeight","availableHeight","availableWidth","maxDimension","Math","min","gameAreaSize","max","gameService","currentSettings","initialWidth","initialHeight","gridSize","gameDuration","gameState","setGameState","getGameState","showGameOverModal","setShowGameOverModal","walls","setWalls","getWalls","completionHandledRef","gameConfig","getGameConfig","gameControlButtonProps","isPlaying","gameOver","isCompleted","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","score","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","resetGame","difficultyConfig","difficulty","updateSettings","handleStateChange","newState","prevState","current","handleGameCompleted","setTimeout","setGameStateChangeCallback","stopGame","cleanup","MAZE_RUNNER","COMPLETE","enableSounds","SUCCESS","enableHaptics","handleStartGame","startGame","START","MEDIUM","handleStopGame","STOP","handleBallPositionChange","position","updateBallPosition","handlePlayAgain","style","styles","container","children","gameContainer","gameAreaContainer","onBallPositionChange","hapticEnabled","onStartGame","onStopGame","onPlayAgain","gameId","create","flex","justifyContent","alignItems","paddingHorizontal","paddingVertical"],"sourceRoot":"../../../../src","sources":["games/maze-runner/MazeRunner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAE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AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -34,39 +34,34 @@ export const MAZE_RUNNER_DIFFICULTY_CONFIG = {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
// Maze Runner Game Theme
|
|
37
|
+
// Maze Runner Game Theme - Matches scoreboard brown
|
|
38
38
|
export const MAZE_RUNNER_THEME = {
|
|
39
|
-
backgroundColor: '#
|
|
40
|
-
//
|
|
41
|
-
headerBackgroundColor: 'rgba(
|
|
42
|
-
//
|
|
39
|
+
backgroundColor: '#f5f5dc',
|
|
40
|
+
// Beige background to match maze theme
|
|
41
|
+
headerBackgroundColor: 'rgba(139, 69, 19, 0.9)',
|
|
42
|
+
// Brown header to match scoreboard
|
|
43
43
|
headerTextColor: '#ffffff',
|
|
44
|
-
sectionBackgroundColor: 'rgba(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
sectionBackgroundColor: 'rgba(139, 69, 19, 0.4)',
|
|
45
|
+
// Match scoreboard transparency
|
|
46
|
+
sectionTitleColor: '#ffffff',
|
|
47
|
+
// White text on brown sections
|
|
48
|
+
buttonSelectedColor: '#8b4513',
|
|
49
|
+
// Match start button brown
|
|
49
50
|
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
50
51
|
buttonSelectedTextColor: '#ffffff',
|
|
51
52
|
buttonUnselectedTextColor: '#1f2937',
|
|
52
|
-
switchTrackColorFalse: '
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Amber
|
|
58
|
-
infoTextColor: '#374151',
|
|
59
|
-
// Gray
|
|
60
|
-
resetButtonColor: '#ef4444',
|
|
61
|
-
// Red
|
|
62
|
-
resetButtonTextColor: '#ffffff'
|
|
53
|
+
switchTrackColorFalse: 'rgba(139, 69, 19, 0.5)',
|
|
54
|
+
switchTrackColorTrue: '#8b4513',
|
|
55
|
+
// Match start button
|
|
56
|
+
switchThumbColor: '#ffffff',
|
|
57
|
+
infoTextColor: '#1f2937' // Dark text for readability
|
|
63
58
|
};
|
|
64
59
|
|
|
65
60
|
// Maze Runner Difficulty Descriptions
|
|
66
61
|
export const MAZE_RUNNER_DIFFICULTY_DESCRIPTIONS = {
|
|
67
|
-
easy: '
|
|
68
|
-
medium: '
|
|
69
|
-
hard: '
|
|
62
|
+
easy: 'Small maze, more forgiving maze',
|
|
63
|
+
medium: 'Balanced maze, balanced challenge',
|
|
64
|
+
hard: 'Complex maze, maximum challenge!'
|
|
70
65
|
};
|
|
71
66
|
|
|
72
67
|
// Vibrant color palette for Maze Runner background (inspired by adventure themes)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DEFAULT_MAZE_RUNNER_SETTINGS","difficulty","gameDuration","soundEnabled","hapticEnabled","gridSize","showHints","MAZE_RUNNER_DIFFICULTY_CONFIG","easy","timeBonus","scoreMultiplier","hintAvailable","medium","hard","MAZE_RUNNER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","
|
|
1
|
+
{"version":3,"names":["DEFAULT_MAZE_RUNNER_SETTINGS","difficulty","gameDuration","soundEnabled","hapticEnabled","gridSize","showHints","MAZE_RUNNER_DIFFICULTY_CONFIG","easy","timeBonus","scoreMultiplier","hintAvailable","medium","hard","MAZE_RUNNER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","MAZE_RUNNER_DIFFICULTY_DESCRIPTIONS","MAZE_ADVENTURE_COLORS"],"sourceRoot":"../../../../src","sources":["games/maze-runner/MazeRunnerConstants.ts"],"mappings":";;AAEA;;AAUA,OAAO,MAAM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EAAE;AACR,CAAU;;AAEV;AACA,OAAO,MAAMgB,qBAAqB,GAAG,CACnC,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS,CAAE;AAAA,CACH","ignoreList":[]}
|
|
@@ -5,7 +5,8 @@ import { Canvas, Circle, RadialGradient, vec, Shadow } from '@shopify/react-nati
|
|
|
5
5
|
import { useSharedValue, useAnimatedStyle, withRepeat, withTiming, withSequence } from 'react-native-reanimated';
|
|
6
6
|
import Animated from 'react-native-reanimated';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// Memoized EnhancedBallComponent to prevent unnecessary re-renders
|
|
9
|
+
export const EnhancedBallComponent = /*#__PURE__*/React.memo(({
|
|
9
10
|
position,
|
|
10
11
|
size,
|
|
11
12
|
isDragging,
|
|
@@ -31,9 +32,9 @@ export const EnhancedBallComponent = ({
|
|
|
31
32
|
}, []);
|
|
32
33
|
React.useEffect(() => {
|
|
33
34
|
if (isDragging) {
|
|
34
|
-
pulseScale.value = withTiming(1.
|
|
35
|
+
pulseScale.value = withTiming(1.05, {
|
|
35
36
|
duration: 200
|
|
36
|
-
});
|
|
37
|
+
}); // Reduced from 1.2 to 1.05 for subtle effect
|
|
37
38
|
} else {
|
|
38
39
|
pulseScale.value = withTiming(1, {
|
|
39
40
|
duration: 200
|
|
@@ -145,5 +146,5 @@ export const EnhancedBallComponent = ({
|
|
|
145
146
|
})]
|
|
146
147
|
})
|
|
147
148
|
});
|
|
148
|
-
};
|
|
149
|
+
});
|
|
149
150
|
//# sourceMappingURL=EnhancedBallComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Canvas","Circle","RadialGradient","vec","Shadow","useSharedValue","useAnimatedStyle","withRepeat","withTiming","withSequence","Animated","jsx","_jsx","jsxs","_jsxs","EnhancedBallComponent","position","size","isDragging","isCompleted","rotation","glowIntensity","pulseScale","completionGlow","useEffect","value","duration","animatedStyle","scale","rotationDegrees","left","x","top","y","width","height","transform","rotate","canvasSize","ballRadius","centerX","centerY","View","style","children","cx","cy","r","opacity","c","colors","dx","dy","blur","color","strokeWidth"],"sourceRoot":"../../../../../src","sources":["games/maze-runner/components/EnhancedBallComponent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,MAAM,EAAEC,cAAc,EAAEC,GAAG,EAAEC,MAAM,QAAQ,4BAA4B;AACxF,SACEC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,YAAY,QACP,yBAAyB;AAChC,OAAOC,QAAQ,MAAM,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU/C,OAAO,MAAMC,qBAA2D,
|
|
1
|
+
{"version":3,"names":["React","Canvas","Circle","RadialGradient","vec","Shadow","useSharedValue","useAnimatedStyle","withRepeat","withTiming","withSequence","Animated","jsx","_jsx","jsxs","_jsxs","EnhancedBallComponent","memo","position","size","isDragging","isCompleted","rotation","glowIntensity","pulseScale","completionGlow","useEffect","value","duration","animatedStyle","scale","rotationDegrees","left","x","top","y","width","height","transform","rotate","canvasSize","ballRadius","centerX","centerY","View","style","children","cx","cy","r","opacity","c","colors","dx","dy","blur","color","strokeWidth"],"sourceRoot":"../../../../../src","sources":["games/maze-runner/components/EnhancedBallComponent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,EAAEC,MAAM,EAAEC,cAAc,EAAEC,GAAG,EAAEC,MAAM,QAAQ,4BAA4B;AACxF,SACEC,cAAc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