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,294 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { Dimensions } from 'react-native';
|
|
5
|
+
import { Canvas, LinearGradient, Rect, Circle, Group, Shadow, vec } from '@shopify/react-native-skia';
|
|
6
|
+
import { useSharedValue, withRepeat, withTiming, withSequence, interpolate, Extrapolation, Easing } from 'react-native-reanimated';
|
|
7
|
+
import Animated, { useAnimatedStyle } from 'react-native-reanimated';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const {
|
|
10
|
+
width,
|
|
11
|
+
height
|
|
12
|
+
} = Dimensions.get('window');
|
|
13
|
+
export const GameBackground = ({
|
|
14
|
+
children
|
|
15
|
+
}) => {
|
|
16
|
+
// Optimized animated values - reduced from 4 to 2 for better performance
|
|
17
|
+
const starTwinkle = useSharedValue(0);
|
|
18
|
+
const spaceFloat = useSharedValue(0); // Combined animation for planet, nebula, and asteroids
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
// Optimized star twinkling with easing for smoother animation
|
|
22
|
+
starTwinkle.value = withRepeat(withSequence(withTiming(1, {
|
|
23
|
+
duration: 3000,
|
|
24
|
+
easing: Easing.inOut(Easing.ease)
|
|
25
|
+
}), withTiming(0.4, {
|
|
26
|
+
duration: 3000,
|
|
27
|
+
easing: Easing.inOut(Easing.ease)
|
|
28
|
+
})), -1, false);
|
|
29
|
+
|
|
30
|
+
// Combined space animation for all floating elements
|
|
31
|
+
spaceFloat.value = withRepeat(withTiming(1, {
|
|
32
|
+
duration: 15000,
|
|
33
|
+
easing: Easing.inOut(Easing.ease)
|
|
34
|
+
}), -1, true // Reverse for smooth back-and-forth motion
|
|
35
|
+
);
|
|
36
|
+
}, []);
|
|
37
|
+
const animatedBackgroundStyle = useAnimatedStyle(() => {
|
|
38
|
+
return {
|
|
39
|
+
transform: []
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
43
|
+
style: [{
|
|
44
|
+
flex: 1
|
|
45
|
+
}, animatedBackgroundStyle],
|
|
46
|
+
children: [/*#__PURE__*/_jsxs(Canvas, {
|
|
47
|
+
style: {
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
top: 0,
|
|
50
|
+
left: 0,
|
|
51
|
+
right: 0,
|
|
52
|
+
bottom: 0,
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
55
|
+
},
|
|
56
|
+
children: [/*#__PURE__*/_jsx(Rect, {
|
|
57
|
+
x: 0,
|
|
58
|
+
y: 0,
|
|
59
|
+
width: width,
|
|
60
|
+
height: height,
|
|
61
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
62
|
+
start: vec(0, 0),
|
|
63
|
+
end: vec(0, height),
|
|
64
|
+
colors: ['#0c0a1f', '#1a1b3a', '#2d1b69', '#1e1b4b', '#0c0a1f']
|
|
65
|
+
})
|
|
66
|
+
}), /*#__PURE__*/_jsx(Group, {
|
|
67
|
+
children: Array.from({
|
|
68
|
+
length: 40
|
|
69
|
+
}, (_, i) => {
|
|
70
|
+
const x = width / 8 * (i % 8) + i % 5 * 25;
|
|
71
|
+
const y = height / 5 * Math.floor(i / 8) + i % 3 * 40;
|
|
72
|
+
const size = 1 + i % 3 * 0.4;
|
|
73
|
+
const isAnimated = i % 3 === 0; // Only animate every 3rd star for performance
|
|
74
|
+
|
|
75
|
+
return /*#__PURE__*/_jsx(Circle, {
|
|
76
|
+
cx: x,
|
|
77
|
+
cy: y,
|
|
78
|
+
r: size,
|
|
79
|
+
color: "#ffffff",
|
|
80
|
+
opacity: isAnimated ? interpolate(starTwinkle.value, [0, 1], [0.4, 0.9], Extrapolation.CLAMP) : 0.6
|
|
81
|
+
}, `star-${i}`);
|
|
82
|
+
})
|
|
83
|
+
}), /*#__PURE__*/_jsx(Group, {
|
|
84
|
+
children: Array.from({
|
|
85
|
+
length: 8
|
|
86
|
+
}, (_, i) => {
|
|
87
|
+
const positions = [{
|
|
88
|
+
x: width * 0.15,
|
|
89
|
+
y: height * 0.2
|
|
90
|
+
}, {
|
|
91
|
+
x: width * 0.8,
|
|
92
|
+
y: height * 0.3
|
|
93
|
+
}, {
|
|
94
|
+
x: width * 0.3,
|
|
95
|
+
y: height * 0.5
|
|
96
|
+
}, {
|
|
97
|
+
x: width * 0.7,
|
|
98
|
+
y: height * 0.6
|
|
99
|
+
}, {
|
|
100
|
+
x: width * 0.2,
|
|
101
|
+
y: height * 0.7
|
|
102
|
+
}, {
|
|
103
|
+
x: width * 0.85,
|
|
104
|
+
y: height * 0.8
|
|
105
|
+
}, {
|
|
106
|
+
x: width * 0.5,
|
|
107
|
+
y: height * 0.15
|
|
108
|
+
}, {
|
|
109
|
+
x: width * 0.6,
|
|
110
|
+
y: height * 0.85
|
|
111
|
+
}];
|
|
112
|
+
const pos = positions[i];
|
|
113
|
+
if (!pos) return null;
|
|
114
|
+
const size = 2.5 + i % 2 * 0.5;
|
|
115
|
+
const isAnimated = i % 2 === 0; // Only animate every other bright star
|
|
116
|
+
|
|
117
|
+
return /*#__PURE__*/_jsx(Group, {
|
|
118
|
+
children: /*#__PURE__*/_jsx(Circle, {
|
|
119
|
+
cx: pos.x,
|
|
120
|
+
cy: pos.y,
|
|
121
|
+
r: size,
|
|
122
|
+
color: "#ffffff",
|
|
123
|
+
opacity: isAnimated ? interpolate(starTwinkle.value, [0, 1], [0.7, 1], Extrapolation.CLAMP) : 0.8,
|
|
124
|
+
children: /*#__PURE__*/_jsx(Shadow, {
|
|
125
|
+
dx: 0,
|
|
126
|
+
dy: 0,
|
|
127
|
+
blur: 10 // Static blur for better performance
|
|
128
|
+
,
|
|
129
|
+
color: "#ffffff"
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
}, `bright-star-${i}`);
|
|
133
|
+
})
|
|
134
|
+
}), /*#__PURE__*/_jsxs(Group, {
|
|
135
|
+
transform: [{
|
|
136
|
+
translateX: width * 0.85
|
|
137
|
+
}, {
|
|
138
|
+
translateY: height * 0.2
|
|
139
|
+
}, {
|
|
140
|
+
rotate: interpolate(spaceFloat.value, [0, 1], [0, Math.PI * 2], Extrapolation.CLAMP)
|
|
141
|
+
}, {
|
|
142
|
+
translateX: -width * 0.85
|
|
143
|
+
}, {
|
|
144
|
+
translateY: -height * 0.2
|
|
145
|
+
}],
|
|
146
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
147
|
+
cx: width * 0.85,
|
|
148
|
+
cy: height * 0.2,
|
|
149
|
+
r: 32,
|
|
150
|
+
color: "#4c1d95",
|
|
151
|
+
opacity: 0.8,
|
|
152
|
+
children: /*#__PURE__*/_jsx(Shadow, {
|
|
153
|
+
dx: -2,
|
|
154
|
+
dy: 2,
|
|
155
|
+
blur: 8,
|
|
156
|
+
color: "rgba(0,0,0,0.5)"
|
|
157
|
+
})
|
|
158
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
159
|
+
cx: width * 0.85 - 6,
|
|
160
|
+
cy: height * 0.2 - 4,
|
|
161
|
+
r: 10,
|
|
162
|
+
color: "#5b21b6",
|
|
163
|
+
opacity: 0.6
|
|
164
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
165
|
+
cx: width * 0.85 + 4,
|
|
166
|
+
cy: height * 0.2 + 6,
|
|
167
|
+
r: 6,
|
|
168
|
+
color: "#6d28d9",
|
|
169
|
+
opacity: 0.5
|
|
170
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
171
|
+
cx: width * 0.85 - 8,
|
|
172
|
+
cy: height * 0.2 - 8,
|
|
173
|
+
r: 6,
|
|
174
|
+
color: "#a855f7",
|
|
175
|
+
opacity: 0.3
|
|
176
|
+
})]
|
|
177
|
+
}), /*#__PURE__*/_jsxs(Group, {
|
|
178
|
+
children: [/*#__PURE__*/_jsxs(Group, {
|
|
179
|
+
transform: [{
|
|
180
|
+
translateX: interpolate(spaceFloat.value, [0, 1], [-3, 3], Extrapolation.CLAMP)
|
|
181
|
+
}],
|
|
182
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
183
|
+
cx: width * 0.2,
|
|
184
|
+
cy: height * 0.6,
|
|
185
|
+
r: 40,
|
|
186
|
+
color: "#7c3aed",
|
|
187
|
+
opacity: 0.12,
|
|
188
|
+
children: /*#__PURE__*/_jsx(Shadow, {
|
|
189
|
+
dx: 0,
|
|
190
|
+
dy: 0,
|
|
191
|
+
blur: 15,
|
|
192
|
+
color: "#7c3aed"
|
|
193
|
+
})
|
|
194
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
195
|
+
cx: width * 0.24,
|
|
196
|
+
cy: height * 0.58,
|
|
197
|
+
r: 28,
|
|
198
|
+
color: "#a855f7",
|
|
199
|
+
opacity: 0.1
|
|
200
|
+
})]
|
|
201
|
+
}), /*#__PURE__*/_jsxs(Group, {
|
|
202
|
+
transform: [{
|
|
203
|
+
translateX: interpolate(spaceFloat.value, [0, 1], [2, -2], Extrapolation.CLAMP)
|
|
204
|
+
}],
|
|
205
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
206
|
+
cx: width * 0.7,
|
|
207
|
+
cy: height * 0.4,
|
|
208
|
+
r: 30,
|
|
209
|
+
color: "#3b82f6",
|
|
210
|
+
opacity: 0.1,
|
|
211
|
+
children: /*#__PURE__*/_jsx(Shadow, {
|
|
212
|
+
dx: 0,
|
|
213
|
+
dy: 0,
|
|
214
|
+
blur: 12,
|
|
215
|
+
color: "#3b82f6"
|
|
216
|
+
})
|
|
217
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
218
|
+
cx: width * 0.72,
|
|
219
|
+
cy: height * 0.38,
|
|
220
|
+
r: 20,
|
|
221
|
+
color: "#60a5fa",
|
|
222
|
+
opacity: 0.08
|
|
223
|
+
})]
|
|
224
|
+
})]
|
|
225
|
+
}), /*#__PURE__*/_jsx(Group, {
|
|
226
|
+
children: Array.from({
|
|
227
|
+
length: 5
|
|
228
|
+
}, (_, i) => {
|
|
229
|
+
const positions = [{
|
|
230
|
+
x: width * 0.15,
|
|
231
|
+
y: height * 0.3
|
|
232
|
+
}, {
|
|
233
|
+
x: width * 0.85,
|
|
234
|
+
y: height * 0.5
|
|
235
|
+
}, {
|
|
236
|
+
x: width * 0.3,
|
|
237
|
+
y: height * 0.75
|
|
238
|
+
}, {
|
|
239
|
+
x: width * 0.75,
|
|
240
|
+
y: height * 0.2
|
|
241
|
+
}, {
|
|
242
|
+
x: width * 0.5,
|
|
243
|
+
y: height * 0.85
|
|
244
|
+
}];
|
|
245
|
+
const pos = positions[i];
|
|
246
|
+
if (!pos) return null;
|
|
247
|
+
const size = 3 + i % 3;
|
|
248
|
+
const isAnimated = i % 2 === 0; // Only animate every other asteroid
|
|
249
|
+
|
|
250
|
+
return /*#__PURE__*/_jsxs(Group, {
|
|
251
|
+
transform: isAnimated ? [{
|
|
252
|
+
translateX: interpolate(spaceFloat.value, [0, 1], [-1.5, 1.5], Extrapolation.CLAMP)
|
|
253
|
+
}] : [],
|
|
254
|
+
children: [/*#__PURE__*/_jsx(Circle, {
|
|
255
|
+
cx: pos.x,
|
|
256
|
+
cy: pos.y,
|
|
257
|
+
r: size,
|
|
258
|
+
color: "#6b7280",
|
|
259
|
+
opacity: 0.5,
|
|
260
|
+
children: /*#__PURE__*/_jsx(Shadow, {
|
|
261
|
+
dx: 1,
|
|
262
|
+
dy: 1,
|
|
263
|
+
blur: 2,
|
|
264
|
+
color: "rgba(0,0,0,0.3)"
|
|
265
|
+
})
|
|
266
|
+
}), /*#__PURE__*/_jsx(Circle, {
|
|
267
|
+
cx: pos.x - size * 0.25,
|
|
268
|
+
cy: pos.y - size * 0.25,
|
|
269
|
+
r: size * 0.3,
|
|
270
|
+
color: "#9ca3af",
|
|
271
|
+
opacity: 0.3
|
|
272
|
+
})]
|
|
273
|
+
}, `asteroid-${i}`);
|
|
274
|
+
})
|
|
275
|
+
}), /*#__PURE__*/_jsx(Group, {
|
|
276
|
+
children: Array.from({
|
|
277
|
+
length: 15
|
|
278
|
+
}, (_, i) => {
|
|
279
|
+
const x = width / 5 * (i % 5) + i % 3 * 20;
|
|
280
|
+
const y = height / 3 * Math.floor(i / 5) + i % 4 * 30;
|
|
281
|
+
const size = 0.5 + i % 2 * 0.2;
|
|
282
|
+
return /*#__PURE__*/_jsx(Circle, {
|
|
283
|
+
cx: x,
|
|
284
|
+
cy: y,
|
|
285
|
+
r: size,
|
|
286
|
+
color: "#e5e7eb",
|
|
287
|
+
opacity: 0.25
|
|
288
|
+
}, `dust-${i}`);
|
|
289
|
+
})
|
|
290
|
+
})]
|
|
291
|
+
}), children]
|
|
292
|
+
});
|
|
293
|
+
};
|
|
294
|
+
//# sourceMappingURL=GameBackground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","Dimensions","Canvas","LinearGradient","Rect","Circle","Group","Shadow","vec","useSharedValue","withRepeat","withTiming","withSequence","interpolate","Extrapolation","Easing","Animated","useAnimatedStyle","jsx","_jsx","jsxs","_jsxs","width","height","get","GameBackground","children","starTwinkle","spaceFloat","value","duration","easing","inOut","ease","animatedBackgroundStyle","transform","View","style","flex","position","top","left","right","bottom","x","y","start","end","colors","Array","from","length","_","i","Math","floor","size","isAnimated","cx","cy","r","color","opacity","CLAMP","positions","pos","dx","dy","blur","translateX","translateY","rotate","PI"],"sourceRoot":"../../../../../src","sources":["games/space-traveller/components/GameBackground.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,QAAQ,cAAc;AACzC,SACEC,MAAM,EACNC,cAAc,EACdC,IAAI,EACJC,MAAM,EACNC,KAAK,EACLC,MAAM,EACNC,GAAG,QACE,4BAA4B;AACnC,SACEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,MAAM,QACD,yBAAyB;AAChC,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErE,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGtB,UAAU,CAACuB,GAAG,CAAC,QAAQ,CAAC;AAMlD,OAAO,MAAMC,cAA6C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC7E;EACA,MAAMC,WAAW,GAAGlB,cAAc,CAAC,CAAC,CAAC;EACrC,MAAMmB,UAAU,GAAGnB,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;;EAEtCT,SAAS,CAAC,MAAM;IACd;IACA2B,WAAW,CAACE,KAAK,GAAGnB,UAAU,CAC5BE,YAAY,CACVD,UAAU,CAAC,CAAC,EAAE;MAAEmB,QAAQ,EAAE,IAAI;MAAEC,MAAM,EAAEhB,MAAM,CAACiB,KAAK,CAACjB,MAAM,CAACkB,IAAI;IAAE,CAAC,CAAC,EACpEtB,UAAU,CAAC,GAAG,EAAE;MAAEmB,QAAQ,EAAE,IAAI;MAAEC,MAAM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GAAGY,IAAI,GAAG,IAAK;cACxBG,EAAE,EAAEM,GAAG,CAACpB,CAAC,GAAGW,IAAI,GAAG,IAAK;cACxBI,CAAC,EAAEJ,IAAI,GAAG,GAAI;cACdK,KAAK,EAAC,SAAS;cACfC,OAAO,EAAE;YAAI,CACd,CAAC;UAAA,GA5BG,YAAYT,CAAC,EA6Bb,CAAC;QAEZ,CAAC;MAAC,CACG,CAAC,eAGRlC,IAAA,CAACb,KAAK;QAAAoB,QAAA,EACHuB,KAAK,CAACC,IAAI,CAAC;UAAEC,MAAM,EAAE;QAAG,CAAC,EAAE,CAACC,CAAC,EAAEC,CAAC,KAAK;UACpC,MAAMT,CAAC,GAAItB,KAAK,GAAG,CAAC,IAAK+B,CAAC,GAAG,CAAC,CAAC,GAAIA,CAAC,GAAG,CAAC,GAAI,EAAE;UAC9C,MAAMR,CAAC,GAAItB,MAAM,GAAG,CAAC,GAAI+B,IAAI,CAACC,KAAK,CAACF,CAAC,GAAG,CAAC,CAAC,GAAIA,CAAC,GAAG,CAAC,GAAI,EAAE;UACzD,MAAMG,IAAI,GAAG,GAAG,GAAIH,CAAC,GAAG,CAAC,GAAI,GAAG;UAEhC,oBACElC,IAAA,CAACd,MAAM;YAELqD,EAAE,EAAEd,CAAE;YACNe,EAAE,EAAEd,CAAE;YACNe,CAAC,EAAEJ,IAAK;YACRK,KAAK,EAAC,SAAS;YACfC,OAAO,EAAE;UAAK,GALT,QAAQT,CAAC,EAMf,CAAC;QAEN,CAAC;MAAC,CACG,CAAC;IAAA,CACF,CAAC,EAGR3B,QAAQ;EAAA,CACI,CAAC;AAEpB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
5
|
+
import Animated, { useSharedValue, useAnimatedStyle, withSpring, withRepeat, withSequence, withTiming } from 'react-native-reanimated';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
|
|
8
|
+
export const GameControls = ({
|
|
9
|
+
isPlaying,
|
|
10
|
+
gameOver,
|
|
11
|
+
onStartGame,
|
|
12
|
+
onStopGame
|
|
13
|
+
}) => {
|
|
14
|
+
const buttonScale = useSharedValue(1);
|
|
15
|
+
const pulseAnimation = useSharedValue(1);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
// Pulse animation for start button when game is not playing
|
|
18
|
+
if (!isPlaying) {
|
|
19
|
+
pulseAnimation.value = withRepeat(withSequence(withTiming(1.05, {
|
|
20
|
+
duration: 1000
|
|
21
|
+
}), withTiming(1, {
|
|
22
|
+
duration: 1000
|
|
23
|
+
})), -1, false);
|
|
24
|
+
} else {
|
|
25
|
+
pulseAnimation.value = withTiming(1, {
|
|
26
|
+
duration: 300
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}, [isPlaying]);
|
|
30
|
+
const handlePressIn = () => {
|
|
31
|
+
buttonScale.value = withSpring(0.95);
|
|
32
|
+
};
|
|
33
|
+
const handlePressOut = () => {
|
|
34
|
+
buttonScale.value = withSpring(1);
|
|
35
|
+
};
|
|
36
|
+
const animatedButtonStyle = useAnimatedStyle(() => {
|
|
37
|
+
return {
|
|
38
|
+
transform: [{
|
|
39
|
+
scale: buttonScale.value * (!isPlaying ? pulseAnimation.value : 1)
|
|
40
|
+
}]
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
return /*#__PURE__*/_jsx(View, {
|
|
44
|
+
style: styles.controlsContainer,
|
|
45
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
46
|
+
style: styles.controlsRow,
|
|
47
|
+
children: !isPlaying ? /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
|
|
48
|
+
onPress: onStartGame,
|
|
49
|
+
onPressIn: handlePressIn,
|
|
50
|
+
onPressOut: handlePressOut,
|
|
51
|
+
style: [styles.buttonContainer, styles.startButton, animatedButtonStyle],
|
|
52
|
+
activeOpacity: 0.8,
|
|
53
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
54
|
+
style: styles.buttonContent,
|
|
55
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
56
|
+
style: styles.startButtonText,
|
|
57
|
+
children: gameOver ? 'LAUNCH AGAIN' : 'LAUNCH MISSION'
|
|
58
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
59
|
+
style: styles.buttonSubtext,
|
|
60
|
+
children: gameOver ? 'Start a new space mission!' : 'Navigate through space!'
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
}) : /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
|
|
64
|
+
onPress: onStopGame,
|
|
65
|
+
onPressIn: handlePressIn,
|
|
66
|
+
onPressOut: handlePressOut,
|
|
67
|
+
style: [styles.buttonContainer, styles.stopButton, animatedButtonStyle],
|
|
68
|
+
activeOpacity: 0.8,
|
|
69
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
70
|
+
style: styles.buttonContent,
|
|
71
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
72
|
+
style: styles.stopButtonText,
|
|
73
|
+
children: "ABORT MISSION"
|
|
74
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
75
|
+
style: styles.buttonSubtext,
|
|
76
|
+
children: "End current space mission"
|
|
77
|
+
})]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
const styles = StyleSheet.create({
|
|
84
|
+
controlsContainer: {
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
paddingVertical: 20,
|
|
88
|
+
paddingHorizontal: 20
|
|
89
|
+
},
|
|
90
|
+
controlsRow: {
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
},
|
|
95
|
+
buttonContainer: {
|
|
96
|
+
shadowOffset: {
|
|
97
|
+
width: 0,
|
|
98
|
+
height: 8
|
|
99
|
+
},
|
|
100
|
+
shadowOpacity: 0.4,
|
|
101
|
+
shadowRadius: 12,
|
|
102
|
+
elevation: 8
|
|
103
|
+
},
|
|
104
|
+
startButton: {
|
|
105
|
+
backgroundColor: '#10b981',
|
|
106
|
+
// Emerald green to match space theme
|
|
107
|
+
paddingHorizontal: 32,
|
|
108
|
+
paddingVertical: 20,
|
|
109
|
+
borderRadius: 30,
|
|
110
|
+
shadowColor: '#10b981',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
minHeight: 70,
|
|
114
|
+
minWidth: 200,
|
|
115
|
+
borderWidth: 3,
|
|
116
|
+
borderColor: '#34d399',
|
|
117
|
+
// Light green border
|
|
118
|
+
position: 'relative',
|
|
119
|
+
overflow: 'hidden'
|
|
120
|
+
},
|
|
121
|
+
stopButton: {
|
|
122
|
+
backgroundColor: '#dc2626',
|
|
123
|
+
// Red
|
|
124
|
+
paddingHorizontal: 32,
|
|
125
|
+
paddingVertical: 20,
|
|
126
|
+
borderRadius: 30,
|
|
127
|
+
shadowColor: '#dc2626',
|
|
128
|
+
justifyContent: 'center',
|
|
129
|
+
alignItems: 'center',
|
|
130
|
+
minHeight: 70,
|
|
131
|
+
minWidth: 200,
|
|
132
|
+
borderWidth: 3,
|
|
133
|
+
borderColor: '#f87171',
|
|
134
|
+
// Light red border
|
|
135
|
+
position: 'relative',
|
|
136
|
+
overflow: 'hidden'
|
|
137
|
+
},
|
|
138
|
+
buttonContent: {
|
|
139
|
+
alignItems: 'center',
|
|
140
|
+
justifyContent: 'center'
|
|
141
|
+
},
|
|
142
|
+
startButtonText: {
|
|
143
|
+
fontSize: 20,
|
|
144
|
+
fontWeight: '800',
|
|
145
|
+
color: '#ffffff',
|
|
146
|
+
textAlign: 'center',
|
|
147
|
+
textShadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
148
|
+
textShadowOffset: {
|
|
149
|
+
width: 1,
|
|
150
|
+
height: 1
|
|
151
|
+
},
|
|
152
|
+
textShadowRadius: 2,
|
|
153
|
+
letterSpacing: 1
|
|
154
|
+
},
|
|
155
|
+
stopButtonText: {
|
|
156
|
+
fontSize: 20,
|
|
157
|
+
fontWeight: '800',
|
|
158
|
+
color: '#ffffff',
|
|
159
|
+
textAlign: 'center',
|
|
160
|
+
textShadowColor: 'rgba(0, 0, 0, 0.3)',
|
|
161
|
+
textShadowOffset: {
|
|
162
|
+
width: 1,
|
|
163
|
+
height: 1
|
|
164
|
+
},
|
|
165
|
+
textShadowRadius: 2,
|
|
166
|
+
letterSpacing: 1
|
|
167
|
+
},
|
|
168
|
+
buttonSubtext: {
|
|
169
|
+
fontSize: 12,
|
|
170
|
+
fontWeight: '600',
|
|
171
|
+
color: 'rgba(255, 255, 255, 0.8)',
|
|
172
|
+
textAlign: 'center',
|
|
173
|
+
marginTop: 4,
|
|
174
|
+
letterSpacing: 0.5
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
//# sourceMappingURL=GameControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","View","TouchableOpacity","Text","StyleSheet","Animated","useSharedValue","useAnimatedStyle","withSpring","withRepeat","withSequence","withTiming","jsx","_jsx","jsxs","_jsxs","AnimatedTouchableOpacity","createAnimatedComponent","GameControls","isPlaying","gameOver","onStartGame","onStopGame","buttonScale","pulseAnimation","value","duration","handlePressIn","handlePressOut","animatedButtonStyle","transform","scale","style","styles","controlsContainer","children","controlsRow","onPress","onPressIn","onPressOut","buttonContainer","startButton","activeOpacity","buttonContent","startButtonText","buttonSubtext","stopButton","stopButtonText","create","justifyContent","alignItems","paddingVertical","paddingHorizontal","flexDirection","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","backgroundColor","borderRadius","shadowColor","minHeight","minWidth","borderWidth","borderColor","position","overflow","fontSize","fontWeight","color","textAlign","textShadowColor","textShadowOffset","textShadowRadius","letterSpacing","marginTop"],"sourceRoot":"../../../../../src","sources":["games/space-traveller/components/GameControls.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACvE,OAAOC,QAAQ,IACbC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,UAAU,QACL,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjC,MAAMC,wBAAwB,GAAGX,QAAQ,CAACY,uBAAuB,CAACf,gBAAgB,CAAC;AASnF,OAAO,MAAMgB,YAAyC,GAAGA,CAAC;EACxDC,SAAS;EACTC,QAAQ;EACRC,WAAW;EACXC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGjB,cAAc,CAAC,CAAC,CAAC;EACrC,MAAMkB,cAAc,GAAGlB,cAAc,CAAC,CAAC,CAAC;EAExCN,SAAS,CAAC,MAAM;IACd;IACA,IAAI,CAACmB,SAAS,EAAE;MACdK,cAAc,CAACC,KAAK,GAAGhB,UAAU,CAC/BC,YAAY,CACVC,UAAU,CAAC,IAAI,EAAE;QAAEe,QAAQ,EAAE;MAAK,CAAC,CAAC,EACpCf,UAAU,CAAC,CAAC,EAAE;QAAEe,QAAQ,EAAE;MAAK,CAAC,CAClC,CAAC,EACD,CAAC,CAAC,EACF,KACF,CAAC;IACH,CAAC,MAAM;MACLF,cAAc,CAACC,KAAK,GAAGd,UAAU,CAAC,CAAC,EAAE;QAAEe,QAAQ,EAAE;MAAI,CAAC,CAAC;IACzD;EACF,CAAC,EAAE,CAACP,SAAS,CAAC,CAAC;EAEf,MAAMQ,aAAa,GAAGA,CAAA,KAAM;IAC1BJ,WAAW,CAACE,KAAK,GAAGjB,UAAU,CAAC,IAAI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AK,EAAE,0BAA0B;IACjCC,SAAS,EAAE,QAAQ;IACnBK,SAAS,EAAE,CAAC;IACZD,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, TouchableOpacity, Text, Modal, StyleSheet, Dimensions } from 'react-native';
|
|
5
|
+
import { Canvas, LinearGradient, Rect, vec } from '@shopify/react-native-skia';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
width,
|
|
9
|
+
height
|
|
10
|
+
} = Dimensions.get('window');
|
|
11
|
+
export const GameOverModal = ({
|
|
12
|
+
isVisible,
|
|
13
|
+
score,
|
|
14
|
+
onPlayAgain
|
|
15
|
+
}) => {
|
|
16
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
17
|
+
visible: isVisible,
|
|
18
|
+
transparent: true,
|
|
19
|
+
animationType: "fade",
|
|
20
|
+
onRequestClose: () => {},
|
|
21
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
22
|
+
style: styles.gameOverOverlay,
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Canvas, {
|
|
24
|
+
style: {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
top: 0,
|
|
27
|
+
left: 0,
|
|
28
|
+
right: 0,
|
|
29
|
+
bottom: 0,
|
|
30
|
+
width,
|
|
31
|
+
height
|
|
32
|
+
},
|
|
33
|
+
children: /*#__PURE__*/_jsx(Rect, {
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
width: width,
|
|
37
|
+
height: height,
|
|
38
|
+
children: /*#__PURE__*/_jsx(LinearGradient, {
|
|
39
|
+
start: vec(0, 0),
|
|
40
|
+
end: vec(0, height),
|
|
41
|
+
colors: ['#0c0a1f', '#1a1b3a', '#2d1b69', '#1e1b4b']
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
45
|
+
style: styles.gameOverModal,
|
|
46
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
47
|
+
style: styles.gameOverEmoji,
|
|
48
|
+
children: "\uD83D\uDE80"
|
|
49
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
50
|
+
style: styles.gameOverTitle,
|
|
51
|
+
children: "Mission Complete!"
|
|
52
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
53
|
+
style: styles.scoreContainer,
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
55
|
+
style: styles.finalScoreLabel,
|
|
56
|
+
children: "Final Score"
|
|
57
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
58
|
+
style: styles.finalScoreValue,
|
|
59
|
+
children: score
|
|
60
|
+
})]
|
|
61
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
62
|
+
onPress: onPlayAgain,
|
|
63
|
+
style: styles.playAgainButton,
|
|
64
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
65
|
+
style: styles.playAgainText,
|
|
66
|
+
children: "\uD83D\uDE80 Launch Again"
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
})]
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const styles = StyleSheet.create({
|
|
74
|
+
gameOverOverlay: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
backgroundColor: 'rgba(12, 10, 31, 0.3)',
|
|
77
|
+
// Deep space overlay
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
alignItems: 'center'
|
|
80
|
+
},
|
|
81
|
+
gameOverModal: {
|
|
82
|
+
backgroundColor: 'rgba(30, 27, 75, 0.5)',
|
|
83
|
+
// Deep space blue with transparency
|
|
84
|
+
borderRadius: 24,
|
|
85
|
+
padding: 32,
|
|
86
|
+
marginHorizontal: 24,
|
|
87
|
+
shadowColor: '#000',
|
|
88
|
+
shadowOffset: {
|
|
89
|
+
width: 0,
|
|
90
|
+
height: 8
|
|
91
|
+
},
|
|
92
|
+
shadowOpacity: 0.6,
|
|
93
|
+
shadowRadius: 16,
|
|
94
|
+
elevation: 16,
|
|
95
|
+
borderWidth: 2,
|
|
96
|
+
borderColor: 'rgba(139, 92, 246, 0.6)',
|
|
97
|
+
// Purple space border
|
|
98
|
+
maxWidth: 400,
|
|
99
|
+
width: '100%'
|
|
100
|
+
},
|
|
101
|
+
gameOverEmoji: {
|
|
102
|
+
fontSize: 64,
|
|
103
|
+
textAlign: 'center',
|
|
104
|
+
marginBottom: 16
|
|
105
|
+
},
|
|
106
|
+
gameOverTitle: {
|
|
107
|
+
color: '#ffffff',
|
|
108
|
+
fontSize: 28,
|
|
109
|
+
fontWeight: 'bold',
|
|
110
|
+
textAlign: 'center',
|
|
111
|
+
marginBottom: 24,
|
|
112
|
+
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
113
|
+
textShadowOffset: {
|
|
114
|
+
width: 2,
|
|
115
|
+
height: 2
|
|
116
|
+
},
|
|
117
|
+
textShadowRadius: 4
|
|
118
|
+
},
|
|
119
|
+
scoreContainer: {
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
marginBottom: 20,
|
|
122
|
+
backgroundColor: 'rgba(45, 27, 105, 0.8)',
|
|
123
|
+
// Darker space blue
|
|
124
|
+
borderRadius: 16,
|
|
125
|
+
padding: 20,
|
|
126
|
+
borderWidth: 1,
|
|
127
|
+
borderColor: 'rgba(139, 92, 246, 0.3)'
|
|
128
|
+
},
|
|
129
|
+
finalScoreLabel: {
|
|
130
|
+
fontSize: 18,
|
|
131
|
+
color: '#e2e8f0',
|
|
132
|
+
fontWeight: 'bold',
|
|
133
|
+
marginBottom: 8,
|
|
134
|
+
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
135
|
+
textShadowOffset: {
|
|
136
|
+
width: 1,
|
|
137
|
+
height: 1
|
|
138
|
+
},
|
|
139
|
+
textShadowRadius: 2
|
|
140
|
+
},
|
|
141
|
+
finalScoreValue: {
|
|
142
|
+
fontSize: 36,
|
|
143
|
+
color: '#fbbf24',
|
|
144
|
+
// Bright yellow
|
|
145
|
+
fontWeight: 'bold',
|
|
146
|
+
textAlign: 'center',
|
|
147
|
+
textShadowColor: 'rgba(0,0,0,0.5)',
|
|
148
|
+
textShadowOffset: {
|
|
149
|
+
width: 2,
|
|
150
|
+
height: 2
|
|
151
|
+
},
|
|
152
|
+
textShadowRadius: 4
|
|
153
|
+
},
|
|
154
|
+
playAgainButton: {
|
|
155
|
+
backgroundColor: '#22c55e',
|
|
156
|
+
// Bright green
|
|
157
|
+
paddingVertical: 18,
|
|
158
|
+
paddingHorizontal: 36,
|
|
159
|
+
borderRadius: 20,
|
|
160
|
+
shadowColor: '#000',
|
|
161
|
+
shadowOffset: {
|
|
162
|
+
width: 0,
|
|
163
|
+
height: 4
|
|
164
|
+
},
|
|
165
|
+
shadowOpacity: 0.3,
|
|
166
|
+
shadowRadius: 8,
|
|
167
|
+
elevation: 8
|
|
168
|
+
},
|
|
169
|
+
playAgainText: {
|
|
170
|
+
color: '#ffffff',
|
|
171
|
+
fontWeight: 'bold',
|
|
172
|
+
fontSize: 18,
|
|
173
|
+
textAlign: 'center',
|
|
174
|
+
textShadowColor: 'rgba(0,0,0,0.3)',
|
|
175
|
+
textShadowOffset: {
|
|
176
|
+
width: 1,
|
|
177
|
+
height: 1
|
|
178
|
+
},
|
|
179
|
+
textShadowRadius: 2
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
//# sourceMappingURL=GameOverModal.js.map
|