react-native-games 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -7
- package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -167
- package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -182
- package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
- package/lib/module/games/balloon-blaster/BalloonBlasterService.js +1 -318
- package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +1 -183
- package/lib/module/games/balloon-blaster/components/BalloonComponent.js +1 -237
- package/lib/module/games/balloon-blaster/components/GameArea.js +1 -156
- package/lib/module/games/balloon-blaster/components/GameBackground.js +1 -476
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js +1 -112
- package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/balloon-blaster/components/index.js +1 -7
- package/lib/module/games/candy-crush/CandyCrush.js +1 -131
- package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
- package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
- package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
- package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
- package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
- package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
- package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
- package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
- package/lib/module/games/candy-crush/components/index.js +1 -7
- package/lib/module/games/candy-crush/index.js +1 -6
- package/lib/module/games/colors-sort/ColorsSort.js +1 -143
- package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
- package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
- package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
- package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
- package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
- package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
- package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
- package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
- package/lib/module/games/colors-sort/components/index.js +1 -6
- package/lib/module/games/dino-jump/DinoJump.js +1 -209
- package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
- package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
- package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
- package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
- package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
- package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
- package/lib/module/games/dino-jump/components/GameArea.js +1 -68
- package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
- package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
- package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
- package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
- package/lib/module/games/dino-jump/components/index.js +1 -9
- package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
- package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
- package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
- package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
- package/lib/module/games/flappy-bird/components/Bird.js +1 -87
- package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
- package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
- package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
- package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
- package/lib/module/games/flappy-bird/components/index.js +1 -8
- package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
- package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
- package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
- package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
- package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
- package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
- package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
- package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
- package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
- package/lib/module/games/fruit-merger/components/index.js +1 -7
- package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
- package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
- package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
- package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
- package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
- package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
- package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
- package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/fruit-ninja/components/index.js +1 -7
- package/lib/module/games/game-2048/Game2048.js +1 -149
- package/lib/module/games/game-2048/Game2048.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Constants.js +1 -263
- package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
- package/lib/module/games/game-2048/Game2048Service.js +1 -457
- package/lib/module/games/game-2048/Game2048Store.js +1 -236
- package/lib/module/games/game-2048/components/GameBackground.js +1 -247
- package/lib/module/games/game-2048/components/GameGrid.js +1 -139
- package/lib/module/games/game-2048/components/GameTile.js +1 -72
- package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
- package/lib/module/games/game-2048/components/index.js +1 -7
- package/lib/module/games/maze-runner/MazeRunner.js +1 -267
- package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
- package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
- package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
- package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
- package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
- package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
- package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
- package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
- package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
- package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
- package/lib/module/games/maze-runner/components/index.js +1 -8
- package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
- package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
- package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
- package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
- package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
- package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
- package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
- package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
- package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
- package/lib/module/games/popit-fidget/components/index.js +1 -7
- package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
- package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
- package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
- package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
- package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
- package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
- package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
- package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
- package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
- package/lib/module/games/sliding-numbers/components/index.js +1 -7
- package/lib/module/games/snake/Snake.js +1 -189
- package/lib/module/games/snake/Snake.js.map +1 -1
- package/lib/module/games/snake/SnakeConstants.js +1 -138
- package/lib/module/games/snake/SnakeConstants.js.map +1 -1
- package/lib/module/games/snake/SnakeService.js +1 -148
- package/lib/module/games/snake/SnakeStore.js +1 -182
- package/lib/module/games/snake/components/GameBackground.js +1 -221
- package/lib/module/games/snake/components/GameGrid.js +1 -153
- package/lib/module/games/snake/components/ScoreBoard.js +1 -51
- package/lib/module/games/snake/components/index.js +1 -6
- package/lib/module/games/snake/index.js +1 -6
- package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
- package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
- package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
- package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
- package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
- package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
- package/lib/module/games/space-fighter/components/GameArea.js +1 -289
- package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
- package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
- package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
- package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
- package/lib/module/games/space-fighter/components/index.js +1 -9
- package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
- package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
- package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
- package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
- package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
- package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
- package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
- package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
- package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
- package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
- package/lib/module/games/whack-a-mole/components/index.js +1 -8
- package/lib/module/helpers/AnimationFrame.js +1 -120
- package/lib/module/helpers/AnimationTracker.js +1 -89
- package/lib/module/helpers/ErrorHandler.js +1 -269
- package/lib/module/helpers/GameControlButton.js +1 -219
- package/lib/module/helpers/GameOverModal.js +1 -144
- package/lib/module/helpers/GameOverModal.js.map +1 -1
- package/lib/module/helpers/GameSettingsModal.js +1 -287
- package/lib/module/helpers/ParticleBlast.js +1 -134
- package/lib/module/helpers/ScoreBoardContainer.js +1 -34
- package/lib/module/helpers/index.js +1 -12
- package/lib/module/index.js +1 -22
- package/lib/module/services/GamesConstants.js +1 -178
- package/lib/module/services/GamesService.js +1 -112
- package/lib/module/services/GamesService.js.map +1 -1
- package/lib/module/services/HapticsService.js +1 -77
- package/lib/module/services/SoundsService.js +1 -302
- package/lib/module/services/UtilsService.js +1 -32
- package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
- package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +1 -1
- package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
- package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
- package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
- package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
- package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
- package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
- package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
- package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
- package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
- package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
- package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
- package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
- package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
- package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
- package/lib/typescript/src/services/GamesConstants.d.ts +7 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,10 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
**react-native-games** is a collection of high-performance games for your React Native projects. Built with modern React Native technologies including Skia, Reanimated, Gesture Handler and TypeScript for smooth 60fps gameplay across iOS, Android, and Web platforms.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 20px 0;">
|
|
6
|
+
|
|
7
|
+
<div>
|
|
8
|
+
<strong>🚀 High Performance</strong><br/>
|
|
9
|
+
• 60fps gameplay with React Native Skia<br/>
|
|
10
|
+
• Optimized animations using Reanimated 3<br/>
|
|
11
|
+
• Delta time physics loops<br/>
|
|
12
|
+
• React.memo optimizations<br/>
|
|
13
|
+
• Minimal re-renders with direct store subscriptions
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div>
|
|
17
|
+
<strong>📱 Cross-Platform</strong><br/>
|
|
18
|
+
• iOS, Android, and Web support<br/>
|
|
19
|
+
• Consistent performance across platforms<br/>
|
|
20
|
+
• Responsive design for all screen sizes<br/>
|
|
21
|
+
• Dynamic offset handling for notches<br/>
|
|
22
|
+
• Adaptive UI components
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div>
|
|
26
|
+
<strong>🎵 Rich Audio & Haptics</strong><br/>
|
|
27
|
+
• Sound effects and speech synthesis<br/>
|
|
28
|
+
• Haptic feedback for immersive experience<br/>
|
|
29
|
+
• Configurable audio settings<br/>
|
|
30
|
+
• Per-game sound customization
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div>
|
|
34
|
+
<strong>🎯 Customizable</strong><br/>
|
|
35
|
+
• Multiple difficulty levels<br/>
|
|
36
|
+
• Adjustable game parameters<br/>
|
|
37
|
+
• Persistent settings storage<br/>
|
|
38
|
+
• Unified settings interface
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div>
|
|
42
|
+
<strong>🎮 Game Features</strong><br/>
|
|
43
|
+
• Physics simulation and collisions<br/>
|
|
44
|
+
• Particle systems and visual effects<br/>
|
|
45
|
+
• Procedural generation (mazes, obstacles)<br/>
|
|
46
|
+
• Score systems and achievements<br/>
|
|
47
|
+
• Progressive difficulty scaling
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div>
|
|
51
|
+
<strong>🛠️ Developer Friendly</strong><br/>
|
|
52
|
+
• TypeScript support throughout<br/>
|
|
53
|
+
• Shared components (GameControlButton, ScoreBoard)<br/>
|
|
54
|
+
• Consistent API across all games<br/>
|
|
55
|
+
• Easy integration and customization<br/>
|
|
56
|
+
• Comprehensive documentation
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
</div>
|
|
9
60
|
|
|
10
61
|
## 🎯 Available Games
|
|
11
62
|
|
|
@@ -50,7 +101,7 @@ Follow the installation guides for each peer dependency:
|
|
|
50
101
|
- **[react-native-reanimated](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)** - Animations
|
|
51
102
|
- **[react-native-gesture-handler](https://docs.swmansion.com/react-native-gesture-handler/docs/fundamentals/installation)** - Gestures
|
|
52
103
|
- **[expo-speech](https://docs.expo.dev/versions/latest/sdk/speech/)** - Sounds
|
|
53
|
-
- **[expo-haptics](https://docs.expo.dev/versions/latest/sdk/haptics/)** -
|
|
104
|
+
- **[expo-haptics](https://docs.expo.dev/versions/latest/sdk/haptics/)** - Haptics
|
|
54
105
|
|
|
55
106
|
## 🚀 Usage
|
|
56
107
|
|
|
@@ -61,14 +112,14 @@ For basic usage without settings persistence:
|
|
|
61
112
|
```tsx
|
|
62
113
|
import React, { useState } from 'react';
|
|
63
114
|
import { View } from 'react-native';
|
|
64
|
-
import { DEFAULT_GAME_SETTINGS,
|
|
115
|
+
import { DEFAULT_GAME_SETTINGS, FruitNinja } from 'react-native-games';
|
|
65
116
|
|
|
66
117
|
export default function GameScreen() {
|
|
67
118
|
const [settings, setSettings] = useState(DEFAULT_GAME_SETTINGS);
|
|
68
119
|
|
|
69
120
|
return (
|
|
70
121
|
<View style={{ flex: 1 }}>
|
|
71
|
-
<
|
|
122
|
+
<FruitNinja settings={settings} onSettingsChange={setSettings} />
|
|
72
123
|
</View>
|
|
73
124
|
);
|
|
74
125
|
}
|
|
@@ -1,167 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useEffect, useMemo, useCallback } from 'react';
|
|
4
|
-
import { View, StyleSheet } from 'react-native';
|
|
5
|
-
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
6
|
-
import { useBalloonBlasterStore } from "./BalloonBlasterStore.js";
|
|
7
|
-
import { createBalloonBlasterService } from "./BalloonBlasterService.js";
|
|
8
|
-
import { ScoreBoard, GameArea, GameBackground } from "./components/index.js";
|
|
9
|
-
import { GameControlButton, GameOverModal, useAnimationTrackers, useGameErrorHandler, GameErrorType } from "../../helpers/index.js";
|
|
10
|
-
import { GameSettingsModal } from "../../helpers/index.js";
|
|
11
|
-
import { GAME_IDS, DEFAULT_GAME_SETTINGS } from "../../services/UtilsService.js";
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
export const BalloonBlaster = /*#__PURE__*/React.memo(({
|
|
14
|
-
settings,
|
|
15
|
-
onSettingsChange
|
|
16
|
-
}) => {
|
|
17
|
-
// Read UI-critical state independently to minimize re-renders
|
|
18
|
-
const isPlaying = useBalloonBlasterStore(state => state.isPlaying);
|
|
19
|
-
const gameOver = useBalloonBlasterStore(state => state.gameOver);
|
|
20
|
-
const score = useBalloonBlasterStore(state => state.score);
|
|
21
|
-
|
|
22
|
-
// Get store actions independently (these don't cause re-renders)
|
|
23
|
-
const startGame = useBalloonBlasterStore(state => state.startGame);
|
|
24
|
-
const stopGame = useBalloonBlasterStore(state => state.stopGame);
|
|
25
|
-
const resetGame = useBalloonBlasterStore(state => state.resetGame);
|
|
26
|
-
const decrementTime = useBalloonBlasterStore(state => state.decrementTime);
|
|
27
|
-
const addBalloon = useBalloonBlasterStore(state => state.addBalloon);
|
|
28
|
-
const removeBalloon = useBalloonBlasterStore(state => state.removeBalloon);
|
|
29
|
-
const updateBalloon = useBalloonBlasterStore(state => state.updateBalloon);
|
|
30
|
-
|
|
31
|
-
// Use shared animation tracking utility
|
|
32
|
-
const {
|
|
33
|
-
balloonAnimations,
|
|
34
|
-
particleAnimations
|
|
35
|
-
} = useAnimationTrackers(['balloonAnimations', 'particleAnimations']);
|
|
36
|
-
|
|
37
|
-
// Error handling for the game
|
|
38
|
-
const {
|
|
39
|
-
wrapFunction,
|
|
40
|
-
safeExecute
|
|
41
|
-
} = useGameErrorHandler(GAME_IDS.BALLOON_BLASTER);
|
|
42
|
-
|
|
43
|
-
// Memoized balloon spawning callback
|
|
44
|
-
const spawnBalloon = useCallback(balloon => {
|
|
45
|
-
addBalloon(balloon);
|
|
46
|
-
}, [addBalloon]);
|
|
47
|
-
|
|
48
|
-
// Memoized game control functions with error handling
|
|
49
|
-
const handleResetGame = useCallback(wrapFunction(() => {
|
|
50
|
-
resetGame();
|
|
51
|
-
}, GameErrorType.UNKNOWN_ERROR), [wrapFunction, resetGame]);
|
|
52
|
-
|
|
53
|
-
// Memoized game service creation to prevent recreation
|
|
54
|
-
const gameService = useMemo(() => {
|
|
55
|
-
return safeExecute(() => createBalloonBlasterService(balloonAnimations, particleAnimations), createBalloonBlasterService(balloonAnimations, particleAnimations),
|
|
56
|
-
// Fallback to direct creation
|
|
57
|
-
GameErrorType.INITIALIZATION_ERROR);
|
|
58
|
-
}, [balloonAnimations, particleAnimations, safeExecute]);
|
|
59
|
-
const handleStartGame = useCallback(wrapFunction(() => {
|
|
60
|
-
// AGGRESSIVE cleanup - force clear everything
|
|
61
|
-
resetGame();
|
|
62
|
-
|
|
63
|
-
// Force clear any existing balloons immediately
|
|
64
|
-
const currentBalloons = useBalloonBlasterStore.getState().balloons;
|
|
65
|
-
currentBalloons.forEach(balloon => removeBalloon(balloon.id));
|
|
66
|
-
|
|
67
|
-
// Clean up service
|
|
68
|
-
if (gameService) {
|
|
69
|
-
gameService.cleanup();
|
|
70
|
-
gameService.resetAnimations();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// Minimal delay to ensure complete cleanup
|
|
74
|
-
setTimeout(() => {
|
|
75
|
-
startGame(); // Store uses fixed 60s duration internally
|
|
76
|
-
if (gameService) {
|
|
77
|
-
gameService.startGameTimer(decrementTime);
|
|
78
|
-
gameService.startBalloonSpawning(spawnBalloon, 600); // Even faster spawn interval
|
|
79
|
-
gameService.startPhysicsLoop(updateBalloon, removeBalloon, () => useBalloonBlasterStore.getState().balloons);
|
|
80
|
-
}
|
|
81
|
-
}, 50); // Minimal delay for immediate game start
|
|
82
|
-
}, GameErrorType.INITIALIZATION_ERROR), [wrapFunction, resetGame, removeBalloon, gameService, startGame, decrementTime, spawnBalloon, updateBalloon]);
|
|
83
|
-
const handleStopGame = useCallback(wrapFunction(() => {
|
|
84
|
-
stopGame();
|
|
85
|
-
if (gameService) {
|
|
86
|
-
gameService.cleanup();
|
|
87
|
-
gameService.resetAnimations();
|
|
88
|
-
}
|
|
89
|
-
}, GameErrorType.UNKNOWN_ERROR), [wrapFunction, stopGame, gameService]);
|
|
90
|
-
|
|
91
|
-
// Initialize game settings on mount
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
return () => {
|
|
94
|
-
handleResetGame();
|
|
95
|
-
};
|
|
96
|
-
}, [handleResetGame]);
|
|
97
|
-
|
|
98
|
-
// Auto-stop balloon spawning when game over state changes
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
if (gameOver && gameService) {
|
|
101
|
-
// Stop all timers and physics when game over
|
|
102
|
-
gameService.cleanup();
|
|
103
|
-
}
|
|
104
|
-
}, [gameOver, gameService]);
|
|
105
|
-
|
|
106
|
-
// Memoized GameControlButton props to prevent unnecessary re-renders
|
|
107
|
-
const gameControlButtonProps = useMemo(() => ({
|
|
108
|
-
isPlaying,
|
|
109
|
-
gameOver,
|
|
110
|
-
onStartGame: handleStartGame,
|
|
111
|
-
onStopGame: handleStopGame,
|
|
112
|
-
startButtonText: "START POPPING",
|
|
113
|
-
stopButtonText: "STOP GAME",
|
|
114
|
-
startButtonSubtext: "Pop balloons to score!",
|
|
115
|
-
stopButtonSubtext: "End current game",
|
|
116
|
-
startButtonColor: "#3b82f6",
|
|
117
|
-
stopButtonColor: "#dc2626",
|
|
118
|
-
startButtonBorderColor: "#60a5fa",
|
|
119
|
-
stopButtonBorderColor: "#f87171"
|
|
120
|
-
}), [isPlaying, gameOver, handleStartGame, handleStopGame]);
|
|
121
|
-
|
|
122
|
-
// Memoized GameOverModal props to prevent unnecessary re-renders
|
|
123
|
-
const gameOverModalProps = useMemo(() => ({
|
|
124
|
-
isVisible: gameOver,
|
|
125
|
-
score,
|
|
126
|
-
onPlayAgain: handleResetGame,
|
|
127
|
-
buttonText: "Pop Again!",
|
|
128
|
-
primaryColor: "rgba(59, 130, 246, 0.8)",
|
|
129
|
-
// Blue theme for Balloon Blaster
|
|
130
|
-
borderColor: "rgba(59, 130, 246, 0.9)",
|
|
131
|
-
buttonColor: "#10b981",
|
|
132
|
-
buttonBorderColor: "#34d399"
|
|
133
|
-
}), [gameOver, score, handleResetGame]);
|
|
134
|
-
|
|
135
|
-
// Memoized GameSettingsModal props to prevent unnecessary re-renders
|
|
136
|
-
const gameSettingsModalProps = useMemo(() => ({
|
|
137
|
-
gameId: GAME_IDS.BALLOON_BLASTER,
|
|
138
|
-
settings: settings || DEFAULT_GAME_SETTINGS,
|
|
139
|
-
onSettingsChange
|
|
140
|
-
}), [settings, onSettingsChange]);
|
|
141
|
-
|
|
142
|
-
// Get offset from settings
|
|
143
|
-
const offset = settings?.offset ?? 0;
|
|
144
|
-
return /*#__PURE__*/_jsx(View, {
|
|
145
|
-
style: styles.container,
|
|
146
|
-
children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
147
|
-
children: /*#__PURE__*/_jsxs(GameBackground, {
|
|
148
|
-
offset: offset,
|
|
149
|
-
children: [/*#__PURE__*/_jsx(GameArea, {}), /*#__PURE__*/_jsx(ScoreBoard, {
|
|
150
|
-
offset: offset
|
|
151
|
-
}), /*#__PURE__*/_jsx(GameControlButton, {
|
|
152
|
-
...gameControlButtonProps
|
|
153
|
-
}), /*#__PURE__*/_jsx(GameOverModal, {
|
|
154
|
-
...gameOverModalProps
|
|
155
|
-
}), /*#__PURE__*/_jsx(GameSettingsModal, {
|
|
156
|
-
...gameSettingsModalProps
|
|
157
|
-
})]
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
const styles = StyleSheet.create({
|
|
163
|
-
container: {
|
|
164
|
-
flex: 1
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
//# sourceMappingURL=BalloonBlaster.js.map
|
|
1
|
+
"use strict";import React,{useEffect,useMemo,useCallback}from 'react';import{View,StyleSheet}from 'react-native';import{GestureHandlerRootView}from 'react-native-gesture-handler';import{useBalloonBlasterStore}from "./BalloonBlasterStore.js";import{createBalloonBlasterService}from "./BalloonBlasterService.js";import{ScoreBoard,GameArea,GameBackground}from "./components/index.js";import{GameControlButton,GameOverModal,useAnimationTrackers,useGameErrorHandler,GameErrorType}from "../../helpers/index.js";import{GameSettingsModal}from "../../helpers/index.js";import{GAME_IDS,DEFAULT_GAME_SETTINGS}from "../../services/UtilsService.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const BalloonBlaster = React.memo(({settings,onSettingsChange})=>{const isPlaying = useBalloonBlasterStore(state => state.isPlaying);const gameOver = useBalloonBlasterStore(state => state.gameOver);const score = useBalloonBlasterStore(state => state.score);const startGame = useBalloonBlasterStore(state => state.startGame);const stopGame = useBalloonBlasterStore(state => state.stopGame);const resetGame = useBalloonBlasterStore(state => state.resetGame);const decrementTime = useBalloonBlasterStore(state => state.decrementTime);const addBalloon = useBalloonBlasterStore(state => state.addBalloon);const removeBalloon = useBalloonBlasterStore(state => state.removeBalloon);const updateBalloon = useBalloonBlasterStore(state => state.updateBalloon);const{balloonAnimations,particleAnimations}= useAnimationTrackers(['balloonAnimations','particleAnimations']);const{wrapFunction,safeExecute}= useGameErrorHandler(GAME_IDS.BALLOON_BLASTER);const spawnBalloon = useCallback(balloon =>{addBalloon(balloon);},[addBalloon]);const handleResetGame = useCallback(wrapFunction(()=>{resetGame();},GameErrorType.UNKNOWN_ERROR),[wrapFunction,resetGame]);const gameService = useMemo(()=>{return safeExecute(()=> createBalloonBlasterService(balloonAnimations,particleAnimations),createBalloonBlasterService(balloonAnimations,particleAnimations),GameErrorType.INITIALIZATION_ERROR);},[balloonAnimations,particleAnimations,safeExecute]);const handleStartGame = useCallback(wrapFunction(()=>{resetGame();const currentBalloons = useBalloonBlasterStore.getState().balloons;currentBalloons.forEach(balloon => removeBalloon(balloon.id));if(gameService){gameService.cleanup();gameService.resetAnimations();}setTimeout(()=>{startGame();if(gameService){gameService.startGameTimer(decrementTime);gameService.startBalloonSpawning(spawnBalloon,600);gameService.startPhysicsLoop(updateBalloon,removeBalloon,()=> useBalloonBlasterStore.getState().balloons);}},50);},GameErrorType.INITIALIZATION_ERROR),[wrapFunction,resetGame,removeBalloon,gameService,startGame,decrementTime,spawnBalloon,updateBalloon]);const handleStopGame = useCallback(wrapFunction(()=>{stopGame();if(gameService){gameService.cleanup();gameService.resetAnimations();}},GameErrorType.UNKNOWN_ERROR),[wrapFunction,stopGame,gameService]);useEffect(()=>{return()=>{handleResetGame();};},[handleResetGame]);useEffect(()=>{if(gameOver && gameService){gameService.cleanup();}},[gameOver,gameService]);const gameControlButtonProps = useMemo(()=>({isPlaying,gameOver,onStartGame:handleStartGame,onStopGame:handleStopGame,startButtonText:"START POPPING",stopButtonText:"STOP GAME",startButtonSubtext:"Pop balloons to score!",stopButtonSubtext:"End current game",startButtonColor:"#3b82f6",stopButtonColor:"#dc2626",startButtonBorderColor:"#60a5fa",stopButtonBorderColor:"#f87171"}),[isPlaying,gameOver,handleStartGame,handleStopGame]);const gameOverModalProps = useMemo(()=>({isVisible:gameOver,score,onPlayAgain:handleResetGame,buttonText:"Pop Again!",primaryColor:"rgba(59,130,246,0.5)",borderColor:"rgba(59,130,246,0.5)",buttonColor:"#ffffff",buttonBorderColor:"#ffffff",buttonTextColor:"#3b82f6"}),[gameOver,score,handleResetGame]);const gameSettingsModalProps = useMemo(()=>({gameId:GAME_IDS.BALLOON_BLASTER,settings:settings || DEFAULT_GAME_SETTINGS,onSettingsChange}),[settings,onSettingsChange]);const offset = settings?.offset ?? 0;return _jsx(View,{style:styles.container,children:_jsx(GestureHandlerRootView,{children:_jsxs(GameBackground,{offset:offset,children:[_jsx(GameArea,{}),_jsx(ScoreBoard,{offset:offset}),_jsx(GameControlButton,{...gameControlButtonProps}),_jsx(GameOverModal,{...gameOverModalProps}),_jsx(GameSettingsModal,{...gameSettingsModalProps})]})})});});const styles = StyleSheet.create({container:{flex:1}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useMemo","useCallback","View","StyleSheet","GestureHandlerRootView","useBalloonBlasterStore","createBalloonBlasterService","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useAnimationTrackers","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","jsx","_jsx","jsxs","_jsxs","BalloonBlaster","memo","settings","onSettingsChange","isPlaying","state","gameOver","score","startGame","stopGame","resetGame","decrementTime","addBalloon","removeBalloon","updateBalloon","balloonAnimations","particleAnimations","wrapFunction","safeExecute","BALLOON_BLASTER","spawnBalloon","balloon","handleResetGame","UNKNOWN_ERROR","gameService","INITIALIZATION_ERROR","handleStartGame","currentBalloons","getState","balloons","forEach","id","cleanup","resetAnimations","setTimeout","startGameTimer","startBalloonSpawning","startPhysicsLoop","handleStopGame","gameControlButtonProps","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameSettingsModalProps","gameId","offset","style","styles","container","children","create","flex"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlaster.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAA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,OAAO,CAAC,CAAC;IACvB;EACF,CAAC,EAAE,CAAC1B,QAAQ,EAAEkB,WAAW,CAAC,CAAC;;EAE3B;EACA,MAAMe,sBAAsB,GAAG7D,OAAO,CAAC,OAAO;IAC5C0B,SAAS;IACTE,QAAQ;IACRkC,WAAW,EAAEd,eAAe;IAC5Be,UAAU,EAAEH,cAAc;IAC1BI,eAAe,EAAE,eAAe;IAChCC,cAAc,EAAE,WAAW;IAC3BC,kBAAkB,EAAE,wBAAwB;IAC5CC,iBAAiB,EAAE,kBAAkB;IACrCC,gBAAgB,EAAE,SAAS;IAC3BC,eAAe,EAAE,SAAS;IAC1BC,sBAAsB,EAAE,SAAS;IACjCC,qBAAqB,EAAE;EACzB,CAAC,CAAC,EAAE,CAAC7C,SAAS,EAAEE,QAAQ,EAAEoB,eAAe,EAAEY,cAAc,CAAC,CAAC;;EAE3D;EACA,MAAMY,kBAAkB,GAAGxE,OAAO,CAAC,OAAO;IACxCyE,SAAS,EAAE7C,QAAQ;IACnBC,KAAK;IACL6C,WAAW,EAAE9B,eAAe;IAC5B+B,UAAU,EAAE,YAAY;IACxBC,YAAY,EAAE,yBAAyB;IAAE;IACzCC,WAAW,EAAE,yBAAyB;
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","useCallback","View","StyleSheet","GestureHandlerRootView","useBalloonBlasterStore","createBalloonBlasterService","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useAnimationTrackers","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","jsx","_jsx","jsxs","_jsxs","BalloonBlaster","memo","settings","onSettingsChange","isPlaying","state","gameOver","score","startGame","stopGame","resetGame","decrementTime","addBalloon","removeBalloon","updateBalloon","balloonAnimations","particleAnimations","wrapFunction","safeExecute","BALLOON_BLASTER","spawnBalloon","balloon","handleResetGame","UNKNOWN_ERROR","gameService","INITIALIZATION_ERROR","handleStartGame","currentBalloons","getState","balloons","forEach","id","cleanup","resetAnimations","setTimeout","startGameTimer","startBalloonSpawning","startPhysicsLoop","handleStopGame","gameControlButtonProps","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","buttonTextColor","gameSettingsModalProps","gameId","offset","style","styles","container","children","create","flex"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlaster.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAC9D,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,sBAAsB,QAAQ,0BAAuB;AAC9D,SAASC,2BAA2B,QAAQ,4BAAyB;AACrE,SAASC,UAAU,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,uBAAc;AACnE,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,wBAAe;AAC1H,SAASC,iBAAiB,QAAQ,wBAAe;AACjD,SAASC,QAAQ,EAAkBC,qBAAqB,QAAQ,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE9F,OAAO,MAAMC,cAAmC,gBAAGxB,KAAK,CAACyB,IAAI,CAAC,CAAC;EAC7DC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ;EACA,MAAMC,SAAS,GAAGrB,sBAAsB,CAACsB,KAAK,IAAIA,KAAK,CAACD,SAAS,CAAC;EAClE,MAAME,QAAQ,GAAGvB,sBAAsB,CAACsB,KAAK,IAAIA,KAAK,CAACC,QAAQ,CAAC;EAChE,MAAMC,KAAK,GAAGxB,sBAAsB,CAACsB,KAAK,IAAIA,KAAK,CAACE,KAAK,CAAC;;EAE1D;EACA,MAA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
|
-
MAX_LIVES: 3,
|
|
8
|
-
BALLOON_SPAWN_INTERVAL: 800,
|
|
9
|
-
// ms - much faster balloon spawning
|
|
10
|
-
BALLOON_RISE_SPEED: 0.08,
|
|
11
|
-
// pixels per frame - balloons rise from bottom to top (slightly faster)
|
|
12
|
-
GRAVITY: -0.003,
|
|
13
|
-
// negative gravity for upward movement (slightly stronger)
|
|
14
|
-
INITIAL_VELOCITY_Y: -0.2,
|
|
15
|
-
// negative for upward movement (slower rise from bottom)
|
|
16
|
-
INITIAL_VELOCITY_X_RANGE: 0.3,
|
|
17
|
-
// horizontal velocity range (increased for better spread across screen)
|
|
18
|
-
ROTATION_SPEED_RANGE: 0.02,
|
|
19
|
-
// realistic balloon rotation speed (reduced from 0.2 for more natural movement)
|
|
20
|
-
BALLOON_SIZE: 60,
|
|
21
|
-
SLICE_TRAIL_LENGTH: 10,
|
|
22
|
-
COMBO_TIMEOUT: 2000,
|
|
23
|
-
// ms
|
|
24
|
-
PARTICLE_COUNT: 4,
|
|
25
|
-
// Reduced from 8 to 4 for better performance
|
|
26
|
-
PARTICLE_LIFETIME: 600 // Reduced from 1000ms to 600ms for faster cleanup
|
|
27
|
-
};
|
|
28
|
-
export const BALLOON_BLASTER_ANIMATION_CONFIG = {
|
|
29
|
-
BALLOON_SPRING: {
|
|
30
|
-
damping: 30,
|
|
31
|
-
stiffness: 50
|
|
32
|
-
},
|
|
33
|
-
POP_SPRING: {
|
|
34
|
-
damping: 20,
|
|
35
|
-
stiffness: 300
|
|
36
|
-
},
|
|
37
|
-
PARTICLE_SPRING: {
|
|
38
|
-
damping: 25,
|
|
39
|
-
stiffness: 400
|
|
40
|
-
},
|
|
41
|
-
SLICE_TIMING: {
|
|
42
|
-
duration: 200
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
export const BALLOON_BLASTER_COLORS = {
|
|
46
|
-
BACKGROUND: '#87CEEB',
|
|
47
|
-
// Sky blue
|
|
48
|
-
SCORE_BOARD: '#4169E1',
|
|
49
|
-
SLICE_TRAIL: '#FFD700',
|
|
50
|
-
PARTICLE_COLORS: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD'],
|
|
51
|
-
COMBO_TEXT: '#FF4757',
|
|
52
|
-
LIVES_COLOR: '#FF6B6B',
|
|
53
|
-
PARTICLE_GLOW: 'rgba(255,255,255,0.9)',
|
|
54
|
-
SCORE: '#FFFFFF',
|
|
55
|
-
UI: '#FF6347',
|
|
56
|
-
BUTTON_ACTIVE: '#FF7F50',
|
|
57
|
-
BUTTON_INACTIVE: '#FFA07A',
|
|
58
|
-
TEXT_PRIMARY: '#FFFFFF',
|
|
59
|
-
TEXT_SECONDARY: '#F0F8FF',
|
|
60
|
-
WHITE: '#FFFFFF',
|
|
61
|
-
START_BUTTON: '#4CAF50',
|
|
62
|
-
GAME_OVER_OVERLAY: 'rgba(0, 0, 0, 0.85)'
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// Balloon types and their properties
|
|
66
|
-
export const BALLOON_TYPES = [{
|
|
67
|
-
emoji: '🎈',
|
|
68
|
-
points: 10,
|
|
69
|
-
name: 'red balloon',
|
|
70
|
-
color: '#FF0040',
|
|
71
|
-
gradient: ['#FF0040', '#FF4080']
|
|
72
|
-
}, {
|
|
73
|
-
emoji: '🎈',
|
|
74
|
-
points: 10,
|
|
75
|
-
name: 'blue balloon',
|
|
76
|
-
color: '#0080FF',
|
|
77
|
-
gradient: ['#0080FF', '#40A0FF']
|
|
78
|
-
}, {
|
|
79
|
-
emoji: '🎈',
|
|
80
|
-
points: 15,
|
|
81
|
-
name: 'yellow balloon',
|
|
82
|
-
color: '#FFD700',
|
|
83
|
-
gradient: ['#FFD700', '#FFEB3B']
|
|
84
|
-
}, {
|
|
85
|
-
emoji: '🎈',
|
|
86
|
-
points: 20,
|
|
87
|
-
name: 'green balloon',
|
|
88
|
-
color: '#00FF80',
|
|
89
|
-
gradient: ['#00FF80', '#40FFA0']
|
|
90
|
-
}, {
|
|
91
|
-
emoji: '🎈',
|
|
92
|
-
points: 25,
|
|
93
|
-
name: 'purple balloon',
|
|
94
|
-
color: '#8000FF',
|
|
95
|
-
gradient: ['#8000FF', '#A040FF']
|
|
96
|
-
}, {
|
|
97
|
-
emoji: '🎈',
|
|
98
|
-
points: 15,
|
|
99
|
-
name: 'pink balloon',
|
|
100
|
-
color: '#FF0080',
|
|
101
|
-
gradient: ['#FF0080', '#FF40A0']
|
|
102
|
-
}, {
|
|
103
|
-
emoji: '🎈',
|
|
104
|
-
points: 30,
|
|
105
|
-
name: 'orange balloon',
|
|
106
|
-
color: '#FF4000',
|
|
107
|
-
gradient: ['#FF4000', '#FF8040']
|
|
108
|
-
}, {
|
|
109
|
-
emoji: '🎈',
|
|
110
|
-
points: 25,
|
|
111
|
-
name: 'cyan balloon',
|
|
112
|
-
color: '#00FFFF',
|
|
113
|
-
gradient: ['#00FFFF', '#40FFFF']
|
|
114
|
-
}, {
|
|
115
|
-
emoji: '🎈',
|
|
116
|
-
points: 35,
|
|
117
|
-
name: 'magenta balloon',
|
|
118
|
-
color: '#FF00FF',
|
|
119
|
-
gradient: ['#FF00FF', '#FF40FF']
|
|
120
|
-
}, {
|
|
121
|
-
emoji: '🎈',
|
|
122
|
-
points: 40,
|
|
123
|
-
name: 'gold balloon',
|
|
124
|
-
color: '#FFB000',
|
|
125
|
-
gradient: ['#FFB000', '#FFD700']
|
|
126
|
-
}, {
|
|
127
|
-
emoji: '🎈',
|
|
128
|
-
points: 45,
|
|
129
|
-
name: 'rainbow balloon',
|
|
130
|
-
color: '#FF0080',
|
|
131
|
-
gradient: ['#FF0080', '#8000FF', '#0080FF', '#00FF80']
|
|
132
|
-
}, {
|
|
133
|
-
emoji: '🎈',
|
|
134
|
-
points: 50,
|
|
135
|
-
name: 'neon balloon',
|
|
136
|
-
color: '#00FF00',
|
|
137
|
-
gradient: ['#00FF00', '#FFFF00']
|
|
138
|
-
}];
|
|
139
|
-
export const BALLOON_SPECIAL_ITEMS = [{
|
|
140
|
-
emoji: '💣',
|
|
141
|
-
points: -50,
|
|
142
|
-
name: 'bomb',
|
|
143
|
-
isBomb: true,
|
|
144
|
-
color: '#FF4444'
|
|
145
|
-
}, {
|
|
146
|
-
emoji: '⭐',
|
|
147
|
-
points: 50,
|
|
148
|
-
name: 'star',
|
|
149
|
-
isBonus: true,
|
|
150
|
-
color: '#FFD700'
|
|
151
|
-
}];
|
|
152
|
-
|
|
153
|
-
// Balloon Blaster Game Theme - Matches scoreboard blue
|
|
154
|
-
export const BALLOON_BLASTER_THEME = {
|
|
155
|
-
backgroundColor: '#87CEEB',
|
|
156
|
-
// Sky blue background
|
|
157
|
-
headerBackgroundColor: 'rgba(59, 130, 246, 0.9)',
|
|
158
|
-
// Blue header to match scoreboard
|
|
159
|
-
headerTextColor: '#ffffff',
|
|
160
|
-
sectionBackgroundColor: 'rgba(59, 130, 246, 0.4)',
|
|
161
|
-
// Match scoreboard transparency
|
|
162
|
-
sectionTitleColor: '#ffffff',
|
|
163
|
-
// White text on blue sections
|
|
164
|
-
buttonSelectedColor: '#3b82f6',
|
|
165
|
-
// Match actual start button blue
|
|
166
|
-
buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
|
|
167
|
-
buttonSelectedTextColor: '#ffffff',
|
|
168
|
-
buttonUnselectedTextColor: '#1f2937',
|
|
169
|
-
switchTrackColorFalse: 'rgba(59, 130, 246, 0.5)',
|
|
170
|
-
switchTrackColorTrue: '#3b82f6',
|
|
171
|
-
// Match actual start button blue
|
|
172
|
-
switchThumbColor: '#ffffff',
|
|
173
|
-
infoTextColor: '#1f2937' // Dark text for readability
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
// Balloon Blaster Difficulty Descriptions
|
|
177
|
-
export const BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS = {
|
|
178
|
-
easy: 'Balloons spawn slower, more forgiving',
|
|
179
|
-
medium: 'Balanced gameplay and balloon speed',
|
|
180
|
-
hard: 'Fast balloons, quick reflexes needed!'
|
|
181
|
-
};
|
|
182
|
-
//# sourceMappingURL=BalloonBlasterConstants.js.map
|
|
1
|
+
"use strict";export const BALLOON_BLASTER_GAME_CONFIG ={GAME_DURATION:120,MAX_LIVES:3,BALLOON_SPAWN_INTERVAL:800,BALLOON_RISE_SPEED:0.08,GRAVITY:-0.003,INITIAL_VELOCITY_Y:-0.2,INITIAL_VELOCITY_X_RANGE:0.3,ROTATION_SPEED_RANGE:0.02,BALLOON_SIZE:60,SLICE_TRAIL_LENGTH:10,COMBO_TIMEOUT:2000,PARTICLE_COUNT:4,PARTICLE_LIFETIME:600};export const BALLOON_BLASTER_ANIMATION_CONFIG ={BALLOON_SPRING:{damping:30,stiffness:50},POP_SPRING:{damping:20,stiffness:300},PARTICLE_SPRING:{damping:25,stiffness:400},SLICE_TIMING:{duration:200}};export const BALLOON_BLASTER_COLORS ={BACKGROUND:'#87CEEB',SCORE_BOARD:'#4169E1',SLICE_TRAIL:'#FFD700',PARTICLE_COLORS:['#FF6B6B','#4ECDC4','#45B7D1','#96CEB4','#FFEAA7','#DDA0DD'],COMBO_TEXT:'#FF4757',LIVES_COLOR:'#FF6B6B',PARTICLE_GLOW:'rgba(255,255,255,0.9)',SCORE:'#FFFFFF',UI:'#FF6347',BUTTON_ACTIVE:'#FF7F50',BUTTON_INACTIVE:'#FFA07A',TEXT_PRIMARY:'#FFFFFF',TEXT_SECONDARY:'#F0F8FF',WHITE:'#FFFFFF',START_BUTTON:'#4CAF50',GAME_OVER_OVERLAY:'rgba(0,0,0,0.85)'};export const BALLOON_TYPES = [{emoji:'🎈',points:10,name:'red balloon',color:'#FF0040',gradient:['#FF0040','#FF4080']},{emoji:'🎈',points:10,name:'blue balloon',color:'#0080FF',gradient:['#0080FF','#40A0FF']},{emoji:'🎈',points:15,name:'yellow balloon',color:'#FFD700',gradient:['#FFD700','#FFEB3B']},{emoji:'🎈',points:20,name:'green balloon',color:'#00FF80',gradient:['#00FF80','#40FFA0']},{emoji:'🎈',points:25,name:'purple balloon',color:'#8000FF',gradient:['#8000FF','#A040FF']},{emoji:'🎈',points:15,name:'pink balloon',color:'#FF0080',gradient:['#FF0080','#FF40A0']},{emoji:'🎈',points:30,name:'orange balloon',color:'#FF4000',gradient:['#FF4000','#FF8040']},{emoji:'🎈',points:25,name:'cyan balloon',color:'#00FFFF',gradient:['#00FFFF','#40FFFF']},{emoji:'🎈',points:35,name:'magenta balloon',color:'#FF00FF',gradient:['#FF00FF','#FF40FF']},{emoji:'🎈',points:40,name:'gold balloon',color:'#FFB000',gradient:['#FFB000','#FFD700']},{emoji:'🎈',points:45,name:'rainbow balloon',color:'#FF0080',gradient:['#FF0080','#8000FF','#0080FF','#00FF80']},{emoji:'🎈',points:50,name:'neon balloon',color:'#00FF00',gradient:['#00FF00','#FFFF00']}];export const BALLOON_SPECIAL_ITEMS = [{emoji:'💣',points:-50,name:'bomb',isBomb:true,color:'#FF4444'},{emoji:'⭐',points:50,name:'star',isBonus:true,color:'#FFD700'}];export const BALLOON_BLASTER_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#3b82f6',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(59,130,246,0.15)',sectionTitleColor:'#3b82f6',buttonSelectedColor:'#3b82f6',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(59,130,246,0.3)',switchTrackColorTrue:'#3b82f6',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS ={easy:'Balloons spawn slower,more forgiving',medium:'Balanced gameplay and balloon speed',hard:'Fast balloons,quick reflexes needed!'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BALLOON_BLASTER_GAME_CONFIG","GAME_DURATION","MAX_LIVES","BALLOON_SPAWN_INTERVAL","BALLOON_RISE_SPEED","GRAVITY","INITIAL_VELOCITY_Y","INITIAL_VELOCITY_X_RANGE","ROTATION_SPEED_RANGE","BALLOON_SIZE","SLICE_TRAIL_LENGTH","COMBO_TIMEOUT","PARTICLE_COUNT","PARTICLE_LIFETIME","BALLOON_BLASTER_ANIMATION_CONFIG","BALLOON_SPRING","damping","stiffness","POP_SPRING","PARTICLE_SPRING","SLICE_TIMING","duration","BALLOON_BLASTER_COLORS","BACKGROUND","SCORE_BOARD","SLICE_TRAIL","PARTICLE_COLORS","COMBO_TEXT","LIVES_COLOR","PARTICLE_GLOW","SCORE","UI","BUTTON_ACTIVE","BUTTON_INACTIVE","TEXT_PRIMARY","TEXT_SECONDARY","WHITE","START_BUTTON","GAME_OVER_OVERLAY","BALLOON_TYPES","emoji","points","name","color","gradient","BALLOON_SPECIAL_ITEMS","isBomb","isBonus","BALLOON_BLASTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlasterConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,2BAA2B,GAAG;EACzCC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"names":["BALLOON_BLASTER_GAME_CONFIG","GAME_DURATION","MAX_LIVES","BALLOON_SPAWN_INTERVAL","BALLOON_RISE_SPEED","GRAVITY","INITIAL_VELOCITY_Y","INITIAL_VELOCITY_X_RANGE","ROTATION_SPEED_RANGE","BALLOON_SIZE","SLICE_TRAIL_LENGTH","COMBO_TIMEOUT","PARTICLE_COUNT","PARTICLE_LIFETIME","BALLOON_BLASTER_ANIMATION_CONFIG","BALLOON_SPRING","damping","stiffness","POP_SPRING","PARTICLE_SPRING","SLICE_TIMING","duration","BALLOON_BLASTER_COLORS","BACKGROUND","SCORE_BOARD","SLICE_TRAIL","PARTICLE_COLORS","COMBO_TEXT","LIVES_COLOR","PARTICLE_GLOW","SCORE","UI","BUTTON_ACTIVE","BUTTON_INACTIVE","TEXT_PRIMARY","TEXT_SECONDARY","WHITE","START_BUTTON","GAME_OVER_OVERLAY","BALLOON_TYPES","emoji","points","name","color","gradient","BALLOON_SPECIAL_ITEMS","isBomb","isBonus","BALLOON_BLASTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlasterConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,2BAA2B,GAAG;EACzCC,aAAa,EAAE,GAAG;EAAE;EACpBC,SAAS,EAAE,CAAC;EACZC,sBAAsB,EAAE,GAAG;EAAE;EAC7BC,kBAAkB,EAAE,IAAI;EAAE;EAC1BC,OAAO,EAAE,CAAC,KAAK;EAAE;EACjBC,kBAAkB,EAAE,CAAC,GAAG;EAAE;EAC1BC,wBAAwB,EAAE,GAAG;EAAE;EAC/BC,oBAAoB,EAAE,IAAI;EAAE;EAC5BC,YAAY,EAAE,EAAE;EAChBC,kBAAkB,EAAE,EAAE;EACtBC,aAAa,EAAE,IAAI;EAAE;EACrBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG,CAAC;AACzB,CAAU;AAEV,OAAO,MAAMC,gCAAgC,GAAG;EAC9CC,cAAc,EAAE;IACdC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDC,UAAU,EAAE;IACVF,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDE,eAAe,EAAE;IACfH,OAAO,EAAE,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