react-native-games 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +66 -0
- package/README.md +269 -0
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +391 -0
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +293 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +156 -0
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +227 -0
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/GameArea.js +42 -0
- package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/GameBackground.js +544 -0
- package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/GameControls.js +229 -0
- package/lib/module/games/balloon-blaster/components/GameControls.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/GameOverModal.js +133 -0
- package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js +52 -0
- package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +119 -0
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/SliceTrail.js +58 -0
- package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +1 -0
- package/lib/module/games/balloon-blaster/components/index.js +11 -0
- package/lib/module/games/balloon-blaster/components/index.js.map +1 -0
- package/lib/module/games/cat-popper/CatPopper.js +230 -0
- package/lib/module/games/cat-popper/CatPopper.js.map +1 -0
- package/lib/module/games/cat-popper/CatPopperService.js +100 -0
- package/lib/module/games/cat-popper/CatPopperService.js.map +1 -0
- package/lib/module/games/cat-popper/CatPopperStore.js +113 -0
- package/lib/module/games/cat-popper/CatPopperStore.js.map +1 -0
- package/lib/module/games/cat-popper/components/CatCharacter.js +281 -0
- package/lib/module/games/cat-popper/components/CatCharacter.js.map +1 -0
- package/lib/module/games/cat-popper/components/GameBackground.js +531 -0
- package/lib/module/games/cat-popper/components/GameBackground.js.map +1 -0
- package/lib/module/games/cat-popper/components/GameControls.js +230 -0
- package/lib/module/games/cat-popper/components/GameControls.js.map +1 -0
- package/lib/module/games/cat-popper/components/GameGrid.js +66 -0
- package/lib/module/games/cat-popper/components/GameGrid.js.map +1 -0
- package/lib/module/games/cat-popper/components/GameHole.js +183 -0
- package/lib/module/games/cat-popper/components/GameHole.js.map +1 -0
- package/lib/module/games/cat-popper/components/GameOverModal.js +131 -0
- package/lib/module/games/cat-popper/components/GameOverModal.js.map +1 -0
- package/lib/module/games/cat-popper/components/ScoreBoard.js +77 -0
- package/lib/module/games/cat-popper/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/cat-popper/components/index.js +10 -0
- package/lib/module/games/cat-popper/components/index.js.map +1 -0
- package/lib/module/games/fruit-slicer/FruitSlicer.js +411 -0
- package/lib/module/games/fruit-slicer/FruitSlicer.js.map +1 -0
- package/lib/module/games/fruit-slicer/FruitSlicerService.js +293 -0
- package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +1 -0
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js +156 -0
- package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/FruitComponent.js +99 -0
- package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/GameArea.js +50 -0
- package/lib/module/games/fruit-slicer/components/GameArea.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/GameBackground.js +1296 -0
- package/lib/module/games/fruit-slicer/components/GameBackground.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/GameControls.js +230 -0
- package/lib/module/games/fruit-slicer/components/GameControls.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/GameOverModal.js +189 -0
- package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js +52 -0
- package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/ScoreBoard.js +121 -0
- package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/SliceTrail.js +58 -0
- package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +1 -0
- package/lib/module/games/fruit-slicer/components/index.js +11 -0
- package/lib/module/games/fruit-slicer/components/index.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunner.js +242 -0
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -0
- package/lib/module/games/maze-runner/MazeRunnerService.js +560 -0
- package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -0
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +149 -0
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -0
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +357 -0
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -0
- package/lib/module/games/maze-runner/components/GameBackground.js +216 -0
- package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -0
- package/lib/module/games/maze-runner/components/GameControls.js +129 -0
- package/lib/module/games/maze-runner/components/GameControls.js.map +1 -0
- package/lib/module/games/maze-runner/components/GameOverModal.js +134 -0
- package/lib/module/games/maze-runner/components/GameOverModal.js.map +1 -0
- package/lib/module/games/maze-runner/components/ScoreBoard.js +81 -0
- package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +209 -0
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js.map +1 -0
- package/lib/module/games/maze-runner/components/StaticGameBackground.js +169 -0
- package/lib/module/games/maze-runner/components/StaticGameBackground.js.map +1 -0
- package/lib/module/games/maze-runner/components/WallComponent.js +90 -0
- package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -0
- package/lib/module/games/maze-runner/components/index.js +10 -0
- package/lib/module/games/maze-runner/components/index.js.map +1 -0
- package/lib/module/games/space-traveller/SpaceTraveller.js +393 -0
- package/lib/module/games/space-traveller/SpaceTraveller.js.map +1 -0
- package/lib/module/games/space-traveller/SpaceTravellerService.js +298 -0
- package/lib/module/games/space-traveller/SpaceTravellerService.js.map +1 -0
- package/lib/module/games/space-traveller/SpaceTravellerStore.js +139 -0
- package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +1 -0
- package/lib/module/games/space-traveller/components/AsteroidComponent.js +111 -0
- package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +1 -0
- package/lib/module/games/space-traveller/components/GameArea.js +75 -0
- package/lib/module/games/space-traveller/components/GameArea.js.map +1 -0
- package/lib/module/games/space-traveller/components/GameBackground.js +294 -0
- package/lib/module/games/space-traveller/components/GameBackground.js.map +1 -0
- package/lib/module/games/space-traveller/components/GameControls.js +177 -0
- package/lib/module/games/space-traveller/components/GameControls.js.map +1 -0
- package/lib/module/games/space-traveller/components/GameOverModal.js +182 -0
- package/lib/module/games/space-traveller/components/GameOverModal.js.map +1 -0
- package/lib/module/games/space-traveller/components/ParticleComponent.js +34 -0
- package/lib/module/games/space-traveller/components/ParticleComponent.js.map +1 -0
- package/lib/module/games/space-traveller/components/ScoreBoard.js +143 -0
- package/lib/module/games/space-traveller/components/ScoreBoard.js.map +1 -0
- package/lib/module/games/space-traveller/components/SettingsModal.js +222 -0
- package/lib/module/games/space-traveller/components/SettingsModal.js.map +1 -0
- package/lib/module/games/space-traveller/components/Spacecraft3D.js +362 -0
- package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +1 -0
- package/lib/module/games/space-traveller/components/SpacecraftPath.js +37 -0
- package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +1 -0
- package/lib/module/games/space-traveller/components/index.js +13 -0
- package/lib/module/games/space-traveller/components/index.js.map +1 -0
- package/lib/module/index.js +12 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/services/GamesConstants.js +561 -0
- package/lib/module/services/GamesConstants.js.map +1 -0
- package/lib/module/services/GamesService.js +34 -0
- package/lib/module/services/GamesService.js.map +1 -0
- package/lib/module/shared/settings/GameSettings.js +295 -0
- package/lib/module/shared/settings/GameSettings.js.map +1 -0
- package/lib/module/shared/settings/SettingsService.js +119 -0
- package/lib/module/shared/settings/SettingsService.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +16 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +66 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +37 -0
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts +10 -0
- package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +17 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +10 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +9 -0
- package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +8 -0
- package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +9 -0
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +11 -0
- package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +1 -0
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +9 -0
- package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +13 -0
- package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +32 -0
- package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +21 -0
- package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +7 -0
- package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +10 -0
- package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts +13 -0
- package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts +12 -0
- package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts +9 -0
- package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/cat-popper/components/index.d.ts +8 -0
- package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +16 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts +67 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts +37 -0
- package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts +10 -0
- package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +17 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +10 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +9 -0
- package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +8 -0
- package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +9 -0
- package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +11 -0
- package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +1 -0
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +9 -0
- package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +18 -0
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +82 -0
- package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts +11 -0
- package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts +12 -0
- package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +10 -0
- package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +11 -0
- package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/SkiaPipeComponent.d.ts +25 -0
- package/lib/typescript/src/games/maze-runner/components/SkiaPipeComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/StaticGameBackground.d.ts +7 -0
- package/lib/typescript/src/games/maze-runner/components/StaticGameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts +10 -0
- package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/maze-runner/components/index.d.ts +8 -0
- package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +17 -0
- package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts +65 -0
- package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts +35 -0
- package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +9 -0
- package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +17 -0
- package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts +7 -0
- package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +10 -0
- package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +9 -0
- package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +8 -0
- package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +8 -0
- package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +9 -0
- package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts +9 -0
- package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts +10 -0
- package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +1 -0
- package/lib/typescript/src/games/space-traveller/components/index.d.ts +11 -0
- package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/services/GamesConstants.d.ts +372 -0
- package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -0
- package/lib/typescript/src/services/GamesService.d.ts +8 -0
- package/lib/typescript/src/services/GamesService.d.ts.map +1 -0
- package/lib/typescript/src/shared/settings/GameSettings.d.ts +36 -0
- package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +1 -0
- package/lib/typescript/src/shared/settings/SettingsService.d.ts +32 -0
- package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef } from 'react';
|
|
4
|
+
import { View, StyleSheet, Modal } from 'react-native';
|
|
5
|
+
import { useSharedValue, withSpring, withTiming } from 'react-native-reanimated';
|
|
6
|
+
import * as Speech from 'expo-speech';
|
|
7
|
+
import { useCatPopperStore } from "./CatPopperStore.js";
|
|
8
|
+
import { createCatPopperService, ANIMATION_CONFIG, GAME_CONFIG } from "./CatPopperService.js";
|
|
9
|
+
import { ScoreBoard, GameGrid, GameControls, GameOverModal, GameBackground } from "./components/index.js";
|
|
10
|
+
import { GameSettings } from "../../shared/settings/GameSettings.js";
|
|
11
|
+
import { createGameSettingsStore, CAT_POPPER_CONSTANTS } from "../../services/GamesConstants.js";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
// Constants now imported from centralized GamesConstants.ts
|
|
14
|
+
|
|
15
|
+
export const CatPopper = ({
|
|
16
|
+
settings: externalSettings,
|
|
17
|
+
onSettingsChange,
|
|
18
|
+
showSettingsModal = false,
|
|
19
|
+
onToggleSettingsModal
|
|
20
|
+
}) => {
|
|
21
|
+
const {
|
|
22
|
+
score,
|
|
23
|
+
timeLeft,
|
|
24
|
+
isPlaying,
|
|
25
|
+
gameOver,
|
|
26
|
+
holes,
|
|
27
|
+
startGame,
|
|
28
|
+
stopGame,
|
|
29
|
+
resetGame,
|
|
30
|
+
whackCat,
|
|
31
|
+
decrementTime,
|
|
32
|
+
activateHole,
|
|
33
|
+
deactivateHole,
|
|
34
|
+
setHoles
|
|
35
|
+
} = useCatPopperStore();
|
|
36
|
+
|
|
37
|
+
// Create unified game settings store
|
|
38
|
+
const useSettings = React.useMemo(() => {
|
|
39
|
+
return createGameSettingsStore(externalSettings, onSettingsChange);
|
|
40
|
+
}, []); // Empty dependency array - create store only once
|
|
41
|
+
|
|
42
|
+
const settings = useSettings();
|
|
43
|
+
const {
|
|
44
|
+
difficulty,
|
|
45
|
+
soundEnabled,
|
|
46
|
+
gameDuration
|
|
47
|
+
} = settings;
|
|
48
|
+
|
|
49
|
+
// Get game-specific constants based on difficulty
|
|
50
|
+
const catSpawnInterval = CAT_POPPER_CONSTANTS.catSpawnInterval[difficulty];
|
|
51
|
+
const catVisibleDuration = CAT_POPPER_CONSTANTS.catVisibleDuration[difficulty];
|
|
52
|
+
const gridSize = CAT_POPPER_CONSTANTS.gridSize[difficulty];
|
|
53
|
+
|
|
54
|
+
// Track previous settings to prevent infinite loops
|
|
55
|
+
const prevSettingsRef = React.useRef(externalSettings);
|
|
56
|
+
|
|
57
|
+
// Update settings when external settings change (only if actually different)
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
if (!externalSettings) return;
|
|
60
|
+
const prev = prevSettingsRef.current;
|
|
61
|
+
if (!prev) {
|
|
62
|
+
settings.updateSettings(externalSettings);
|
|
63
|
+
prevSettingsRef.current = externalSettings;
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const hasChanged = prev.difficulty !== externalSettings.difficulty || prev.soundEnabled !== externalSettings.soundEnabled || prev.hapticEnabled !== externalSettings.hapticEnabled;
|
|
67
|
+
if (hasChanged) {
|
|
68
|
+
settings.updateSettings(externalSettings);
|
|
69
|
+
prevSettingsRef.current = externalSettings;
|
|
70
|
+
}
|
|
71
|
+
}, [externalSettings, settings]);
|
|
72
|
+
const createHolesForGrid = size => {
|
|
73
|
+
const totalHoles = size * size;
|
|
74
|
+
return Array.from({
|
|
75
|
+
length: totalHoles
|
|
76
|
+
}, (_, i) => ({
|
|
77
|
+
id: i,
|
|
78
|
+
isActive: false,
|
|
79
|
+
position: {
|
|
80
|
+
x: (i % size - 1) * (GAME_CONFIG.HOLE_SIZE + 20),
|
|
81
|
+
y: Math.floor(i / size - 1) * (GAME_CONFIG.HOLE_SIZE + 20),
|
|
82
|
+
z: 0
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
if (!isPlaying && !gameOver) {
|
|
88
|
+
const newHoles = createHolesForGrid(gridSize);
|
|
89
|
+
setHoles(newHoles);
|
|
90
|
+
}
|
|
91
|
+
}, [gridSize, isPlaying, gameOver, setHoles]);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (!showSettingsModal && !isPlaying && !gameOver) {
|
|
94
|
+
const newHoles = createHolesForGrid(gridSize);
|
|
95
|
+
setHoles(newHoles);
|
|
96
|
+
}
|
|
97
|
+
}, [showSettingsModal, gridSize, setHoles]);
|
|
98
|
+
const maxHoles = 16;
|
|
99
|
+
const catAnimations = useRef(Array.from({
|
|
100
|
+
length: maxHoles
|
|
101
|
+
}, () => useSharedValue(0))).current;
|
|
102
|
+
const hitAnimations = useRef(Array.from({
|
|
103
|
+
length: maxHoles
|
|
104
|
+
}, () => useSharedValue(0))).current;
|
|
105
|
+
const gameService = useRef(createCatPopperService(catAnimations, hitAnimations)).current;
|
|
106
|
+
const playHitSound = () => {
|
|
107
|
+
if (soundEnabled) {
|
|
108
|
+
Speech.speak('Pop!', {
|
|
109
|
+
pitch: 1.8,
|
|
110
|
+
rate: 2.0,
|
|
111
|
+
volume: 0.7
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const playMissSound = () => {
|
|
116
|
+
if (soundEnabled) {
|
|
117
|
+
Speech.speak('Whoosh', {
|
|
118
|
+
pitch: 0.7,
|
|
119
|
+
rate: 1.8,
|
|
120
|
+
volume: 0.5
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const handleStartGame = () => {
|
|
125
|
+
startGame(gameDuration, gridSize);
|
|
126
|
+
gameService.resetAnimations();
|
|
127
|
+
gameService.startGameTimer(decrementTime);
|
|
128
|
+
gameService.startCatSpawning(spawnCat, catSpawnInterval);
|
|
129
|
+
};
|
|
130
|
+
const handleStopGame = () => {
|
|
131
|
+
stopGame();
|
|
132
|
+
gameService.cleanup();
|
|
133
|
+
gameService.resetAnimations();
|
|
134
|
+
};
|
|
135
|
+
const spawnCat = () => {
|
|
136
|
+
const currentHoles = useCatPopperStore.getState().holes;
|
|
137
|
+
const availableHoles = currentHoles.filter(hole => !hole.isActive).map(hole => hole.id);
|
|
138
|
+
gameService.spawnRandomCat(availableHoles, holeId => {
|
|
139
|
+
if (catAnimations[holeId]) {
|
|
140
|
+
catAnimations[holeId].value = withSpring(1, ANIMATION_CONFIG.CAT_SPRING);
|
|
141
|
+
activateHole(holeId);
|
|
142
|
+
}
|
|
143
|
+
}, holeId => {
|
|
144
|
+
const freshHoles = useCatPopperStore.getState().holes;
|
|
145
|
+
const hole = freshHoles.find(h => h.id === holeId);
|
|
146
|
+
if (hole && hole.isActive && catAnimations[holeId]) {
|
|
147
|
+
playMissSound();
|
|
148
|
+
catAnimations[holeId].value = withSpring(0, ANIMATION_CONFIG.CAT_SPRING);
|
|
149
|
+
deactivateHole(holeId);
|
|
150
|
+
}
|
|
151
|
+
}, catVisibleDuration);
|
|
152
|
+
};
|
|
153
|
+
const handleWhackCat = holeId => {
|
|
154
|
+
if (!isPlaying) return;
|
|
155
|
+
const hole = holes.find(h => h.id === holeId);
|
|
156
|
+
if (!hole || !hole.isActive) return;
|
|
157
|
+
gameService.whackCat(holeId, () => {
|
|
158
|
+
playHitSound();
|
|
159
|
+
whackCat(holeId);
|
|
160
|
+
if (catAnimations[holeId]) {
|
|
161
|
+
catAnimations[holeId].value = withSpring(0, ANIMATION_CONFIG.CAT_SPRING);
|
|
162
|
+
}
|
|
163
|
+
if (hitAnimations[holeId]) {
|
|
164
|
+
hitAnimations[holeId].value = withTiming(1, ANIMATION_CONFIG.HIT_TIMING, finished => {
|
|
165
|
+
if (finished && hitAnimations[holeId]) {
|
|
166
|
+
hitAnimations[holeId].value = withTiming(0, ANIMATION_CONFIG.HIT_TIMING);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
const handleResetGame = () => {
|
|
173
|
+
gameService.cleanup();
|
|
174
|
+
resetGame();
|
|
175
|
+
gameService.resetAnimations();
|
|
176
|
+
};
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (gameOver || !isPlaying) {
|
|
179
|
+
gameService.cleanup();
|
|
180
|
+
}
|
|
181
|
+
}, [gameOver, isPlaying]);
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
return () => {
|
|
184
|
+
gameService.cleanup();
|
|
185
|
+
};
|
|
186
|
+
}, []);
|
|
187
|
+
return /*#__PURE__*/_jsx(GameBackground, {
|
|
188
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
189
|
+
style: styles.container,
|
|
190
|
+
children: [/*#__PURE__*/_jsx(ScoreBoard, {
|
|
191
|
+
score: score,
|
|
192
|
+
timeLeft: timeLeft
|
|
193
|
+
}), /*#__PURE__*/_jsx(GameGrid, {
|
|
194
|
+
holes: holes,
|
|
195
|
+
catAnimations: catAnimations,
|
|
196
|
+
hitAnimations: hitAnimations,
|
|
197
|
+
onHolePress: handleWhackCat,
|
|
198
|
+
gridSize: gridSize
|
|
199
|
+
}), /*#__PURE__*/_jsx(GameControls, {
|
|
200
|
+
isPlaying: isPlaying,
|
|
201
|
+
gameOver: gameOver,
|
|
202
|
+
onStartGame: handleStartGame,
|
|
203
|
+
onStopGame: handleStopGame
|
|
204
|
+
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
205
|
+
isVisible: gameOver,
|
|
206
|
+
score: score,
|
|
207
|
+
onPlayAgain: handleResetGame
|
|
208
|
+
}), /*#__PURE__*/_jsx(Modal, {
|
|
209
|
+
visible: showSettingsModal,
|
|
210
|
+
animationType: "slide",
|
|
211
|
+
presentationStyle: "pageSheet",
|
|
212
|
+
onRequestClose: onToggleSettingsModal,
|
|
213
|
+
children: /*#__PURE__*/_jsx(GameSettings, {
|
|
214
|
+
gameId: "whack-it",
|
|
215
|
+
onClose: onToggleSettingsModal || (() => {}),
|
|
216
|
+
settingsStore: settings
|
|
217
|
+
})
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const styles = StyleSheet.create({
|
|
223
|
+
container: {
|
|
224
|
+
flex: 1,
|
|
225
|
+
backgroundColor: 'transparent',
|
|
226
|
+
// Let GameBackground show through
|
|
227
|
+
padding: 20
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
//# sourceMappingURL=CatPopper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","View","StyleSheet","Modal","useSharedValue","withSpring","withTiming","Speech","useCatPopperStore","createCatPopperService","ANIMATION_CONFIG","GAME_CONFIG","ScoreBoard","GameGrid","GameControls","GameOverModal","GameBackground","GameSettings","createGameSettingsStore","CAT_POPPER_CONSTANTS","jsx","_jsx","jsxs","_jsxs","CatPopper","settings","externalSettings","onSettingsChange","showSettingsModal","onToggleSettingsModal","score","timeLeft","isPlaying","gameOver","holes","startGame","stopGame","resetGame","whackCat","decrementTime","activateHole","deactivateHole","setHoles","useSettings","useMemo","difficulty","soundEnabled","gameDuration","catSpawnInterval","catVisibleDuration","gridSize","prevSettingsRef","prev","current","updateSettings","hasChanged","hapticEnabled","createHolesForGrid","size","totalHoles","Array","from","length","_","i","id","isActive","position","x","HOLE_SIZE","y","Math","floor","z","newHoles","maxHoles","catAnimations","hitAnimations","gameService","playHitSound","speak","pitch","rate","volume","playMissSound","handleStartGame","resetAnimations","startGameTimer","startCatSpawning","spawnCat","handleStopGame","cleanup","currentHoles","getState","availableHoles","filter","hole","map","spawnRandomCat","holeId","value","CAT_SPRING","freshHoles","find","h","handleWhackCat","HIT_TIMING","finished","handleResetGame","children","style","styles","container","onHolePress","onStartGame","onStopGame","isVisible","onPlayAgain","visible","animationType","presentationStyle","onRequestClose","gameId","onClose","settingsStore","create","flex","backgroundColor","padding"],"sourceRoot":"../../../../src","sources":["games/cat-popper/CatPopper.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AACtD,SAASC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAAQ,yBAAyB;AAChF,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,SAASC,iBAAiB,QAAQ,qBAAkB;AACpD,SAASC,sBAAsB,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,uBAAoB;AAC1F,SAASC,UAAU,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,aAAa,EAAEC,cAAc,QAAQ,uBAAc;AAChG,SAASC,YAAY,QAAQ,uCAAoC;AACjE,SACEC,uBAAuB,EAEvBC,oBAAoB,QACf,kCAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASvC;;AAEA,OAAO,MAAMC,SAAmC,GAAGA,CAAC;EAClDC,QAAQ,EAAEC,gBAAgB;EAC1BC,gBAA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AE;IACTc,IAAI,EAAE,CAAC;IACPC,eAAe,EAAE,aAAa;IAAE;IAChCC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { CAT_POPPER_GAME_CONFIG as GAME_CONFIG, CAT_POPPER_ANIMATION_CONFIG as ANIMATION_CONFIG, CAT_POPPER_COLORS as COLORS } from "../../services/GamesConstants.js";
|
|
4
|
+
|
|
5
|
+
// Constants now imported from centralized GamesConstants.ts
|
|
6
|
+
// Re-export for backward compatibility
|
|
7
|
+
export { GAME_CONFIG, ANIMATION_CONFIG, COLORS };
|
|
8
|
+
|
|
9
|
+
// Types
|
|
10
|
+
|
|
11
|
+
export class CatPopperService {
|
|
12
|
+
gameTimerRef = null;
|
|
13
|
+
catTimerRef = null;
|
|
14
|
+
catHideTimeouts = {};
|
|
15
|
+
constructor(catAnimations, hitAnimations) {
|
|
16
|
+
this.catAnimations = catAnimations;
|
|
17
|
+
this.hitAnimations = hitAnimations;
|
|
18
|
+
}
|
|
19
|
+
startGameTimer(onTick) {
|
|
20
|
+
this.clearGameTimer();
|
|
21
|
+
this.gameTimerRef = setInterval(onTick, 1000);
|
|
22
|
+
}
|
|
23
|
+
startCatSpawning(spawnCat, customSpawnInterval) {
|
|
24
|
+
this.clearCatTimer();
|
|
25
|
+
const baseInterval = customSpawnInterval || GAME_CONFIG.MAX_SPAWN_INTERVAL;
|
|
26
|
+
const minInterval = Math.max(500, baseInterval * 0.7); // 30% faster minimum
|
|
27
|
+
const maxInterval = baseInterval;
|
|
28
|
+
const spawnLoop = () => {
|
|
29
|
+
spawnCat();
|
|
30
|
+
const nextSpawnTime = Math.random() * (maxInterval - minInterval) + minInterval;
|
|
31
|
+
this.catTimerRef = setTimeout(spawnLoop, nextSpawnTime);
|
|
32
|
+
};
|
|
33
|
+
this.catTimerRef = setTimeout(spawnLoop, GAME_CONFIG.INITIAL_SPAWN_DELAY);
|
|
34
|
+
}
|
|
35
|
+
spawnRandomCat(availableHoles, onCatSpawned, onCatHidden, customVisibleDuration) {
|
|
36
|
+
if (availableHoles.length === 0) return;
|
|
37
|
+
const randomHoleId = availableHoles[Math.floor(Math.random() * availableHoles.length)];
|
|
38
|
+
|
|
39
|
+
// Clear any existing timeout for this hole
|
|
40
|
+
this.clearCatHideTimeout(randomHoleId);
|
|
41
|
+
|
|
42
|
+
// Trigger cat spawn
|
|
43
|
+
onCatSpawned(randomHoleId);
|
|
44
|
+
|
|
45
|
+
// Schedule cat hide with custom duration
|
|
46
|
+
const visibleDuration = customVisibleDuration || GAME_CONFIG.CAT_APPEAR_DURATION;
|
|
47
|
+
this.catHideTimeouts[randomHoleId] = setTimeout(() => {
|
|
48
|
+
onCatHidden(randomHoleId);
|
|
49
|
+
this.catHideTimeouts[randomHoleId] = null;
|
|
50
|
+
}, visibleDuration);
|
|
51
|
+
}
|
|
52
|
+
whackCat(holeId, onWhacked) {
|
|
53
|
+
// Clear the hide timeout to prevent race condition
|
|
54
|
+
this.clearCatHideTimeout(holeId);
|
|
55
|
+
onWhacked();
|
|
56
|
+
}
|
|
57
|
+
resetAnimations() {
|
|
58
|
+
this.catAnimations.forEach(anim => {
|
|
59
|
+
anim.value = 0;
|
|
60
|
+
});
|
|
61
|
+
this.hitAnimations.forEach(anim => {
|
|
62
|
+
anim.value = 0;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
cleanup() {
|
|
66
|
+
this.clearGameTimer();
|
|
67
|
+
this.clearCatTimer();
|
|
68
|
+
this.clearAllCatHideTimeouts();
|
|
69
|
+
}
|
|
70
|
+
clearGameTimer() {
|
|
71
|
+
if (this.gameTimerRef) {
|
|
72
|
+
clearInterval(this.gameTimerRef);
|
|
73
|
+
this.gameTimerRef = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
clearCatTimer() {
|
|
77
|
+
if (this.catTimerRef) {
|
|
78
|
+
clearTimeout(this.catTimerRef);
|
|
79
|
+
this.catTimerRef = null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
clearCatHideTimeout(holeId) {
|
|
83
|
+
if (this.catHideTimeouts[holeId]) {
|
|
84
|
+
clearTimeout(this.catHideTimeouts[holeId]);
|
|
85
|
+
this.catHideTimeouts[holeId] = null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
clearAllCatHideTimeouts() {
|
|
89
|
+
Object.values(this.catHideTimeouts).forEach(timeout => {
|
|
90
|
+
if (timeout) {
|
|
91
|
+
clearTimeout(timeout);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this.catHideTimeouts = {};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export const createCatPopperService = (catAnimations, hitAnimations) => {
|
|
98
|
+
return new CatPopperService(catAnimations, hitAnimations);
|
|
99
|
+
};
|
|
100
|
+
//# sourceMappingURL=CatPopperService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CAT_POPPER_GAME_CONFIG","GAME_CONFIG","CAT_POPPER_ANIMATION_CONFIG","ANIMATION_CONFIG","CAT_POPPER_COLORS","COLORS","CatPopperService","gameTimerRef","catTimerRef","catHideTimeouts","constructor","catAnimations","hitAnimations","startGameTimer","onTick","clearGameTimer","setInterval","startCatSpawning","spawnCat","customSpawnInterval","clearCatTimer","baseInterval","MAX_SPAWN_INTERVAL","minInterval","Math","max","maxInterval","spawnLoop","nextSpawnTime","random","setTimeout","INITIAL_SPAWN_DELAY","spawnRandomCat","availableHoles","onCatSpawned","onCatHidden","customVisibleDuration","length","randomHoleId","floor","clearCatHideTimeout","visibleDuration","CAT_APPEAR_DURATION","whackCat","holeId","onWhacked","resetAnimations","forEach","anim","value","cleanup","clearAllCatHideTimeouts","clearInterval","clearTimeout","Object","values","timeout","createCatPopperService"],"sourceRoot":"../../../../src","sources":["games/cat-popper/CatPopperService.ts"],"mappings":";;AACA,SACEA,sBAAsB,IAAIC,WAAW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IAAI;IAC1B;EACF;EAEQa,aAAaA,CAAA,EAAG;IACtB,IAAI,IAAI,CAACZ,WAAW,EAAE;MACpB6C,YAAY,CAAC,IAAI,CAAC7C,WAAW,CAAC;MAC9B,IAAI,CAACA,WAAW,GAAG,IAAI;IACzB;EACF;EAEQgC,mBAAmBA,CAACI,MAAc,EAAE;IAC1C,IAAI,IAAI,CAACnC,eAAe,CAACmC,MAAM,CAAC,EAAE;MAChCS,YAAY,CAAC,IAAI,CAAC5C,eAAe,CAACmC,MAAM,CAAE,CAAC;MAC3C,IAAI,CAACnC,eAAe,CAACmC,MAAM,CAAC,GAAG,IAAI;IACrC;EACF;EAEQO,uBAAuBA,CAAA,EAAG;IAChCG,MAAM,CAACC,MAAM,CAAC,IAAI,CAAC9C,eAAe,CAAC,CAACsC,OAAO,CAACS,OAAO,IAAI;MACrD,IAAIA,OAAO,EAAE;QACXH,YAAY,CAACG,OAAO,CAAC;MACvB;IACF,CAAC,CAAC;IACF,IAAI,CAAC/C,eAAe,GAAG,CAAC,CAAC;EAC3B;AACF;AAEA,OAAO,MAAMgD,sBAAsB,GAAGA,CAAC9C,aAAoC,EAAEC,aAAoC,KAAK;EACpH,OAAO,IAAIN,gBAAgB,CAACK,aAAa,EAAEC,aAAa,CAAC;AAC3D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { create } from 'zustand';
|
|
4
|
+
import { GAME_CONFIG } from "./CatPopperService.js";
|
|
5
|
+
const createInitialHoles = (gridSize = GAME_CONFIG.GRID_SIZE) => {
|
|
6
|
+
const totalHoles = gridSize * gridSize;
|
|
7
|
+
return Array.from({
|
|
8
|
+
length: totalHoles
|
|
9
|
+
}, (_, i) => ({
|
|
10
|
+
id: i,
|
|
11
|
+
isActive: false,
|
|
12
|
+
position: {
|
|
13
|
+
x: (i % gridSize - 1) * (GAME_CONFIG.HOLE_SIZE + 20),
|
|
14
|
+
y: Math.floor(i / gridSize - 1) * (GAME_CONFIG.HOLE_SIZE + 20),
|
|
15
|
+
z: 0
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
export const useCatPopperStore = create((set, get) => ({
|
|
20
|
+
// Initial state
|
|
21
|
+
score: 0,
|
|
22
|
+
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
23
|
+
isPlaying: false,
|
|
24
|
+
gameOver: false,
|
|
25
|
+
holes: createInitialHoles(),
|
|
26
|
+
// Actions
|
|
27
|
+
startGame: (gameDuration, gridSize) => {
|
|
28
|
+
const duration = gameDuration || GAME_CONFIG.GAME_DURATION;
|
|
29
|
+
const grid = gridSize || GAME_CONFIG.GRID_SIZE;
|
|
30
|
+
set({
|
|
31
|
+
score: 0,
|
|
32
|
+
timeLeft: duration,
|
|
33
|
+
isPlaying: true,
|
|
34
|
+
gameOver: false,
|
|
35
|
+
holes: createInitialHoles(grid)
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
stopGame: () => {
|
|
39
|
+
set({
|
|
40
|
+
score: 0,
|
|
41
|
+
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
42
|
+
isPlaying: false,
|
|
43
|
+
gameOver: false
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
resetGame: () => {
|
|
47
|
+
set({
|
|
48
|
+
score: 0,
|
|
49
|
+
timeLeft: GAME_CONFIG.GAME_DURATION,
|
|
50
|
+
isPlaying: false,
|
|
51
|
+
gameOver: false,
|
|
52
|
+
holes: createInitialHoles()
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
whackCat: holeId => {
|
|
56
|
+
const {
|
|
57
|
+
holes,
|
|
58
|
+
isPlaying
|
|
59
|
+
} = get();
|
|
60
|
+
if (!isPlaying) return;
|
|
61
|
+
const hole = holes.find(h => h.id === holeId);
|
|
62
|
+
if (!hole || !hole.isActive) return;
|
|
63
|
+
set(state => ({
|
|
64
|
+
score: state.score + 1,
|
|
65
|
+
holes: state.holes.map(h => h.id === holeId ? {
|
|
66
|
+
...h,
|
|
67
|
+
isActive: false
|
|
68
|
+
} : h)
|
|
69
|
+
}));
|
|
70
|
+
},
|
|
71
|
+
updateScore: points => {
|
|
72
|
+
set(state => ({
|
|
73
|
+
score: state.score + points
|
|
74
|
+
}));
|
|
75
|
+
},
|
|
76
|
+
decrementTime: () => {
|
|
77
|
+
set(state => {
|
|
78
|
+
const newTimeLeft = state.timeLeft - 1;
|
|
79
|
+
if (newTimeLeft <= 0) {
|
|
80
|
+
return {
|
|
81
|
+
timeLeft: 0,
|
|
82
|
+
isPlaying: false,
|
|
83
|
+
gameOver: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
timeLeft: newTimeLeft
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
setHoles: holes => {
|
|
92
|
+
set({
|
|
93
|
+
holes
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
activateHole: holeId => {
|
|
97
|
+
set(state => ({
|
|
98
|
+
holes: state.holes.map(hole => hole.id === holeId ? {
|
|
99
|
+
...hole,
|
|
100
|
+
isActive: true
|
|
101
|
+
} : hole)
|
|
102
|
+
}));
|
|
103
|
+
},
|
|
104
|
+
deactivateHole: holeId => {
|
|
105
|
+
set(state => ({
|
|
106
|
+
holes: state.holes.map(hole => hole.id === holeId ? {
|
|
107
|
+
...hole,
|
|
108
|
+
isActive: false
|
|
109
|
+
} : hole)
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
//# sourceMappingURL=CatPopperStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["create","GAME_CONFIG","createInitialHoles","gridSize","GRID_SIZE","totalHoles","Array","from","length","_","i","id","isActive","position","x","HOLE_SIZE","y","Math","floor","z","useCatPopperStore","set","get","score","timeLeft","GAME_DURATION","isPlaying","gameOver","holes","startGame","gameDuration","duration","grid","stopGame","resetGame","whackCat","holeId","hole","find","h","state","map","updateScore","points","decrementTime","newTimeLeft","setHoles","activateHole","deactivateHole"],"sourceRoot":"../../../../src","sources":["games/cat-popper/CatPopperStore.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,SAAS;AAEhC,SAASC,WAAW,QAAQ,uBAAoB;AAwBhD,MAAMC,kBAAkB,GAAGA,CAACC,QAAgB,GAAGF,WAAW,CAACG,SAAS,KAAa;EAC/E,MAAMC,UAAU,GAAGF,QAAQ,GAAGA,QAAQ;EACtC,OAAOG,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAEH;EAAW,CAAC,EAAE,CAACI,CAAC,EAAEC,CAAC,MAAM;IACnDC,EAAE,EAAED,CAAC;IACLE,QAAQ,EAAE,KAAK;IACfC,QAAQ,EAAE;MACRC,CAAC,EAAE,CAAEJ,CAAC,GAAGP,QAAQ,GAAI,CAAC,KAAKF,WAAW,CAACc,SAAS,GAAG,EAAE,CAAC;MACtDC,CAAC,EAAEC,IAAI,CAACC,KAAK,CAACR,CAAC,GAAGP,QAAQ,GAAG,CAAC,CAAC,IAAIF,WAAW,CAACc,SAAS,GAAG,EAAE,CAAC;MAC9DI,CAAC,EAAE;IACL;EACF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGpB,MAAM,CAAiB,CAACqB,GAAG,EAAEC,GAAG,MAAM;EACrE;EACAC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAEvB,WAAW,CAACwB,aAAa;EACnCC,SAAS,EAAE,KAAK;EAChBC,QAAQ,EAAE,KAAK;EACfC,KAAK,EAAE1B,kBAAkB,CAAC,CAAC;EAE3B;EACA2B,SAAS,EAAEA,CAACC,YAAqB,EAAE3B,QAAiB,KAAK;IACvD,MAAM4B,QAAQ,GAAGD,YAAY,IAAI7B,WAAW,CAACwB,aAAa;IAC1D,MAAMO,IAAI,GAAG7B,QAAQ,IAAIF,WAAW,CAACG,SAAS;IAC9CiB,GAAG,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