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.
Files changed (212) hide show
  1. package/README.md +58 -7
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -167
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -182
  5. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +1 -318
  7. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +1 -183
  8. package/lib/module/games/balloon-blaster/components/BalloonComponent.js +1 -237
  9. package/lib/module/games/balloon-blaster/components/GameArea.js +1 -156
  10. package/lib/module/games/balloon-blaster/components/GameBackground.js +1 -476
  11. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +1 -112
  12. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
  13. package/lib/module/games/balloon-blaster/components/index.js +1 -7
  14. package/lib/module/games/candy-crush/CandyCrush.js +1 -131
  15. package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
  16. package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
  17. package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
  18. package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
  19. package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
  20. package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
  21. package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
  22. package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
  23. package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
  24. package/lib/module/games/candy-crush/components/index.js +1 -7
  25. package/lib/module/games/candy-crush/index.js +1 -6
  26. package/lib/module/games/colors-sort/ColorsSort.js +1 -143
  27. package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
  28. package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
  29. package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
  30. package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
  31. package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
  32. package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
  33. package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
  34. package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
  35. package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
  36. package/lib/module/games/colors-sort/components/index.js +1 -6
  37. package/lib/module/games/dino-jump/DinoJump.js +1 -209
  38. package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
  39. package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
  40. package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
  41. package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
  42. package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
  43. package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
  44. package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
  45. package/lib/module/games/dino-jump/components/GameArea.js +1 -68
  46. package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
  47. package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
  48. package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
  49. package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
  50. package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
  51. package/lib/module/games/dino-jump/components/index.js +1 -9
  52. package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
  53. package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
  54. package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
  55. package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
  56. package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
  57. package/lib/module/games/flappy-bird/components/Bird.js +1 -87
  58. package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
  59. package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
  60. package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
  61. package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
  62. package/lib/module/games/flappy-bird/components/index.js +1 -8
  63. package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
  64. package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
  65. package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
  66. package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
  67. package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
  68. package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
  69. package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
  70. package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
  71. package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
  72. package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
  73. package/lib/module/games/fruit-merger/components/index.js +1 -7
  74. package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
  75. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  76. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
  77. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
  78. package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
  79. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
  80. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
  81. package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
  82. package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
  83. package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
  84. package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
  85. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
  86. package/lib/module/games/fruit-ninja/components/index.js +1 -7
  87. package/lib/module/games/game-2048/Game2048.js +1 -149
  88. package/lib/module/games/game-2048/Game2048.js.map +1 -1
  89. package/lib/module/games/game-2048/Game2048Constants.js +1 -263
  90. package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
  91. package/lib/module/games/game-2048/Game2048Service.js +1 -457
  92. package/lib/module/games/game-2048/Game2048Store.js +1 -236
  93. package/lib/module/games/game-2048/components/GameBackground.js +1 -247
  94. package/lib/module/games/game-2048/components/GameGrid.js +1 -139
  95. package/lib/module/games/game-2048/components/GameTile.js +1 -72
  96. package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
  97. package/lib/module/games/game-2048/components/index.js +1 -7
  98. package/lib/module/games/maze-runner/MazeRunner.js +1 -267
  99. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  100. package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
  101. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
  102. package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
  103. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
  104. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
  105. package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
  106. package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
  107. package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
  108. package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
  109. package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
  110. package/lib/module/games/maze-runner/components/index.js +1 -8
  111. package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
  112. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  113. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
  114. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
  115. package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
  116. package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
  117. package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
  118. package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
  119. package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
  120. package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
  121. package/lib/module/games/popit-fidget/components/index.js +1 -7
  122. package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
  123. package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
  124. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
  125. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
  126. package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
  127. package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
  128. package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
  129. package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
  130. package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
  131. package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
  132. package/lib/module/games/sliding-numbers/components/index.js +1 -7
  133. package/lib/module/games/snake/Snake.js +1 -189
  134. package/lib/module/games/snake/Snake.js.map +1 -1
  135. package/lib/module/games/snake/SnakeConstants.js +1 -138
  136. package/lib/module/games/snake/SnakeConstants.js.map +1 -1
  137. package/lib/module/games/snake/SnakeService.js +1 -148
  138. package/lib/module/games/snake/SnakeStore.js +1 -182
  139. package/lib/module/games/snake/components/GameBackground.js +1 -221
  140. package/lib/module/games/snake/components/GameGrid.js +1 -153
  141. package/lib/module/games/snake/components/ScoreBoard.js +1 -51
  142. package/lib/module/games/snake/components/index.js +1 -6
  143. package/lib/module/games/snake/index.js +1 -6
  144. package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
  145. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  146. package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
  147. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
  148. package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
  149. package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
  150. package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
  151. package/lib/module/games/space-fighter/components/GameArea.js +1 -289
  152. package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
  153. package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
  154. package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
  155. package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
  156. package/lib/module/games/space-fighter/components/index.js +1 -9
  157. package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
  158. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  159. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
  160. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
  161. package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
  162. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
  163. package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
  164. package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
  165. package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
  166. package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
  167. package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
  168. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
  169. package/lib/module/games/whack-a-mole/components/index.js +1 -8
  170. package/lib/module/helpers/AnimationFrame.js +1 -120
  171. package/lib/module/helpers/AnimationTracker.js +1 -89
  172. package/lib/module/helpers/ErrorHandler.js +1 -269
  173. package/lib/module/helpers/GameControlButton.js +1 -219
  174. package/lib/module/helpers/GameOverModal.js +1 -144
  175. package/lib/module/helpers/GameOverModal.js.map +1 -1
  176. package/lib/module/helpers/GameSettingsModal.js +1 -287
  177. package/lib/module/helpers/ParticleBlast.js +1 -134
  178. package/lib/module/helpers/ScoreBoardContainer.js +1 -34
  179. package/lib/module/helpers/index.js +1 -12
  180. package/lib/module/index.js +1 -22
  181. package/lib/module/services/GamesConstants.js +1 -178
  182. package/lib/module/services/GamesService.js +1 -112
  183. package/lib/module/services/GamesService.js.map +1 -1
  184. package/lib/module/services/HapticsService.js +1 -77
  185. package/lib/module/services/SoundsService.js +1 -302
  186. package/lib/module/services/UtilsService.js +1 -32
  187. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  188. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +1 -1
  189. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  190. package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
  191. package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
  192. package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
  193. package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
  194. package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
  195. package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
  196. package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
  197. package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
  198. package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
  199. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  200. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
  201. package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
  202. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  203. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  204. package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
  205. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  206. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  207. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
  208. package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
  209. package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
  210. package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
  211. package/lib/typescript/src/services/GamesConstants.d.ts +7 -7
  212. package/package.json +2 -2
@@ -1,476 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { Dimensions, View } from 'react-native';
5
- import { Canvas, LinearGradient, Rect, Circle, Path, Skia, vec, Group, Shadow } 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 GameBackground = /*#__PURE__*/React.memo(({
12
- children,
13
- offset = 0
14
- }) => {
15
- // Adjust sun and cloud positions based on offset
16
- const sunY = height * 0.18 + offset * 0.9;
17
- const cloud1Y = height * 0.29 + offset * 0.9;
18
- const cloud2Y = height * 0.3 + offset * 0.9;
19
- const cloud3Y = height * 0.23 + offset * 0.9;
20
-
21
- // Static background - all animations removed for better performance
22
- return /*#__PURE__*/_jsxs(View, {
23
- style: {
24
- flex: 1
25
- },
26
- children: [/*#__PURE__*/_jsxs(Canvas, {
27
- style: {
28
- position: 'absolute',
29
- top: 0,
30
- left: 0,
31
- right: 0,
32
- bottom: 0,
33
- width,
34
- height
35
- },
36
- children: [/*#__PURE__*/_jsx(Rect, {
37
- x: 0,
38
- y: 0,
39
- width: width,
40
- height: height,
41
- children: /*#__PURE__*/_jsx(LinearGradient, {
42
- start: vec(0, 0),
43
- end: vec(0, height),
44
- colors: ['#87CEEB', '#B0E0E6', '#E0F6FF', '#F0F8FF', '#FFF8DC']
45
- })
46
- }), /*#__PURE__*/_jsxs(Group, {
47
- children: [/*#__PURE__*/_jsxs(Circle, {
48
- cx: width * 0.8,
49
- cy: sunY,
50
- r: 40,
51
- children: [/*#__PURE__*/_jsx(LinearGradient, {
52
- start: vec(-40, -40),
53
- end: vec(40, 40),
54
- colors: ['#FFFF99', '#FFD700', '#FFA500', '#FF8C00']
55
- }), /*#__PURE__*/_jsx(Shadow, {
56
- dx: 0,
57
- dy: 0,
58
- blur: 30,
59
- color: "#FFD700"
60
- })]
61
- }), /*#__PURE__*/_jsx(Circle, {
62
- cx: width * 0.8 - 8,
63
- cy: sunY - 8,
64
- r: 15,
65
- children: /*#__PURE__*/_jsx(LinearGradient, {
66
- start: vec(-15, -15),
67
- end: vec(15, 15),
68
- colors: ['#FFFFFF', '#FFFF99']
69
- })
70
- }), Array.from({
71
- length: 16
72
- }, (_, index) => {
73
- const angle = 360 / 16 * index;
74
- const radian = angle * Math.PI / 180;
75
- const isLongRay = index % 2 === 0;
76
- const rayLength = isLongRay ? 25 : 15;
77
- const rayWidth = isLongRay ? 4 : 2;
78
- const startDistance = 45;
79
- const startX = width * 0.8 + Math.cos(radian) * startDistance;
80
- const startY = sunY + Math.sin(radian) * startDistance;
81
- const endX = width * 0.8 + Math.cos(radian) * (startDistance + rayLength);
82
- const endY = sunY + Math.sin(radian) * (startDistance + rayLength);
83
- const rayPath = Skia.Path.Make();
84
- rayPath.moveTo(startX, startY);
85
- rayPath.lineTo(endX, endY);
86
- return /*#__PURE__*/_jsx(Path, {
87
- path: rayPath,
88
- style: "stroke",
89
- strokeWidth: rayWidth,
90
- color: "#FFD700",
91
- opacity: 0.75
92
- }, index);
93
- }), /*#__PURE__*/_jsx(Circle, {
94
- cx: width * 0.8,
95
- cy: sunY,
96
- r: 60,
97
- opacity: 0.1,
98
- children: /*#__PURE__*/_jsx(LinearGradient, {
99
- start: vec(-60, -60),
100
- end: vec(60, 60),
101
- colors: ['#FFD700', 'transparent']
102
- })
103
- })]
104
- }), /*#__PURE__*/_jsxs(Group, {
105
- children: [/*#__PURE__*/_jsxs(Group, {
106
- children: [/*#__PURE__*/_jsx(Circle, {
107
- cx: width * 0.12,
108
- cy: cloud1Y,
109
- r: 16,
110
- color: "#F0F8FF",
111
- opacity: 0.35,
112
- children: /*#__PURE__*/_jsx(Shadow, {
113
- dx: 1,
114
- dy: 2,
115
- blur: 12,
116
- color: "rgba(0,0,0,0.05)"
117
- })
118
- }), /*#__PURE__*/_jsx(Circle, {
119
- cx: width * 0.18,
120
- cy: cloud1Y - (height * 0.24 - height * 0.21),
121
- r: 22,
122
- color: "#FFFFFF",
123
- opacity: 0.45,
124
- children: /*#__PURE__*/_jsx(Shadow, {
125
- dx: 1,
126
- dy: 2,
127
- blur: 12,
128
- color: "rgba(0,0,0,0.05)"
129
- })
130
- }), /*#__PURE__*/_jsx(Circle, {
131
- cx: width * 0.25,
132
- cy: cloud1Y - (height * 0.24 - height * 0.19),
133
- r: 26,
134
- color: "#F8F8FF",
135
- opacity: 0.55,
136
- children: /*#__PURE__*/_jsx(Shadow, {
137
- dx: 2,
138
- dy: 3,
139
- blur: 12,
140
- color: "rgba(0,0,0,0.06)"
141
- })
142
- }), /*#__PURE__*/_jsx(Circle, {
143
- cx: width * 0.32,
144
- cy: cloud1Y - (height * 0.24 - height * 0.21),
145
- r: 20,
146
- color: "#FFFFFF",
147
- opacity: 0.50,
148
- children: /*#__PURE__*/_jsx(Shadow, {
149
- dx: 1,
150
- dy: 2,
151
- blur: 12,
152
- color: "rgba(0,0,0,0.05)"
153
- })
154
- }), /*#__PURE__*/_jsx(Circle, {
155
- cx: width * 0.37,
156
- cy: cloud1Y,
157
- r: 14,
158
- color: "#F0F8FF",
159
- opacity: 0.40,
160
- children: /*#__PURE__*/_jsx(Shadow, {
161
- dx: 1,
162
- dy: 2,
163
- blur: 12,
164
- color: "rgba(0,0,0,0.04)"
165
- })
166
- })]
167
- }), /*#__PURE__*/_jsxs(Group, {
168
- children: [/*#__PURE__*/_jsx(Circle, {
169
- cx: width * 0.62,
170
- cy: cloud2Y,
171
- r: 15,
172
- color: "#F0F8FF",
173
- opacity: 0.40,
174
- children: /*#__PURE__*/_jsx(Shadow, {
175
- dx: 1,
176
- dy: 2,
177
- blur: 10,
178
- color: "rgba(0,0,0,0.04)"
179
- })
180
- }), /*#__PURE__*/_jsx(Circle, {
181
- cx: width * 0.69,
182
- cy: cloud2Y - (height * 0.27 - height * 0.24),
183
- r: 19,
184
- color: "#FFFFFF",
185
- opacity: 0.50,
186
- children: /*#__PURE__*/_jsx(Shadow, {
187
- dx: 1,
188
- dy: 2,
189
- blur: 10,
190
- color: "rgba(0,0,0,0.05)"
191
- })
192
- }), /*#__PURE__*/_jsx(Circle, {
193
- cx: width * 0.76,
194
- cy: cloud2Y - (height * 0.27 - height * 0.26),
195
- r: 13,
196
- color: "#F8F8FF",
197
- opacity: 0.45,
198
- children: /*#__PURE__*/_jsx(Shadow, {
199
- dx: 1,
200
- dy: 2,
201
- blur: 10,
202
- color: "rgba(0,0,0,0.04)"
203
- })
204
- })]
205
- }), /*#__PURE__*/_jsxs(Group, {
206
- children: [/*#__PURE__*/_jsx(Circle, {
207
- cx: width * 0.84,
208
- cy: cloud3Y,
209
- r: 10,
210
- color: "#F0F8FF",
211
- opacity: 0.35,
212
- children: /*#__PURE__*/_jsx(Shadow, {
213
- dx: 0,
214
- dy: 1,
215
- blur: 6,
216
- color: "rgba(0,0,0,0.03)"
217
- })
218
- }), /*#__PURE__*/_jsx(Circle, {
219
- cx: width * 0.89,
220
- cy: cloud3Y - (height * 0.19 - height * 0.17),
221
- r: 12,
222
- color: "#FFFFFF",
223
- opacity: 0.40,
224
- children: /*#__PURE__*/_jsx(Shadow, {
225
- dx: 0,
226
- dy: 1,
227
- blur: 6,
228
- color: "rgba(0,0,0,0.03)"
229
- })
230
- }), /*#__PURE__*/_jsx(Circle, {
231
- cx: width * 0.93,
232
- cy: cloud3Y,
233
- r: 8,
234
- color: "#F8F8FF",
235
- opacity: 0.30,
236
- children: /*#__PURE__*/_jsx(Shadow, {
237
- dx: 0,
238
- dy: 1,
239
- blur: 6,
240
- color: "rgba(0,0,0,0.02)"
241
- })
242
- })]
243
- })]
244
- }), /*#__PURE__*/_jsxs(Group, {
245
- children: [/*#__PURE__*/_jsxs(Group, {
246
- children: [/*#__PURE__*/_jsx(Circle, {
247
- cx: width * 0.15,
248
- cy: height * 0.35,
249
- r: 12,
250
- color: "#FF6B6B",
251
- opacity: 0.3,
252
- children: /*#__PURE__*/_jsx(Shadow, {
253
- dx: 2,
254
- dy: 2,
255
- blur: 8,
256
- color: "rgba(0,0,0,0.1)"
257
- })
258
- }), /*#__PURE__*/_jsx(Rect, {
259
- x: width * 0.15 - 0.5,
260
- y: height * 0.35 + 12,
261
- width: 1,
262
- height: 15,
263
- color: "#8B4513",
264
- opacity: 0.4
265
- }), /*#__PURE__*/_jsx(Circle, {
266
- cx: width * 0.20,
267
- cy: height * 0.32,
268
- r: 10,
269
- color: "#4ECDC4",
270
- opacity: 0.3,
271
- children: /*#__PURE__*/_jsx(Shadow, {
272
- dx: 2,
273
- dy: 2,
274
- blur: 6,
275
- color: "rgba(0,0,0,0.1)"
276
- })
277
- }), /*#__PURE__*/_jsx(Rect, {
278
- x: width * 0.20 - 0.5,
279
- y: height * 0.32 + 10,
280
- width: 1,
281
- height: 12,
282
- color: "#8B4513",
283
- opacity: 0.4
284
- }), /*#__PURE__*/_jsx(Circle, {
285
- cx: width * 0.12,
286
- cy: height * 0.38,
287
- r: 11,
288
- color: "#FFEAA7",
289
- opacity: 0.3,
290
- children: /*#__PURE__*/_jsx(Shadow, {
291
- dx: 2,
292
- dy: 2,
293
- blur: 7,
294
- color: "rgba(0,0,0,0.1)"
295
- })
296
- }), /*#__PURE__*/_jsx(Rect, {
297
- x: width * 0.12 - 0.5,
298
- y: height * 0.38 + 11,
299
- width: 1,
300
- height: 13,
301
- color: "#8B4513",
302
- opacity: 0.4
303
- })]
304
- }), /*#__PURE__*/_jsxs(Group, {
305
- children: [/*#__PURE__*/_jsx(Circle, {
306
- cx: width * 0.45,
307
- cy: height * 0.28,
308
- r: 9,
309
- color: "#DDA0DD",
310
- opacity: 0.25,
311
- children: /*#__PURE__*/_jsx(Shadow, {
312
- dx: 1,
313
- dy: 2,
314
- blur: 5,
315
- color: "rgba(0,0,0,0.08)"
316
- })
317
- }), /*#__PURE__*/_jsx(Rect, {
318
- x: width * 0.45 - 0.5,
319
- y: height * 0.28 + 9,
320
- width: 1,
321
- height: 10,
322
- color: "#8B4513",
323
- opacity: 0.3
324
- }), /*#__PURE__*/_jsx(Circle, {
325
- cx: width * 0.50,
326
- cy: height * 0.31,
327
- r: 8,
328
- color: "#96CEB4",
329
- opacity: 0.25,
330
- children: /*#__PURE__*/_jsx(Shadow, {
331
- dx: 1,
332
- dy: 2,
333
- blur: 4,
334
- color: "rgba(0,0,0,0.08)"
335
- })
336
- }), /*#__PURE__*/_jsx(Rect, {
337
- x: width * 0.50 - 0.5,
338
- y: height * 0.31 + 8,
339
- width: 1,
340
- height: 9,
341
- color: "#8B4513",
342
- opacity: 0.3
343
- })]
344
- }), /*#__PURE__*/_jsxs(Group, {
345
- children: [/*#__PURE__*/_jsx(Circle, {
346
- cx: width * 0.75,
347
- cy: height * 0.33,
348
- r: 7,
349
- color: "#FFB6C1",
350
- opacity: 0.2,
351
- children: /*#__PURE__*/_jsx(Shadow, {
352
- dx: 1,
353
- dy: 1,
354
- blur: 3,
355
- color: "rgba(0,0,0,0.06)"
356
- })
357
- }), /*#__PURE__*/_jsx(Rect, {
358
- x: width * 0.75 - 0.5,
359
- y: height * 0.33 + 7,
360
- width: 1,
361
- height: 8,
362
- color: "#8B4513",
363
- opacity: 0.25
364
- }), /*#__PURE__*/_jsx(Circle, {
365
- cx: width * 0.80,
366
- cy: height * 0.30,
367
- r: 6,
368
- color: "#FFA500",
369
- opacity: 0.2,
370
- children: /*#__PURE__*/_jsx(Shadow, {
371
- dx: 1,
372
- dy: 1,
373
- blur: 3,
374
- color: "rgba(0,0,0,0.06)"
375
- })
376
- }), /*#__PURE__*/_jsx(Rect, {
377
- x: width * 0.80 - 0.5,
378
- y: height * 0.30 + 6,
379
- width: 1,
380
- height: 7,
381
- color: "#8B4513",
382
- opacity: 0.25
383
- })]
384
- }), /*#__PURE__*/_jsxs(Group, {
385
- children: [/*#__PURE__*/_jsx(Circle, {
386
- cx: width * 0.85,
387
- cy: height * 0.20,
388
- r: 4,
389
- color: "#FF1493",
390
- opacity: 0.15
391
- }), /*#__PURE__*/_jsx(Rect, {
392
- x: width * 0.85 - 0.25,
393
- y: height * 0.20 + 4,
394
- width: 0.5,
395
- height: 5,
396
- color: "#8B4513",
397
- opacity: 0.2
398
- }), /*#__PURE__*/_jsx(Circle, {
399
- cx: width * 0.25,
400
- cy: height * 0.25,
401
- r: 3,
402
- color: "#00CED1",
403
- opacity: 0.15
404
- }), /*#__PURE__*/_jsx(Rect, {
405
- x: width * 0.25 - 0.25,
406
- y: height * 0.25 + 3,
407
- width: 0.5,
408
- height: 4,
409
- color: "#8B4513",
410
- opacity: 0.2
411
- }), /*#__PURE__*/_jsx(Circle, {
412
- cx: width * 0.65,
413
- cy: height * 0.22,
414
- r: 3.5,
415
- color: "#FFD700",
416
- opacity: 0.15
417
- }), /*#__PURE__*/_jsx(Rect, {
418
- x: width * 0.65 - 0.25,
419
- y: height * 0.22 + 3.5,
420
- width: 0.5,
421
- height: 4.5,
422
- color: "#8B4513",
423
- opacity: 0.2
424
- })]
425
- })]
426
- }), /*#__PURE__*/_jsxs(Group, {
427
- children: [Array.from({
428
- length: 15
429
- }, (_, i) => {
430
- const x = width / 15 * i + i % 3 * 20;
431
- const y = height * 0.15 + i % 5 * (height * 0.1);
432
- const colors = ['#FF6B6B', '#4ECDC4', '#FFEAA7', '#DDA0DD', '#96CEB4', '#FFB6C1'];
433
- const color = colors[i % colors.length];
434
- const size = 2 + i % 3;
435
- return /*#__PURE__*/_jsx(Circle, {
436
- cx: x,
437
- cy: y,
438
- r: size,
439
- color: color,
440
- opacity: 0.3
441
- }, `confetti-${i}`);
442
- }), Array.from({
443
- length: 8
444
- }, (_, i) => {
445
- const startX = width / 8 * i;
446
- const startY = height * 0.05;
447
- const endX = startX + 30 + i % 2 * 20;
448
- const endY = height * 0.15;
449
- const colors = ['#FF6B6B', '#4ECDC4', '#FFEAA7', '#DDA0DD'];
450
- const color = colors[i % colors.length];
451
- const streamerPath = Skia.Path.Make();
452
- streamerPath.moveTo(startX, startY);
453
- streamerPath.quadTo(startX + 15, startY + 20, endX, endY);
454
- return /*#__PURE__*/_jsx(Path, {
455
- path: streamerPath,
456
- style: "stroke",
457
- strokeWidth: 3,
458
- color: color,
459
- opacity: 0.4
460
- }, `streamer-${i}`);
461
- })]
462
- }), /*#__PURE__*/_jsx(Rect, {
463
- x: 0,
464
- y: height * 0.85,
465
- width: width,
466
- height: height * 0.15,
467
- children: /*#__PURE__*/_jsx(LinearGradient, {
468
- start: vec(0, height * 0.85),
469
- end: vec(0, height),
470
- colors: ['#F0F8FF', '#E6F3FF', '#DDE9FF']
471
- })
472
- })]
473
- }), children]
474
- });
475
- });
476
- //# sourceMappingURL=GameBackground.js.map
1
+ "use strict";import React from 'react';import{Dimensions,View}from 'react-native';import{Canvas,LinearGradient,Rect,Circle,Path,Skia,vec,Group,Shadow}from '@shopify/react-native-skia';import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const{width,height}= Dimensions.get('window');export const GameBackground = React.memo(({children,offset = 0})=>{const sunY = height * 0.18 + offset * 0.9;const cloud1Y = height * 0.29 + offset * 0.9;const cloud2Y = height * 0.3 + offset * 0.9;const cloud3Y = height * 0.23 + offset * 0.9;return _jsxs(View,{style:{flex:1},children:[_jsxs(Canvas,{style:{position:'absolute',top:0,left:0,right:0,bottom:0,width,height},children:[_jsx(Rect,{x:0,y:0,width:width,height:height,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(0,height),colors:['#87CEEB','#B0E0E6','#E0F6FF','#F0F8FF','#FFF8DC']})}),_jsxs(Group,{children:[_jsxs(Circle,{cx:width * 0.8,cy:sunY,r:40,children:[_jsx(LinearGradient,{start:vec(-40,-40),end:vec(40,40),colors:['#FFFF99','#FFD700','#FFA500','#FF8C00']}),_jsx(Shadow,{dx:0,dy:0,blur:30,color:"#FFD700"})]}),_jsx(Circle,{cx:width * 0.8 - 8,cy:sunY - 8,r:15,children:_jsx(LinearGradient,{start:vec(-15,-15),end:vec(15,15),colors:['#FFFFFF','#FFFF99']})}),Array.from({length:16},(_,index)=>{const angle = 360 / 16 * index;const radian = angle * Math.PI / 180;const isLongRay = index % 2 === 0;const rayLength = isLongRay ? 25:15;const rayWidth = isLongRay ? 4:2;const startDistance = 45;const startX = width * 0.8 + Math.cos(radian)* startDistance;const startY = sunY + Math.sin(radian)* startDistance;const endX = width * 0.8 + Math.cos(radian)*(startDistance + rayLength);const endY = sunY + Math.sin(radian)*(startDistance + rayLength);const rayPath = Skia.Path.Make();rayPath.moveTo(startX,startY);rayPath.lineTo(endX,endY);return _jsx(Path,{path:rayPath,style:"stroke",strokeWidth:rayWidth,color:"#FFD700",opacity:0.75},index);}),_jsx(Circle,{cx:width * 0.8,cy:sunY,r:60,opacity:0.1,children:_jsx(LinearGradient,{start:vec(-60,-60),end:vec(60,60),colors:['#FFD700','transparent']})})]}),_jsxs(Group,{children:[_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.12,cy:cloud1Y,r:16,color:"#F0F8FF",opacity:0.35,children:_jsx(Shadow,{dx:1,dy:2,blur:12,color:"rgba(0,0,0,0.05)"})}),_jsx(Circle,{cx:width * 0.18,cy:cloud1Y -(height * 0.24 - height * 0.21),r:22,color:"#FFFFFF",opacity:0.45,children:_jsx(Shadow,{dx:1,dy:2,blur:12,color:"rgba(0,0,0,0.05)"})}),_jsx(Circle,{cx:width * 0.25,cy:cloud1Y -(height * 0.24 - height * 0.19),r:26,color:"#F8F8FF",opacity:0.55,children:_jsx(Shadow,{dx:2,dy:3,blur:12,color:"rgba(0,0,0,0.06)"})}),_jsx(Circle,{cx:width * 0.32,cy:cloud1Y -(height * 0.24 - height * 0.21),r:20,color:"#FFFFFF",opacity:0.50,children:_jsx(Shadow,{dx:1,dy:2,blur:12,color:"rgba(0,0,0,0.05)"})}),_jsx(Circle,{cx:width * 0.37,cy:cloud1Y,r:14,color:"#F0F8FF",opacity:0.40,children:_jsx(Shadow,{dx:1,dy:2,blur:12,color:"rgba(0,0,0,0.04)"})})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.62,cy:cloud2Y,r:15,color:"#F0F8FF",opacity:0.40,children:_jsx(Shadow,{dx:1,dy:2,blur:10,color:"rgba(0,0,0,0.04)"})}),_jsx(Circle,{cx:width * 0.69,cy:cloud2Y -(height * 0.27 - height * 0.24),r:19,color:"#FFFFFF",opacity:0.50,children:_jsx(Shadow,{dx:1,dy:2,blur:10,color:"rgba(0,0,0,0.05)"})}),_jsx(Circle,{cx:width * 0.76,cy:cloud2Y -(height * 0.27 - height * 0.26),r:13,color:"#F8F8FF",opacity:0.45,children:_jsx(Shadow,{dx:1,dy:2,blur:10,color:"rgba(0,0,0,0.04)"})})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.84,cy:cloud3Y,r:10,color:"#F0F8FF",opacity:0.35,children:_jsx(Shadow,{dx:0,dy:1,blur:6,color:"rgba(0,0,0,0.03)"})}),_jsx(Circle,{cx:width * 0.89,cy:cloud3Y -(height * 0.19 - height * 0.17),r:12,color:"#FFFFFF",opacity:0.40,children:_jsx(Shadow,{dx:0,dy:1,blur:6,color:"rgba(0,0,0,0.03)"})}),_jsx(Circle,{cx:width * 0.93,cy:cloud3Y,r:8,color:"#F8F8FF",opacity:0.30,children:_jsx(Shadow,{dx:0,dy:1,blur:6,color:"rgba(0,0,0,0.02)"})})]})]}),_jsxs(Group,{children:[_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.15,cy:height * 0.35,r:12,color:"#FF6B6B",opacity:0.3,children:_jsx(Shadow,{dx:2,dy:2,blur:8,color:"rgba(0,0,0,0.1)"})}),_jsx(Rect,{x:width * 0.15 - 0.5,y:height * 0.35 + 12,width:1,height:15,color:"#8B4513",opacity:0.4}),_jsx(Circle,{cx:width * 0.20,cy:height * 0.32,r:10,color:"#4ECDC4",opacity:0.3,children:_jsx(Shadow,{dx:2,dy:2,blur:6,color:"rgba(0,0,0,0.1)"})}),_jsx(Rect,{x:width * 0.20 - 0.5,y:height * 0.32 + 10,width:1,height:12,color:"#8B4513",opacity:0.4}),_jsx(Circle,{cx:width * 0.12,cy:height * 0.38,r:11,color:"#FFEAA7",opacity:0.3,children:_jsx(Shadow,{dx:2,dy:2,blur:7,color:"rgba(0,0,0,0.1)"})}),_jsx(Rect,{x:width * 0.12 - 0.5,y:height * 0.38 + 11,width:1,height:13,color:"#8B4513",opacity:0.4})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.45,cy:height * 0.28,r:9,color:"#DDA0DD",opacity:0.25,children:_jsx(Shadow,{dx:1,dy:2,blur:5,color:"rgba(0,0,0,0.08)"})}),_jsx(Rect,{x:width * 0.45 - 0.5,y:height * 0.28 + 9,width:1,height:10,color:"#8B4513",opacity:0.3}),_jsx(Circle,{cx:width * 0.50,cy:height * 0.31,r:8,color:"#96CEB4",opacity:0.25,children:_jsx(Shadow,{dx:1,dy:2,blur:4,color:"rgba(0,0,0,0.08)"})}),_jsx(Rect,{x:width * 0.50 - 0.5,y:height * 0.31 + 8,width:1,height:9,color:"#8B4513",opacity:0.3})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.75,cy:height * 0.33,r:7,color:"#FFB6C1",opacity:0.2,children:_jsx(Shadow,{dx:1,dy:1,blur:3,color:"rgba(0,0,0,0.06)"})}),_jsx(Rect,{x:width * 0.75 - 0.5,y:height * 0.33 + 7,width:1,height:8,color:"#8B4513",opacity:0.25}),_jsx(Circle,{cx:width * 0.80,cy:height * 0.30,r:6,color:"#FFA500",opacity:0.2,children:_jsx(Shadow,{dx:1,dy:1,blur:3,color:"rgba(0,0,0,0.06)"})}),_jsx(Rect,{x:width * 0.80 - 0.5,y:height * 0.30 + 6,width:1,height:7,color:"#8B4513",opacity:0.25})]}),_jsxs(Group,{children:[_jsx(Circle,{cx:width * 0.85,cy:height * 0.20,r:4,color:"#FF1493",opacity:0.15}),_jsx(Rect,{x:width * 0.85 - 0.25,y:height * 0.20 + 4,width:0.5,height:5,color:"#8B4513",opacity:0.2}),_jsx(Circle,{cx:width * 0.25,cy:height * 0.25,r:3,color:"#00CED1",opacity:0.15}),_jsx(Rect,{x:width * 0.25 - 0.25,y:height * 0.25 + 3,width:0.5,height:4,color:"#8B4513",opacity:0.2}),_jsx(Circle,{cx:width * 0.65,cy:height * 0.22,r:3.5,color:"#FFD700",opacity:0.15}),_jsx(Rect,{x:width * 0.65 - 0.25,y:height * 0.22 + 3.5,width:0.5,height:4.5,color:"#8B4513",opacity:0.2})]})]}),_jsxs(Group,{children:[Array.from({length:15},(_,i)=>{const x = width / 15 * i + i % 3 * 20;const y = height * 0.15 + i % 5 *(height * 0.1);const colors = ['#FF6B6B','#4ECDC4','#FFEAA7','#DDA0DD','#96CEB4','#FFB6C1'];const color = colors[i % colors.length];const size = 2 + i % 3;return _jsx(Circle,{cx:x,cy:y,r:size,color:color,opacity:0.3},`confetti-${i}`);}),Array.from({length:8},(_,i)=>{const startX = width / 8 * i;const startY = height * 0.05;const endX = startX + 30 + i % 2 * 20;const endY = height * 0.15;const colors = ['#FF6B6B','#4ECDC4','#FFEAA7','#DDA0DD'];const color = colors[i % colors.length];const streamerPath = Skia.Path.Make();streamerPath.moveTo(startX,startY);streamerPath.quadTo(startX + 15,startY + 20,endX,endY);return _jsx(Path,{path:streamerPath,style:"stroke",strokeWidth:3,color:color,opacity:0.4},`streamer-${i}`);})]}),_jsx(Rect,{x:0,y:height * 0.85,width:width,height:height * 0.15,children:_jsx(LinearGradient,{start:vec(0,height * 0.85),end:vec(0,height),colors:['#F0F8FF','#E6F3FF','#DDE9FF']})})]}),children]});});
@@ -1,112 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
5
- import { useBalloonBlasterStore } from "../BalloonBlasterStore.js";
6
- import { GAME_CONFIG } from "../BalloonBlasterService.js";
7
- import { ScoreBoardContainer } from "../../../helpers/index.js";
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- export const ScoreBoard = /*#__PURE__*/React.memo(({
10
- offset = 0
11
- }) => {
12
- // Read state directly from store to reduce main component re-renders
13
- const score = useBalloonBlasterStore(state => state.score);
14
- const timeLeft = useBalloonBlasterStore(state => state.timeLeft);
15
- const lives = useBalloonBlasterStore(state => state.lives);
16
- return /*#__PURE__*/_jsx(ScoreBoardContainer, {
17
- offset: offset,
18
- backgroundColor: "rgba(59, 130, 246, 0.4)",
19
- borderColor: "rgba(255, 255, 255, 0.6)",
20
- children: /*#__PURE__*/_jsxs(View, {
21
- style: styles.scoreBoard,
22
- children: [/*#__PURE__*/_jsxs(View, {
23
- style: styles.scoreSection,
24
- children: [/*#__PURE__*/_jsx(Text, {
25
- style: styles.scoreLabel,
26
- children: "Score"
27
- }), /*#__PURE__*/_jsx(Text, {
28
- style: styles.scoreValue,
29
- children: score
30
- })]
31
- }), /*#__PURE__*/_jsxs(View, {
32
- style: styles.scoreSection,
33
- children: [/*#__PURE__*/_jsx(Text, {
34
- style: styles.scoreLabel,
35
- children: "Time"
36
- }), /*#__PURE__*/_jsx(Text, {
37
- style: styles.timeValue,
38
- children: timeLeft
39
- })]
40
- }), /*#__PURE__*/_jsxs(View, {
41
- style: styles.scoreSection,
42
- children: [/*#__PURE__*/_jsx(Text, {
43
- style: styles.scoreLabel,
44
- children: "Lives"
45
- }), /*#__PURE__*/_jsx(View, {
46
- style: styles.livesRow,
47
- children: Array.from({
48
- length: GAME_CONFIG.MAX_LIVES
49
- }).map((_, index) => /*#__PURE__*/_jsx(Text, {
50
- style: [styles.heartIcon, index < lives ? styles.heartActive : styles.heartInactive],
51
- children: "\uD83C\uDF88"
52
- }, index))
53
- })]
54
- })]
55
- })
56
- });
57
- });
58
- const styles = StyleSheet.create({
59
- scoreBoard: {
60
- flexDirection: 'row',
61
- justifyContent: 'space-between',
62
- alignItems: 'center'
63
- },
64
- scoreSection: {
65
- alignItems: 'center',
66
- flex: 1
67
- },
68
- scoreLabel: {
69
- fontSize: 18,
70
- fontWeight: 'bold',
71
- color: '#ffffff',
72
- marginBottom: 4
73
- },
74
- scoreValue: {
75
- fontSize: 30,
76
- fontWeight: 'bold',
77
- color: '#1e40af' // Blue color for balloon theme
78
- },
79
- timeValue: {
80
- fontSize: 30,
81
- fontWeight: 'bold',
82
- color: '#1e40af' // Blue color for balloon theme
83
- },
84
- livesRow: {
85
- flexDirection: 'row',
86
- justifyContent: 'center'
87
- },
88
- heartIcon: {
89
- fontSize: 24,
90
- marginHorizontal: 3,
91
- fontWeight: 'bold'
92
- },
93
- heartActive: {
94
- opacity: 1,
95
- textShadowColor: 'rgba(0, 0, 0, 0.5)',
96
- textShadowOffset: {
97
- width: 1,
98
- height: 1
99
- },
100
- textShadowRadius: 2
101
- },
102
- heartInactive: {
103
- opacity: 0.3,
104
- textShadowColor: 'rgba(255, 255, 255, 0.3)',
105
- textShadowOffset: {
106
- width: 1,
107
- height: 1
108
- },
109
- textShadowRadius: 1
110
- }
111
- });
112
- //# sourceMappingURL=ScoreBoard.js.map
1
+ "use strict";import React from 'react';import{View,Text,StyleSheet}from 'react-native';import{useBalloonBlasterStore}from "../BalloonBlasterStore.js";import{GAME_CONFIG}from "../BalloonBlasterService.js";import{ScoreBoardContainer}from "../../../helpers/index.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const ScoreBoard = React.memo(({offset = 0})=>{const score = useBalloonBlasterStore(state => state.score);const timeLeft = useBalloonBlasterStore(state => state.timeLeft);const lives = useBalloonBlasterStore(state => state.lives);const formatTime = seconds =>{const mins = Math.floor(seconds / 60);const secs = seconds % 60;return `${mins.toString().padStart(2,'0')}:${secs.toString().padStart(2,'0')}`;};return _jsx(ScoreBoardContainer,{offset:offset,backgroundColor:"rgba(59,130,246,0.4)",borderColor:"rgba(255,255,255,0.6)",children:_jsxs(View,{style:styles.scoreBoard,children:[_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Score"}),_jsx(Text,{style:styles.scoreValue,children:score})]}),_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Time"}),_jsx(Text,{style:styles.timeValue,children:formatTime(timeLeft)})]}),_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Lives"}),_jsx(View,{style:styles.livesRow,children:Array.from({length:GAME_CONFIG.MAX_LIVES}).map((_,index)=> _jsx(Text,{style:[styles.heartIcon,index < lives ? styles.heartActive:styles.heartInactive],children:"\uD83C\uDF88"},index))})]})]})});});const styles = StyleSheet.create({scoreBoard:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},scoreSection:{alignItems:'center',flex:1},scoreLabel:{fontSize:16,fontWeight:'bold',color:'#ffffff',marginBottom:4},scoreValue:{fontSize:25,fontWeight:'bold',color:'#1e40af'},timeValue:{fontSize:25,fontWeight:'bold',color:'#1e40af'},livesRow:{flexDirection:'row',justifyContent:'center'},heartIcon:{fontSize:24,marginHorizontal:3,fontWeight:'bold'},heartActive:{opacity:1,textShadowColor:'rgba(0,0,0,0.5)',textShadowOffset:{width:1,height:1},textShadowRadius:2},heartInactive:{opacity:0.3,textShadowColor:'rgba(255,255,255,0.3)',textShadowOffset:{width:1,height:1},textShadowRadius:1}});
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","StyleSheet","useBalloonBlasterStore","GAME_CONFIG","ScoreBoardContainer","jsx","_jsx","jsxs","_jsxs","ScoreBoard","memo","offset","score","state","timeLeft","lives","backgroundColor","borderColor","children","style","styles","scoreBoard","scoreSection","scoreLabel","scoreValue","timeValue","livesRow","Array","from","length","MAX_LIVES","map","_","index","heartIcon","heartActive","heartInactive","create","flexDirection","justifyContent","alignItems","flex","fontSize","fontWeight","color","marginBottom","marginHorizontal","opacity","textShadowColor","textShadowOffset","width","height","textShadowRadius"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,sBAAsB,QAAQ,2BAAwB;AAC/D,SAASC,WAAW,QAAQ,6BAA0B;AACtD,SAASC,mBAAmB,QAAQ,2BAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMvD,OAAO,MAAMC,UAAqC,gBAAGX,KAAK,CAACY,IAAI,CAAC,CAAC;EAACC,MAAM,GAAG;AAAC,CAAC,KAAK;EAChF;EACA,MAAMC,KAAK,GAAGV,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACD,KAAK,CAAC;EAC1D,MAAME,QAAQ,GAAGZ,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACC,QAAQ,CAAC;EAChE,MAAMC,KAAK,GAAGb,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACE,KAAK,CAAC;EAC1D,oBACET,IAAA,CAACF,mBAAmB;IAClBO,MAAM,EAAEA,MAAO;IACfK,eAAe,EAAC,yBAAyB;IACzCC,WAAW,EAAC,0BAA0B;IAAAC,QAAA,eAEtCV,KAAA,CAACT,IAAI;MAACoB,KAAK,EAAEC,MAAM,CAACC,UAAW;MAAAH,QAAA,gBAC/BV,KAAA,CAACT,IAAI;QAACoB,KAAK,EAAEC,MAAM,CAACE,YAAa;QAAAJ,QAAA,gBAC/BZ,IAAA,CAACN,IAAI;UAACmB,KAAK,EAAEC,MAAM,CAACG,UAAW;UAAAL,QAAA,EAAC;QAAK,CAAM,CAAC,eAC5CZ,IAAA,CAACN,IAAI;UAACmB,KAAK,EAAEC,MAAM,CAACI,UAAW;UAAAN,QAAA,EAAEN;QAAK,CAAO,CAAC;MAAA,CAC1C,CAAC,eAEPJ,KAAA,CAACT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AAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS;IAChBC,YAAY,EAAE;EAChB,CAAC;EACDrB,UAAU,EAAE;IACVkB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDnB,SAAS,EAAE;IACTiB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDlB,QAAQ,EAAE;IACRY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDL,SAAS,EAAE;IACTQ,QAAQ,EAAE,EAAE;IACZI,gBAAgB,EAAE,CAAC;IACnBH,UAAU,EAAE;EACd,CAAC;EACDR,WAAW,EAAE;IACXY,OAAO,EAAE,CAAC;IACVC,eAAe,EAAE,oBAAoB;IACrCC,gBAAgB,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCC,gBAAgB,EAAE;EACpB,CAAC;EACDhB,aAAa,EAAE;IACbW,OAAO,EAAE,GAAG;IACZC,eAAe,EAAE,0BAA0B;IAC3CC,gBAAgB,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCC,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","View","Text","StyleSheet","useBalloonBlasterStore","GAME_CONFIG","ScoreBoardContainer","jsx","_jsx","jsxs","_jsxs","ScoreBoard","memo","offset","score","state","timeLeft","lives","formatTime","seconds","mins","Math","floor","secs","toString","padStart","backgroundColor","borderColor","children","style","styles","scoreBoard","scoreSection","scoreLabel","scoreValue","timeValue","livesRow","Array","from","length","MAX_LIVES","map","_","index","heartIcon","heartActive","heartInactive","create","flexDirection","justifyContent","alignItems","flex","fontSize","fontWeight","color","marginBottom","marginHorizontal","opacity","textShadowColor","textShadowOffset","width","height","textShadowRadius"],"sourceRoot":"../../../../../src","sources":["games/balloon-blaster/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,sBAAsB,QAAQ,2BAAwB;AAC/D,SAASC,WAAW,QAAQ,6BAA0B;AACtD,SAASC,mBAAmB,QAAQ,2BAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMvD,OAAO,MAAMC,UAAqC,gBAAGX,KAAK,CAACY,IAAI,CAAC,CAAC;EAACC,MAAM,GAAG;AAAC,CAAC,KAAK;EAChF;EACA,MAAMC,KAAK,GAAGV,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACD,KAAK,CAAC;EAC1D,MAAME,QAAQ,GAAGZ,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACC,QAAQ,CAAC;EAChE,MAAMC,KAAK,GAAGb,sBAAsB,CAACW,KAAK,IAAIA,KAAK,CAACE,KAAK,CAAC;;EAE1D;EACA,MAAMC,UAAU,GAAIC,OAAe,IAAa;IAC9C,MAAMC,IAAI,GAAGC,IAAI,CAACC,KAAK,CAACH,OAAO,GAAG,EAAE,CAAC;IACrC,MAAMI,IAAI,GAAGJ,OAAO,GAAG,EAAE;IACzB,OAAO,GAAGC,IAAI,CAACI,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAIF,IAAI,CAACC,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;EAClF,CAAC;EAED,oBACEjB,IAAA,CAACF,mBAAmB;IAClBO,MAAM,EAAEA,MAAO;IACfa,eAAe,EAAC,yBAAyB;IACzCC,WAAW,EAAC,0BAA0B;IAAAC,QAAA,eAEtClB,KAAA,CAACT,IAAI;MAAC4B,KAAK,EAAEC,MAAM,CAAC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F,CAAC,CAAC","ignoreList":[]}
@@ -1,7 +1 @@
1
- "use strict";
2
-
3
- export { BalloonComponent } from "./BalloonComponent.js";
4
- export { GameArea } from "./GameArea.js";
5
- export { GameBackground } from "./GameBackground.js";
6
- export { ScoreBoard } from "./ScoreBoard.js";
7
- //# sourceMappingURL=index.js.map
1
+ "use strict";export{BalloonComponent}from "./BalloonComponent.js";export{GameArea}from "./GameArea.js";export{GameBackground}from "./GameBackground.js";export{ScoreBoard}from "./ScoreBoard.js";