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,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useEffect } from 'react';
|
|
4
|
+
import { View, TouchableOpacity, Text, StyleSheet, Animated } from 'react-native';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const GameControls = ({
|
|
7
|
+
isPlaying,
|
|
8
|
+
gameOver,
|
|
9
|
+
onStartGame,
|
|
10
|
+
onStopGame
|
|
11
|
+
}) => {
|
|
12
|
+
const scaleAnim = useRef(new Animated.Value(1)).current;
|
|
13
|
+
const pulseAnim = useRef(new Animated.Value(1)).current;
|
|
14
|
+
const glowAnim = useRef(new Animated.Value(0)).current;
|
|
15
|
+
|
|
16
|
+
// Pulse animation for start button
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!isPlaying && !gameOver) {
|
|
19
|
+
const pulseAnimation = Animated.loop(Animated.sequence([Animated.timing(pulseAnim, {
|
|
20
|
+
toValue: 1.05,
|
|
21
|
+
duration: 1000,
|
|
22
|
+
useNativeDriver: true
|
|
23
|
+
}), Animated.timing(pulseAnim, {
|
|
24
|
+
toValue: 1,
|
|
25
|
+
duration: 1000,
|
|
26
|
+
useNativeDriver: true
|
|
27
|
+
})]));
|
|
28
|
+
pulseAnimation.start();
|
|
29
|
+
return () => pulseAnimation.stop();
|
|
30
|
+
}
|
|
31
|
+
return () => {};
|
|
32
|
+
}, [isPlaying, gameOver, pulseAnim]);
|
|
33
|
+
|
|
34
|
+
// Glow animation for stop button
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (isPlaying) {
|
|
37
|
+
const glowAnimation = Animated.loop(Animated.sequence([Animated.timing(glowAnim, {
|
|
38
|
+
toValue: 1,
|
|
39
|
+
duration: 800,
|
|
40
|
+
useNativeDriver: false
|
|
41
|
+
}), Animated.timing(glowAnim, {
|
|
42
|
+
toValue: 0,
|
|
43
|
+
duration: 800,
|
|
44
|
+
useNativeDriver: false
|
|
45
|
+
})]));
|
|
46
|
+
glowAnimation.start();
|
|
47
|
+
return () => glowAnimation.stop();
|
|
48
|
+
}
|
|
49
|
+
return () => {};
|
|
50
|
+
}, [isPlaying, glowAnim]);
|
|
51
|
+
const handlePressIn = () => {
|
|
52
|
+
Animated.spring(scaleAnim, {
|
|
53
|
+
toValue: 0.95,
|
|
54
|
+
useNativeDriver: true
|
|
55
|
+
}).start();
|
|
56
|
+
};
|
|
57
|
+
const handlePressOut = () => {
|
|
58
|
+
Animated.spring(scaleAnim, {
|
|
59
|
+
toValue: 1,
|
|
60
|
+
friction: 3,
|
|
61
|
+
tension: 40,
|
|
62
|
+
useNativeDriver: true
|
|
63
|
+
}).start();
|
|
64
|
+
};
|
|
65
|
+
const glowColor = glowAnim.interpolate({
|
|
66
|
+
inputRange: [0, 1],
|
|
67
|
+
outputRange: ['rgba(239, 68, 68, 0.3)', 'rgba(239, 68, 68, 0.8)']
|
|
68
|
+
});
|
|
69
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: styles.gameControls,
|
|
71
|
+
children: [!isPlaying && !gameOver && /*#__PURE__*/_jsx(Animated.View, {
|
|
72
|
+
style: [{
|
|
73
|
+
transform: [{
|
|
74
|
+
scale: pulseAnim
|
|
75
|
+
}]
|
|
76
|
+
}],
|
|
77
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
78
|
+
style: [styles.startButton],
|
|
79
|
+
onPress: onStartGame,
|
|
80
|
+
onPressIn: handlePressIn,
|
|
81
|
+
onPressOut: handlePressOut,
|
|
82
|
+
activeOpacity: 0.8,
|
|
83
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
84
|
+
style: [styles.buttonContent, {
|
|
85
|
+
transform: [{
|
|
86
|
+
scale: scaleAnim
|
|
87
|
+
}]
|
|
88
|
+
}],
|
|
89
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
90
|
+
style: styles.startButtonText,
|
|
91
|
+
children: "START POPPING"
|
|
92
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
93
|
+
style: styles.buttonSubtext,
|
|
94
|
+
children: "Pop balloons to score!"
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
}), isPlaying && /*#__PURE__*/_jsx(Animated.View, {
|
|
99
|
+
style: [styles.stopButtonContainer, {
|
|
100
|
+
shadowColor: glowColor
|
|
101
|
+
}],
|
|
102
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
103
|
+
style: [styles.stopButton],
|
|
104
|
+
onPress: onStopGame,
|
|
105
|
+
onPressIn: handlePressIn,
|
|
106
|
+
onPressOut: handlePressOut,
|
|
107
|
+
activeOpacity: 0.8,
|
|
108
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
109
|
+
style: [styles.buttonContent, {
|
|
110
|
+
transform: [{
|
|
111
|
+
scale: scaleAnim
|
|
112
|
+
}]
|
|
113
|
+
}],
|
|
114
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
115
|
+
style: styles.stopButtonText,
|
|
116
|
+
children: "STOP GAME"
|
|
117
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
118
|
+
style: styles.buttonSubtext,
|
|
119
|
+
children: "End current game"
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
})]
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const styles = StyleSheet.create({
|
|
127
|
+
gameControls: {
|
|
128
|
+
justifyContent: 'center',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
paddingVertical: 20,
|
|
131
|
+
paddingHorizontal: 20
|
|
132
|
+
},
|
|
133
|
+
startButton: {
|
|
134
|
+
backgroundColor: '#3b82f6',
|
|
135
|
+
// Blue for balloon theme
|
|
136
|
+
paddingHorizontal: 32,
|
|
137
|
+
paddingVertical: 20,
|
|
138
|
+
borderRadius: 30,
|
|
139
|
+
shadowColor: '#3b82f6',
|
|
140
|
+
shadowOffset: {
|
|
141
|
+
width: 0,
|
|
142
|
+
height: 8
|
|
143
|
+
},
|
|
144
|
+
shadowOpacity: 0.4,
|
|
145
|
+
shadowRadius: 12,
|
|
146
|
+
elevation: 8,
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
minHeight: 70,
|
|
150
|
+
minWidth: 200,
|
|
151
|
+
borderWidth: 3,
|
|
152
|
+
borderColor: '#60a5fa',
|
|
153
|
+
// Light blue border
|
|
154
|
+
position: 'relative',
|
|
155
|
+
overflow: 'hidden'
|
|
156
|
+
},
|
|
157
|
+
stopButton: {
|
|
158
|
+
backgroundColor: '#dc2626',
|
|
159
|
+
// Red
|
|
160
|
+
paddingHorizontal: 32,
|
|
161
|
+
paddingVertical: 20,
|
|
162
|
+
borderRadius: 30,
|
|
163
|
+
shadowColor: '#dc2626',
|
|
164
|
+
shadowOffset: {
|
|
165
|
+
width: 0,
|
|
166
|
+
height: 8
|
|
167
|
+
},
|
|
168
|
+
shadowOpacity: 0.4,
|
|
169
|
+
shadowRadius: 12,
|
|
170
|
+
elevation: 8,
|
|
171
|
+
justifyContent: 'center',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
minHeight: 70,
|
|
174
|
+
minWidth: 200,
|
|
175
|
+
borderWidth: 3,
|
|
176
|
+
borderColor: '#f87171',
|
|
177
|
+
// Light red border
|
|
178
|
+
position: 'relative',
|
|
179
|
+
overflow: 'hidden'
|
|
180
|
+
},
|
|
181
|
+
stopButtonContainer: {
|
|
182
|
+
shadowOffset: {
|
|
183
|
+
width: 0,
|
|
184
|
+
height: 0
|
|
185
|
+
},
|
|
186
|
+
shadowOpacity: 0.6,
|
|
187
|
+
shadowRadius: 20,
|
|
188
|
+
elevation: 10
|
|
189
|
+
},
|
|
190
|
+
buttonContent: {
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
justifyContent: 'center'
|
|
193
|
+
},
|
|
194
|
+
startButtonText: {
|
|
195
|
+
fontSize: 20,
|
|
196
|
+
fontWeight: '800',
|
|
197
|
+
color: '#ffffff',
|
|
198
|
+
textAlign: 'center',
|
|
199
|
+
textShadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
200
|
+
textShadowOffset: {
|
|
201
|
+
width: 1,
|
|
202
|
+
height: 1
|
|
203
|
+
},
|
|
204
|
+
textShadowRadius: 2,
|
|
205
|
+
letterSpacing: 1
|
|
206
|
+
},
|
|
207
|
+
stopButtonText: {
|
|
208
|
+
fontSize: 20,
|
|
209
|
+
fontWeight: '800',
|
|
210
|
+
color: '#ffffff',
|
|
211
|
+
textAlign: 'center',
|
|
212
|
+
textShadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
213
|
+
textShadowOffset: {
|
|
214
|
+
width: 1,
|
|
215
|
+
height: 1
|
|
216
|
+
},
|
|
217
|
+
textShadowRadius: 2,
|
|
218
|
+
letterSpacing: 1
|
|
219
|
+
},
|
|
220
|
+
buttonSubtext: {
|
|
221
|
+
fontSize: 12,
|
|
222
|
+
fontWeight: '600',
|
|
223
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
224
|
+
textAlign: 'center',
|
|
225
|
+
marginTop: 4,
|
|
226
|
+
letterSpacing: 0.5
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
//# sourceMappingURL=GameControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","useEffect","View","TouchableOpacity","Text","StyleSheet","Animated","jsx","_jsx","jsxs","_jsxs","GameControls","isPlaying","gameOver","onStartGame","onStopGame","scaleAnim","Value","current","pulseAnim","glowAnim","pulseAnimation","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","glowAnimation","handlePressIn","spring","handlePressOut","friction","tension","glowColor","interpolate","inputRange","outputRange","style","styles","gameControls","children","transform","scale","startButton","onPress","onPressIn","onPressOut","activeOpacity","buttonContent","startButtonText","buttonSubtext","stopButtonContainer","shadowColor","stopButton","stopButtonText","create","justifyContent","alignItems","paddingVertical","paddingHorizontal","backgroundColor","borderRadius","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","minHeight","minWidth","borderWidth","borderColor","position","overflow","fontSize","fontWeight","color","textAlign","textShadowColor","textShadowOffset","textShadowRadius","letterSpacing","marginTop"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/GameControls.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASlF,OAAO,MAAMC,YAAyC,GAAGA,CAAC;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,WAAW;EAAEC;AAAW,CAAC,KAAK;EAC7G,MAAMC,SAAS,GAAGhB,MAAM,CAAC,IAAIM,QAAQ,CAACW,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACvD,MAAMC,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heet, Modal } from 'react-native';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export const GameOverModal = ({
|
|
7
|
+
isVisible,
|
|
8
|
+
score,
|
|
9
|
+
onPlayAgain
|
|
10
|
+
}) => {
|
|
11
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
12
|
+
visible: isVisible,
|
|
13
|
+
animationType: "fade",
|
|
14
|
+
transparent: true,
|
|
15
|
+
onRequestClose: onPlayAgain,
|
|
16
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
17
|
+
style: styles.gameOverOverlay,
|
|
18
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
19
|
+
style: styles.gameOverModal,
|
|
20
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
21
|
+
style: styles.modalContent,
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
23
|
+
style: styles.gameOverTitle,
|
|
24
|
+
children: "Game Over!"
|
|
25
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
26
|
+
style: styles.finalScoreContainer,
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
28
|
+
style: styles.finalScoreLabel,
|
|
29
|
+
children: "Final Score"
|
|
30
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
31
|
+
style: styles.finalScoreValue,
|
|
32
|
+
children: score
|
|
33
|
+
})]
|
|
34
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
35
|
+
style: styles.playAgainContainer,
|
|
36
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
37
|
+
style: styles.playAgainButton,
|
|
38
|
+
onPress: onPlayAgain,
|
|
39
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
40
|
+
style: styles.buttonText,
|
|
41
|
+
children: "Pop Again!"
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
gameOverOverlay: {
|
|
52
|
+
flex: 1,
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)' // Semi-transparent overlay
|
|
56
|
+
},
|
|
57
|
+
gameOverModal: {
|
|
58
|
+
backgroundColor: '#87CEEB',
|
|
59
|
+
// Sky blue background for balloon theme
|
|
60
|
+
borderRadius: 24,
|
|
61
|
+
minWidth: '80%',
|
|
62
|
+
shadowColor: '#000',
|
|
63
|
+
shadowOffset: {
|
|
64
|
+
width: 0,
|
|
65
|
+
height: 8
|
|
66
|
+
},
|
|
67
|
+
shadowOpacity: 0.4,
|
|
68
|
+
shadowRadius: 12,
|
|
69
|
+
elevation: 12,
|
|
70
|
+
borderWidth: 3,
|
|
71
|
+
borderColor: 'rgba(59, 130, 246, 0.8)' // Blue border for balloon theme
|
|
72
|
+
},
|
|
73
|
+
modalContent: {
|
|
74
|
+
padding: 40,
|
|
75
|
+
alignItems: 'center'
|
|
76
|
+
},
|
|
77
|
+
gameOverTitle: {
|
|
78
|
+
fontSize: 30,
|
|
79
|
+
fontWeight: 'bold',
|
|
80
|
+
color: '#ffffff',
|
|
81
|
+
marginBottom: 32,
|
|
82
|
+
textAlign: 'center'
|
|
83
|
+
},
|
|
84
|
+
finalScoreContainer: {
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
marginBottom: 32,
|
|
87
|
+
backgroundColor: '#1e40af',
|
|
88
|
+
// Blue background for balloon theme
|
|
89
|
+
borderRadius: 16,
|
|
90
|
+
padding: 20,
|
|
91
|
+
minWidth: 150
|
|
92
|
+
},
|
|
93
|
+
finalScoreLabel: {
|
|
94
|
+
fontSize: 18,
|
|
95
|
+
color: '#ffffff',
|
|
96
|
+
fontWeight: 'bold',
|
|
97
|
+
marginBottom: 8
|
|
98
|
+
},
|
|
99
|
+
finalScoreValue: {
|
|
100
|
+
fontSize: 48,
|
|
101
|
+
color: '#facc15',
|
|
102
|
+
fontWeight: 'bold',
|
|
103
|
+
textAlign: 'center'
|
|
104
|
+
},
|
|
105
|
+
playAgainContainer: {
|
|
106
|
+
alignItems: 'center'
|
|
107
|
+
},
|
|
108
|
+
playAgainButton: {
|
|
109
|
+
backgroundColor: '#3b82f6',
|
|
110
|
+
// Blue for balloon theme
|
|
111
|
+
paddingHorizontal: 40,
|
|
112
|
+
paddingVertical: 20,
|
|
113
|
+
borderRadius: 24,
|
|
114
|
+
shadowColor: '#000',
|
|
115
|
+
shadowOffset: {
|
|
116
|
+
width: 0,
|
|
117
|
+
height: 2
|
|
118
|
+
},
|
|
119
|
+
shadowOpacity: 0.25,
|
|
120
|
+
shadowRadius: 3.84,
|
|
121
|
+
elevation: 5,
|
|
122
|
+
borderWidth: 2,
|
|
123
|
+
borderColor: '#60a5fa' // Light blue border
|
|
124
|
+
},
|
|
125
|
+
buttonText: {
|
|
126
|
+
fontSize: 18,
|
|
127
|
+
fontWeight: 'bold',
|
|
128
|
+
color: '#ffffff',
|
|
129
|
+
textAlign: 'center',
|
|
130
|
+
lineHeight: 24
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=GameOverModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","TouchableOpacity","Text","StyleSheet","Modal","jsx","_jsx","jsxs","_jsxs","GameOverModal","isVisible","score","onPlayAgain","visible","animationType","transparent","onRequestClose","children","style","styles","gameOverOverlay","gameOverModal","modalContent","gameOverTitle","finalScoreContainer","finalScoreLabel","finalScoreValue","playAgainContainer","playAgainButton","onPress","buttonText","create","flex","justifyContent","alignItems","backgroundColor","borderRadius","minWidth","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","borderWidth","borderColor","padding","fontSize","fontWeight","color","marginBottom","textAlign","paddingHorizontal","paddingVertical","lineHeight"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/GameOverModal.tsx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K,EAAE,SAAS;IAChBD,UAAU,EAAE,MAAM;IAClBE,YAAY,EAAE;EAChB,CAAC;EACDzB,eAAe,EAAE;IACfsB,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE,SAAS;IAChBD,UAAU,EAAE,MAAM;IAClBG,SAAS,EAAE;EACb,CAAC;EACDzB,kBAAkB,EAAE;IAClBO,UAAU,EAAE;EACd,CAAC;EACDN,eAAe,EAAE;IACfO,eAAe,EAAE,SAAS;IAAE;IAC5BkB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBlB,YAAY,EAAE,EAAE;IAChBE,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,IAAI;IAClBC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,SAAS,CAAC;EACzB,CAAC;EACDhB,UAAU,EAAE;IACVkB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS;IAChBE,SAAS,EAAE,QAAQ;IACnBG,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Dimensions, StyleSheet } from 'react-native';
|
|
5
|
+
import { Canvas as SkiaCanvas, Circle, Group } from '@shopify/react-native-skia';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
width,
|
|
9
|
+
height
|
|
10
|
+
} = Dimensions.get('window');
|
|
11
|
+
export const ParticleSystem = ({
|
|
12
|
+
particles
|
|
13
|
+
}) => {
|
|
14
|
+
if (particles.length === 0) return null;
|
|
15
|
+
return /*#__PURE__*/_jsx(View, {
|
|
16
|
+
style: [styles.absoluteContainer, {
|
|
17
|
+
width,
|
|
18
|
+
height
|
|
19
|
+
}],
|
|
20
|
+
children: /*#__PURE__*/_jsx(SkiaCanvas, {
|
|
21
|
+
style: {
|
|
22
|
+
width,
|
|
23
|
+
height
|
|
24
|
+
},
|
|
25
|
+
children: /*#__PURE__*/_jsx(Group, {
|
|
26
|
+
children: particles.map(particle => {
|
|
27
|
+
// Improved alpha calculation for better visibility
|
|
28
|
+
const alpha = Math.max(0.1, 1 - particle.lifetime / particle.maxLifetime);
|
|
29
|
+
const alphaHex = Math.floor(alpha * 255).toString(16).padStart(2, '0');
|
|
30
|
+
return /*#__PURE__*/_jsx(Circle, {
|
|
31
|
+
cx: particle.position.x,
|
|
32
|
+
cy: particle.position.y,
|
|
33
|
+
r: Math.max(2, particle.size * alpha) // Ensure minimum size
|
|
34
|
+
,
|
|
35
|
+
color: `${particle.color}${alphaHex}`
|
|
36
|
+
}, particle.id);
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const styles = StyleSheet.create({
|
|
43
|
+
absoluteContainer: {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
top: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
right: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
pointerEvents: 'none'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=ParticleSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Dimensions","StyleSheet","Canvas","SkiaCanvas","Circle","Group","jsx","_jsx","width","height","get","ParticleSystem","particles","length","style","styles","absoluteContainer","children","map","particle","alpha","Math","max","lifetime","maxLifetime","alphaHex","floor","toString","padStart","cx","position","x","cy","y","r","size","color","id","create","top","left","right","bottom","pointerEvents"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/ParticleSystem.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM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A;YACvCgB,KAAK,EAAE,GAAGjB,QAAQ,CAACiB,KAAK,GAAGX,QAAQ;UAAG,GAJjCN,QAAQ,CAACkB,EAKf,CAAC;QAEN,CAAC;MAAC,CACG;IAAC,CACE;EAAC,CACT,CAAC;AAEX,CAAC;AAED,MAAMtB,MAAM,GAAGd,UAAU,CAACqC,MAAM,CAAC;EAC/BtB,iBAAiB,EAAE;IACjBc,QAAQ,EAAE,UAAU;IACpBS,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
+
import { GAME_CONFIG } from "../BalloonBlasterService.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export const ScoreBoard = ({
|
|
8
|
+
score,
|
|
9
|
+
timeLeft,
|
|
10
|
+
lives
|
|
11
|
+
}) => {
|
|
12
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
13
|
+
style: styles.scoreBoard,
|
|
14
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
15
|
+
style: styles.scoreSection,
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
17
|
+
style: styles.scoreLabel,
|
|
18
|
+
children: "Score"
|
|
19
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
20
|
+
style: styles.scoreValue,
|
|
21
|
+
children: score
|
|
22
|
+
})]
|
|
23
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
24
|
+
style: styles.scoreSection,
|
|
25
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
26
|
+
style: styles.scoreLabel,
|
|
27
|
+
children: "Time"
|
|
28
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
29
|
+
style: styles.timeValue,
|
|
30
|
+
children: timeLeft
|
|
31
|
+
})]
|
|
32
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
33
|
+
style: styles.scoreSection,
|
|
34
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
35
|
+
style: styles.scoreLabel,
|
|
36
|
+
children: "Lives"
|
|
37
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
38
|
+
style: styles.livesRow,
|
|
39
|
+
children: Array.from({
|
|
40
|
+
length: GAME_CONFIG.MAX_LIVES
|
|
41
|
+
}).map((_, index) => /*#__PURE__*/_jsx(Text, {
|
|
42
|
+
style: [styles.heartIcon, index < lives ? styles.heartActive : styles.heartInactive],
|
|
43
|
+
children: "\uD83C\uDF88"
|
|
44
|
+
}, index))
|
|
45
|
+
})]
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
scoreBoard: {
|
|
51
|
+
flexDirection: 'row',
|
|
52
|
+
justifyContent: 'space-between',
|
|
53
|
+
alignItems: 'center',
|
|
54
|
+
backgroundColor: 'rgba(135, 206, 235, 0.4)',
|
|
55
|
+
// Sky blue background for balloon theme
|
|
56
|
+
borderRadius: 16,
|
|
57
|
+
padding: 20,
|
|
58
|
+
margin: 20,
|
|
59
|
+
borderWidth: 2,
|
|
60
|
+
borderColor: 'rgba(255, 255, 255, 0.6)',
|
|
61
|
+
// White border for balloon theme
|
|
62
|
+
shadowColor: '#000',
|
|
63
|
+
shadowOffset: {
|
|
64
|
+
width: 0,
|
|
65
|
+
height: 4
|
|
66
|
+
},
|
|
67
|
+
shadowOpacity: 0.25,
|
|
68
|
+
shadowRadius: 6,
|
|
69
|
+
elevation: 8
|
|
70
|
+
},
|
|
71
|
+
scoreSection: {
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
flex: 1
|
|
74
|
+
},
|
|
75
|
+
scoreLabel: {
|
|
76
|
+
fontSize: 18,
|
|
77
|
+
fontWeight: 'bold',
|
|
78
|
+
color: '#ffffff',
|
|
79
|
+
marginBottom: 4
|
|
80
|
+
},
|
|
81
|
+
scoreValue: {
|
|
82
|
+
fontSize: 30,
|
|
83
|
+
fontWeight: 'bold',
|
|
84
|
+
color: '#1e40af' // Blue color for balloon theme
|
|
85
|
+
},
|
|
86
|
+
timeValue: {
|
|
87
|
+
fontSize: 30,
|
|
88
|
+
fontWeight: 'bold',
|
|
89
|
+
color: '#1e40af' // Blue color for balloon theme
|
|
90
|
+
},
|
|
91
|
+
livesRow: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
justifyContent: 'center'
|
|
94
|
+
},
|
|
95
|
+
heartIcon: {
|
|
96
|
+
fontSize: 24,
|
|
97
|
+
marginHorizontal: 3,
|
|
98
|
+
fontWeight: 'bold'
|
|
99
|
+
},
|
|
100
|
+
heartActive: {
|
|
101
|
+
opacity: 1,
|
|
102
|
+
textShadowColor: 'rgba(0, 0, 0, 0.5)',
|
|
103
|
+
textShadowOffset: {
|
|
104
|
+
width: 1,
|
|
105
|
+
height: 1
|
|
106
|
+
},
|
|
107
|
+
textShadowRadius: 2
|
|
108
|
+
},
|
|
109
|
+
heartInactive: {
|
|
110
|
+
opacity: 0.3,
|
|
111
|
+
textShadowColor: 'rgba(255, 255, 255, 0.3)',
|
|
112
|
+
textShadowOffset: {
|
|
113
|
+
width: 1,
|
|
114
|
+
height: 1
|
|
115
|
+
},
|
|
116
|
+
textShadowRadius: 1
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=ScoreBoard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Text","StyleSheet","GAME_CONFIG","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","heartActive","heartInactive","create","flexDirection","justifyContent","alignItems","backgroundColor","borderRadius","padding","margin","borderWidth","borderColor","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","flex","fontSize","fontWeight","color","marginBottom","marginHorizontal","opacity","textShadowColor","textShadowOffset","textShadowRadius"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,WAAW,QAAQ,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQvD,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EACnF,oBACEJ,KAAA,CAACP,IAAI;IAACY,KAAK,EAAEC,MAAM,CAACC,UAAW;IAAAC,QAAA,gBAC7BR,KAAA,CAACP,IAAI;MAACY,KAAK,EAAEC,MAAM,CAACG,YAAa;MAAAD,QAAA,gBAC/BV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACI,UAAW;QAAAF,QAAA,EAAC;MAAK,CAAM,CAAC,eAC5CV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACK,UAAW;QAAAH,QAAA,EAAEN;MAAK,CAAO,CAAC;IAAA,CAC1C,CAAC,eAEPF,KAAA,CAACP,IAAI;MAACY,KAAK,EAAEC,MAAM,CAACG,YAAa;MAAAD,QAAA,gBAC/BV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACI,UAAW;QAAAF,QAAA,EAAC;MAAI,CAAM,CAAC,eAC3CV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACM,SAAU;QAAAJ,QAAA,EAAEL;MAAQ,CAAO,CAAC;IAAA,CAC5C,CAAC,eAEPH,KAAA,CAACP,IAAI;MAACY,KAAK,EAAE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ZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS;IAChBC,YAAY,EAAE;EAChB,CAAC;EACDlC,UAAU,EAAE;IACV+B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDhC,SAAS,EAAE;IACT8B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACD/B,QAAQ,EAAE;IACRY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDL,SAAS,EAAE;IACTqB,QAAQ,EAAE,EAAE;IACZI,gBAAgB,EAAE,CAAC;IACnBH,UAAU,EAAE;EACd,CAAC;EACDrB,WAAW,EAAE;IACXyB,OAAO,EAAE,CAAC;IACVC,eAAe,EAAE,oBAAoB;IACrCC,gBAAgB,EAAE;MAAEb,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCa,gBAAgB,EAAE;EACpB,CAAC;EACD3B,aAAa,EAAE;IACbwB,OAAO,EAAE,GAAG;IACZC,eAAe,EAAE,0BAA0B;IAC3CC,gBAAgB,EAAE;MAAEb,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCa,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Dimensions, StyleSheet } from 'react-native';
|
|
5
|
+
import { Canvas as SkiaCanvas, Path, Skia } from '@shopify/react-native-skia';
|
|
6
|
+
import { COLORS } from "../BalloonBlasterService.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const {
|
|
9
|
+
width,
|
|
10
|
+
height
|
|
11
|
+
} = Dimensions.get('window');
|
|
12
|
+
export const SliceTrail = ({
|
|
13
|
+
path,
|
|
14
|
+
isVisible
|
|
15
|
+
}) => {
|
|
16
|
+
if (!isVisible || path.length < 2) return null;
|
|
17
|
+
const skiaPath = Skia.Path.Make();
|
|
18
|
+
if (path.length > 0) {
|
|
19
|
+
const firstPoint = path[0];
|
|
20
|
+
if (!firstPoint) return null;
|
|
21
|
+
skiaPath.moveTo(firstPoint.x, firstPoint.y);
|
|
22
|
+
for (let i = 1; i < path.length; i++) {
|
|
23
|
+
const point = path[i];
|
|
24
|
+
if (point) skiaPath.lineTo(point.x, point.y);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return /*#__PURE__*/_jsx(View, {
|
|
28
|
+
style: [styles.absoluteContainer, {
|
|
29
|
+
width,
|
|
30
|
+
height
|
|
31
|
+
}],
|
|
32
|
+
children: /*#__PURE__*/_jsx(SkiaCanvas, {
|
|
33
|
+
style: {
|
|
34
|
+
width,
|
|
35
|
+
height
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/_jsx(Path, {
|
|
38
|
+
path: skiaPath,
|
|
39
|
+
color: COLORS.SLICE_TRAIL,
|
|
40
|
+
style: "stroke",
|
|
41
|
+
strokeWidth: 8,
|
|
42
|
+
strokeCap: "round",
|
|
43
|
+
strokeJoin: "round"
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
absoluteContainer: {
|
|
50
|
+
position: 'absolute',
|
|
51
|
+
top: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
right: 0,
|
|
54
|
+
bottom: 0,
|
|
55
|
+
pointerEvents: 'none'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=SliceTrail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Dimensions","StyleSheet","Canvas","SkiaCanvas","Path","Skia","COLORS","jsx","_jsx","width","height","get","SliceTrail","path","isVisible","length","skiaPath","Make","firstPoint","moveTo","x","y","i","point","lineTo","style","styles","absoluteContainer","children","color","SLICE_TRAIL","strokeWidth","strokeCap","strokeJoin","create","position","top","left","right","bottom","pointerEvents"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/SliceTrail.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC3D,SAASC,MAAM,IAAIC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,4BAA4B;AAC7E,SAASC,MAAM,QAAQ,6BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElD,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGV,UAAU,CAACW,GAAG,CAAC,QAAQ,CAAC;AAOlD,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAU,CAAC,KAAK;EAC5E,IAAI,CAACA,SAAS,IAAID,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI;EAE9C,MAAMC,QAAQ,GAAGX,IAAI,CAACD,IAAI,CAACa,IAAI,CAAC,CAAC;EAEjC,IAAIJ,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE;IACnB,MAAMG,UAAU,GAAGL,IAAI,CAAC,CAAC,CAAC;IAC1B,IAAI,CAACK,UAAU,EAAE,OAAO,IAAI;IAC5BF,QAAQ,CAACG,MAAM,CAACD,UAAU,CAACE,CAAC,EAAEF,UAAU,CAACG,CAAC,CAAC;IAC3C,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGT,IAAI,CAACE,MAAM,EAAEO,CAAC,EAAE,EAAE;MACpC,MAAMC,KAAK,GAAGV,IAAI,CAACS,CAAC,CAAC;MACrB,IAAIC,KAAK,EAAEP,QAAQ,CAACQ,MAAM,CAACD,KAAK,CAACH,CAAC,EAAEG,KAAK,CAACF,CAAC,CAAC;IAC9C;EACF;EAEA,oBACEb,IAAA,CAACT,IAAI;IAAC0B,KAAK,EAAE,CAACC,MAAM,CAACC,iBAAiB,EAAE;MAAElB,KAAK;MAAEC;IAAO,CAAC,CAAE;IAAAkB,QAAA,eACzDpB,IAAA,CAACL,UAAU;MAACsB,KAAK,EAAE;QAAEhB,KAAK;QAAEC;MAAO,CAAE;MAAAkB,QAAA,eACnCpB,IAAA,CAACJ,IAAI;QAACS,IAAI,EAAEG,QAAS;QAACa,KAAK,EAAEvB,MAAM,CAACwB,WAAY;QAACL,KAAK,EAAC,QAAQ;QAACM,WAAW,EAAE,CAAE;QAACC,SAAS,EAAC,OAAO;QAACC,UAAU,EAAC;MAAO,CAAE;IAAC,CAC7G;EAAC,CACT,CAAC;AAEX,CAAC;AAED,MAAMP,MAAM,GAAGzB,UAAU,CAACiC,MAAM,CAAC;EAC/BP,iBAAiB,EAAE;IACjBQ,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { BalloonComponent } from "./BalloonComponent.js";
|
|
4
|
+
export { GameArea } from "./GameArea.js";
|
|
5
|
+
export { GameBackground } from "./GameBackground.js";
|
|
6
|
+
export { GameControls } from "./GameControls.js";
|
|
7
|
+
export { GameOverModal } from "./GameOverModal.js";
|
|
8
|
+
export { ParticleSystem } from "./ParticleSystem.js";
|
|
9
|
+
export { ScoreBoard } from "./ScoreBoard.js";
|
|
10
|
+
export { SliceTrail } from "./SliceTrail.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BalloonComponent","GameArea","GameBackground","GameControls","GameOverModal","ParticleSystem","ScoreBoard","SliceTrail"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB;AACrD,SAASC,QAAQ,QAAQ,eAAY;AACrC,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,aAAa,QAAQ,oBAAiB;AAC/C,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,UAAU,QAAQ,iBAAc","ignoreList":[]}
|