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,175 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { StyleSheet, View } from 'react-native';
5
- import { Canvas, LinearGradient, Rect, Circle, vec } from '@shopify/react-native-skia';
6
- import { MAZE_ADVENTURE_COLORS } from "../MazeRunnerConstants.js";
7
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
- export const GameBackground = ({
9
- width,
10
- height
11
- }) => {
12
- // Generate static colorful floating adventure decorations
13
- const generateFloatingElements = React.useMemo(() => {
14
- const elements = [];
15
- const elementCount = 12; // Reduced count for better performance
16
-
17
- for (let i = 0; i < elementCount; i++) {
18
- const baseX = width / elementCount * i;
19
- const baseY = height / elementCount * i;
20
-
21
- // Add subtle positioning variations for natural look
22
- const x = baseX + Math.sin(i * 0.5) * 40 + i % 3 * 20;
23
- const y = baseY + Math.cos(i * 0.7) * 50 + i % 4 * 25;
24
- const radius = 10 + i % 8 + Math.sin(i) * 5;
25
- const colorIndex = i % MAZE_ADVENTURE_COLORS.length;
26
- const opacity = 0.25 + Math.sin(i * 0.3) * 0.1; // Subtle opacity variation
27
-
28
- elements.push(/*#__PURE__*/_jsx(Circle, {
29
- cx: Math.max(radius, Math.min(width - radius, x)),
30
- cy: Math.max(radius, Math.min(height - radius, y)),
31
- r: radius,
32
- color: `${MAZE_ADVENTURE_COLORS[colorIndex]}${Math.floor(opacity * 255).toString(16).padStart(2, '0')}`
33
- }, `floating-element-${i}`));
34
- }
35
- return elements;
36
- }, [width, height]);
37
- return /*#__PURE__*/_jsx(_Fragment, {
38
- children: /*#__PURE__*/_jsx(View, {
39
- style: StyleSheet.absoluteFillObject,
40
- children: /*#__PURE__*/_jsxs(Canvas, {
41
- style: {
42
- width,
43
- height
44
- },
45
- children: [/*#__PURE__*/_jsx(Rect, {
46
- x: 0,
47
- y: 0,
48
- width: width,
49
- height: height,
50
- children: /*#__PURE__*/_jsx(LinearGradient, {
51
- start: vec(0, 0),
52
- end: vec(width, height),
53
- colors: [`${MAZE_ADVENTURE_COLORS[0]}40`,
54
- // Vibrant coral red
55
- `${MAZE_ADVENTURE_COLORS[2]}35`,
56
- // Vibrant sky blue
57
- `${MAZE_ADVENTURE_COLORS[4]}40`,
58
- // Vibrant golden yellow
59
- `${MAZE_ADVENTURE_COLORS[6]}35`,
60
- // Vibrant seafoam
61
- `${MAZE_ADVENTURE_COLORS[8]}40`,
62
- // Vibrant lavender
63
- `${MAZE_ADVENTURE_COLORS[10]}35`,
64
- // Vibrant light green
65
- `${MAZE_ADVENTURE_COLORS[12]}40`,
66
- // Vibrant light purple
67
- `${MAZE_ADVENTURE_COLORS[14]}35` // Vibrant cream
68
- ]
69
- })
70
- }), /*#__PURE__*/_jsx(Rect, {
71
- x: 0,
72
- y: 0,
73
- width: width,
74
- height: height,
75
- children: /*#__PURE__*/_jsx(LinearGradient, {
76
- start: vec(0, 0),
77
- end: vec(width / 2, height / 2),
78
- colors: [`${MAZE_ADVENTURE_COLORS[1]}25`,
79
- // Vibrant teal
80
- 'transparent', `${MAZE_ADVENTURE_COLORS[5]}25`,
81
- // Vibrant plum
82
- 'transparent', `${MAZE_ADVENTURE_COLORS[9]}25`,
83
- // Vibrant light blue
84
- 'transparent', `${MAZE_ADVENTURE_COLORS[13]}25`,
85
- // Vibrant pale green
86
- 'transparent']
87
- })
88
- }), /*#__PURE__*/_jsx(Rect, {
89
- x: 0,
90
- y: 0,
91
- width: width,
92
- height: height,
93
- children: /*#__PURE__*/_jsx(LinearGradient, {
94
- start: vec(width, 0),
95
- end: vec(0, height),
96
- colors: [`${MAZE_ADVENTURE_COLORS[3]}20`,
97
- // Vibrant mint green
98
- 'transparent', `${MAZE_ADVENTURE_COLORS[7]}20`,
99
- // Vibrant lemon
100
- 'transparent', `${MAZE_ADVENTURE_COLORS[11]}20`,
101
- // Vibrant peach
102
- 'transparent']
103
- })
104
- }), generateFloatingElements, /*#__PURE__*/_jsx(Circle, {
105
- cx: width * 0.1,
106
- cy: height * 0.15,
107
- r: 40,
108
- color: `${MAZE_ADVENTURE_COLORS[0]}30` // Vibrant coral red
109
- }), /*#__PURE__*/_jsx(Circle, {
110
- cx: width * 0.9,
111
- cy: height * 0.85,
112
- r: 35,
113
- color: `${MAZE_ADVENTURE_COLORS[3]}30` // Vibrant mint green
114
- }), /*#__PURE__*/_jsx(Circle, {
115
- cx: width * 0.85,
116
- cy: height * 0.2,
117
- r: 30,
118
- color: `${MAZE_ADVENTURE_COLORS[8]}30` // Vibrant lavender
119
- }), /*#__PURE__*/_jsx(Circle, {
120
- cx: width * 0.15,
121
- cy: height * 0.8,
122
- r: 45,
123
- color: `${MAZE_ADVENTURE_COLORS[12]}30` // Vibrant light purple
124
- }), /*#__PURE__*/_jsx(Circle, {
125
- cx: width * 0.5,
126
- cy: height * 0.1,
127
- r: 25,
128
- color: `${MAZE_ADVENTURE_COLORS[14]}30` // Vibrant cream
129
- }), /*#__PURE__*/_jsx(Circle, {
130
- cx: width * 0.2,
131
- cy: height * 0.5,
132
- r: 32,
133
- color: `${MAZE_ADVENTURE_COLORS[6]}30` // Vibrant seafoam
134
- }), /*#__PURE__*/_jsx(Circle, {
135
- cx: width * 0.8,
136
- cy: height * 0.6,
137
- r: 28,
138
- color: `${MAZE_ADVENTURE_COLORS[10]}30` // Vibrant light green
139
- }), /*#__PURE__*/_jsx(Circle, {
140
- cx: width * 0.6,
141
- cy: height * 0.9,
142
- r: 20,
143
- color: `${MAZE_ADVENTURE_COLORS[1]}30` // Vibrant teal
144
- }), /*#__PURE__*/_jsx(Circle, {
145
- cx: width * 0.3,
146
- cy: height * 0.25,
147
- r: 24,
148
- color: `${MAZE_ADVENTURE_COLORS[4]}30` // Vibrant golden yellow
149
- }), /*#__PURE__*/_jsx(Circle, {
150
- cx: width * 0.7,
151
- cy: height * 0.35,
152
- r: 26,
153
- color: `${MAZE_ADVENTURE_COLORS[9]}30` // Vibrant light blue
154
- }), Array.from({
155
- length: Math.floor(width / 40)
156
- }, (_, i) => /*#__PURE__*/_jsx(Rect, {
157
- x: i * 40,
158
- y: 0,
159
- width: 1,
160
- height: height,
161
- color: "rgba(0, 0, 0, 0.02)"
162
- }, `grid-v-${i}`)), Array.from({
163
- length: Math.floor(height / 40)
164
- }, (_, i) => /*#__PURE__*/_jsx(Rect, {
165
- x: 0,
166
- y: i * 40,
167
- width: width,
168
- height: 1,
169
- color: "rgba(0, 0, 0, 0.02)"
170
- }, `grid-h-${i}`))]
171
- })
172
- })
173
- });
174
- };
175
- //# sourceMappingURL=GameBackground.js.map
1
+ "use strict";import React from 'react';import{StyleSheet,View}from 'react-native';import{Canvas,LinearGradient,Rect,Circle,vec}from '@shopify/react-native-skia';import{MAZE_ADVENTURE_COLORS}from "../MazeRunnerConstants.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from "react/jsx-runtime";export const GameBackground =({width,height})=>{const generateFloatingElements = React.useMemo(()=>{const elements = [];const elementCount = 12;for(let i = 0;i < elementCount;i++){const baseX = width / elementCount * i;const baseY = height / elementCount * i;const x = baseX + Math.sin(i * 0.5)* 40 + i % 3 * 20;const y = baseY + Math.cos(i * 0.7)* 50 + i % 4 * 25;const radius = 10 + i % 8 + Math.sin(i)* 5;const colorIndex = i % MAZE_ADVENTURE_COLORS.length;const opacity = 0.25 + Math.sin(i * 0.3)* 0.1;elements.push(_jsx(Circle,{cx:Math.max(radius,Math.min(width - radius,x)),cy:Math.max(radius,Math.min(height - radius,y)),r:radius,color:`${MAZE_ADVENTURE_COLORS[colorIndex]}${Math.floor(opacity * 255).toString(16).padStart(2,'0')}`},`floating-element-${i}`));}return elements;},[width,height]);return _jsx(_Fragment,{children:_jsx(View,{style:StyleSheet.absoluteFillObject,children:_jsxs(Canvas,{style:{width,height},children:[_jsx(Rect,{x:0,y:0,width:width,height:height,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(width,height),colors:[`${MAZE_ADVENTURE_COLORS[0]}40`,`${MAZE_ADVENTURE_COLORS[2]}35`,`${MAZE_ADVENTURE_COLORS[4]}40`,`${MAZE_ADVENTURE_COLORS[6]}35`,`${MAZE_ADVENTURE_COLORS[8]}40`,`${MAZE_ADVENTURE_COLORS[10]}35`,`${MAZE_ADVENTURE_COLORS[12]}40`,`${MAZE_ADVENTURE_COLORS[14]}35` ]})}),_jsx(Rect,{x:0,y:0,width:width,height:height,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(width / 2,height / 2),colors:[`${MAZE_ADVENTURE_COLORS[1]}25`,'transparent',`${MAZE_ADVENTURE_COLORS[5]}25`,'transparent',`${MAZE_ADVENTURE_COLORS[9]}25`,'transparent',`${MAZE_ADVENTURE_COLORS[13]}25`,'transparent']})}),_jsx(Rect,{x:0,y:0,width:width,height:height,children:_jsx(LinearGradient,{start:vec(width,0),end:vec(0,height),colors:[`${MAZE_ADVENTURE_COLORS[3]}20`,'transparent',`${MAZE_ADVENTURE_COLORS[7]}20`,'transparent',`${MAZE_ADVENTURE_COLORS[11]}20`,'transparent']})}),generateFloatingElements,_jsx(Circle,{cx:width * 0.1,cy:height * 0.15,r:40,color:`${MAZE_ADVENTURE_COLORS[0]}30`}),_jsx(Circle,{cx:width * 0.9,cy:height * 0.85,r:35,color:`${MAZE_ADVENTURE_COLORS[3]}30`}),_jsx(Circle,{cx:width * 0.85,cy:height * 0.2,r:30,color:`${MAZE_ADVENTURE_COLORS[8]}30`}),_jsx(Circle,{cx:width * 0.15,cy:height * 0.8,r:45,color:`${MAZE_ADVENTURE_COLORS[12]}30`}),_jsx(Circle,{cx:width * 0.5,cy:height * 0.1,r:25,color:`${MAZE_ADVENTURE_COLORS[14]}30`}),_jsx(Circle,{cx:width * 0.2,cy:height * 0.5,r:32,color:`${MAZE_ADVENTURE_COLORS[6]}30`}),_jsx(Circle,{cx:width * 0.8,cy:height * 0.6,r:28,color:`${MAZE_ADVENTURE_COLORS[10]}30`}),_jsx(Circle,{cx:width * 0.6,cy:height * 0.9,r:20,color:`${MAZE_ADVENTURE_COLORS[1]}30`}),_jsx(Circle,{cx:width * 0.3,cy:height * 0.25,r:24,color:`${MAZE_ADVENTURE_COLORS[4]}30`}),_jsx(Circle,{cx:width * 0.7,cy:height * 0.35,r:26,color:`${MAZE_ADVENTURE_COLORS[9]}30`}),Array.from({length:Math.floor(width / 40)},(_,i)=> _jsx(Rect,{x:i * 40,y:0,width:1,height:height,color:"rgba(0,0,0,0.02)"},`grid-v-${i}`)),Array.from({length:Math.floor(height / 40)},(_,i)=> _jsx(Rect,{x:0,y:i * 40,width:width,height:1,color:"rgba(0,0,0,0.02)"},`grid-h-${i}`))]})})});};
@@ -1,61 +1 @@
1
- "use strict";
2
-
3
- import React, { useMemo } from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
5
- import { MazeRunnerService } from "../MazeRunnerService.js";
6
- import { ScoreBoardContainer } from "../../../helpers/index.js";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- // Memoized ScoreBoard component to prevent unnecessary re-renders
9
- export const ScoreBoard = /*#__PURE__*/React.memo(({
10
- gameState,
11
- offset = 0
12
- }) => {
13
- // Create service instance for formatting (memoized to avoid recreation)
14
- const gameService = useMemo(() => new MazeRunnerService(10, 400, 400, 120), []);
15
- const formattedTime = useMemo(() => gameService.formatTime(gameState.timeElapsed), [gameService, gameState.timeElapsed]);
16
- return /*#__PURE__*/_jsx(ScoreBoardContainer, {
17
- offset: offset,
18
- backgroundColor: "rgba(139, 69, 19, 0.4)",
19
- borderColor: "rgba(255, 255, 255, 0.3)",
20
- children: /*#__PURE__*/_jsx(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: "Time Elapsed"
27
- }), /*#__PURE__*/_jsx(Text, {
28
- style: styles.timeValue,
29
- children: formattedTime
30
- })]
31
- })
32
- })
33
- });
34
- });
35
- const styles = StyleSheet.create({
36
- scoreBoard: {
37
- flexDirection: 'row',
38
- justifyContent: 'center',
39
- alignItems: 'center'
40
- },
41
- scoreSection: {
42
- alignItems: 'center'
43
- },
44
- scoreLabel: {
45
- fontSize: 18,
46
- fontWeight: 'bold',
47
- color: '#ffffff',
48
- marginBottom: 4
49
- },
50
- scoreValue: {
51
- fontSize: 30,
52
- fontWeight: 'bold',
53
- color: '#92400e' // Brown color for score value
54
- },
55
- timeValue: {
56
- fontSize: 30,
57
- fontWeight: 'bold',
58
- color: '#ffffff' // White color for time value
59
- }
60
- });
61
- //# sourceMappingURL=ScoreBoard.js.map
1
+ "use strict";import React,{useMemo}from 'react';import{View,Text,StyleSheet}from 'react-native';import{MazeRunnerService}from "../MazeRunnerService.js";import{ScoreBoardContainer}from "../../../helpers/index.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";export const ScoreBoard = React.memo(({gameState,offset = 0})=>{const gameService = useMemo(()=> new MazeRunnerService(10,400,400,120),[]);const formattedTime = useMemo(()=> gameService.formatTime(gameState.timeElapsed),[gameService,gameState.timeElapsed]);return _jsx(ScoreBoardContainer,{offset:offset,backgroundColor:"rgba(139,69,19,0.4)",borderColor:"rgba(255,255,255,0.3)",children:_jsx(View,{style:styles.scoreBoard,children:_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Time Elapsed"}),_jsx(Text,{style:styles.timeValue,children:formattedTime})]})})});});const styles = StyleSheet.create({scoreBoard:{flexDirection:'row',justifyContent:'center',alignItems:'center'},scoreSection:{alignItems:'center'},scoreLabel:{fontSize:16,fontWeight:'bold',color:'#ffffff',marginBottom:4},scoreValue:{fontSize:25,fontWeight:'bold',color:'#92400e'},timeValue:{fontSize:25,fontWeight:'bold',color:'#ffffff'}});
@@ -1,209 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { Canvas, Path, Circle, LinearGradient, vec, Shadow } from '@shopify/react-native-skia';
5
- // PipeSegment type not exported from MazeRunnerService
6
- // Using inline type definition
7
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
- export const SkiaPipeComponent = ({
9
- segment,
10
- pipeWidth
11
- }) => {
12
- const canvasWidth = Math.abs(segment.end.x - segment.start.x) + pipeWidth * 2;
13
- const canvasHeight = Math.abs(segment.end.y - segment.start.y) + pipeWidth * 2;
14
- const canvasSize = Math.max(canvasWidth, canvasHeight, pipeWidth * 3);
15
- const renderStraightPipe = () => {
16
- const {
17
- start,
18
- end
19
- } = segment;
20
- const centerX = canvasSize / 2;
21
- const centerY = canvasSize / 2;
22
- if (segment.direction === 'horizontal') {
23
- const length = Math.abs(end.x - start.x);
24
- const pipeLeft = centerX - length / 2;
25
- const pipeRight = centerX + length / 2;
26
- const pipeTop = centerY - pipeWidth / 2;
27
- const pipeBottom = centerY + pipeWidth / 2;
28
- return /*#__PURE__*/_jsxs(_Fragment, {
29
- children: [/*#__PURE__*/_jsxs(Path, {
30
- path: `M ${pipeLeft} ${pipeTop} L ${pipeRight} ${pipeTop} L ${pipeRight} ${pipeBottom} L ${pipeLeft} ${pipeBottom} Z`,
31
- children: [/*#__PURE__*/_jsx(LinearGradient, {
32
- start: vec(centerX, pipeTop),
33
- end: vec(centerX, pipeBottom),
34
- colors: ['#8B4513', '#A0522D', '#654321', '#4A4A4A', '#2F2F2F']
35
- }), /*#__PURE__*/_jsx(Shadow, {
36
- dx: 0,
37
- dy: 2,
38
- blur: 4,
39
- color: "rgba(0,0,0,0.4)"
40
- })]
41
- }), /*#__PURE__*/_jsx(Path, {
42
- path: `M ${pipeLeft} ${pipeTop} L ${pipeRight} ${pipeTop} L ${pipeRight} ${pipeTop + 2} L ${pipeLeft} ${pipeTop + 2} Z`,
43
- color: "rgba(160, 82, 45, 0.8)"
44
- }), /*#__PURE__*/_jsx(Path, {
45
- path: `M ${pipeLeft} ${pipeBottom - 2} L ${pipeRight} ${pipeBottom - 2} L ${pipeRight} ${pipeBottom} L ${pipeLeft} ${pipeBottom} Z`,
46
- color: "rgba(47, 47, 47, 0.8)"
47
- }), /*#__PURE__*/_jsx(Circle, {
48
- cx: pipeLeft,
49
- cy: centerY,
50
- r: pipeWidth / 2,
51
- children: /*#__PURE__*/_jsx(LinearGradient, {
52
- start: vec(pipeLeft - pipeWidth / 4, centerY - pipeWidth / 4),
53
- end: vec(pipeLeft + pipeWidth / 4, centerY + pipeWidth / 4),
54
- colors: ['#A0522D', '#8B4513', '#654321']
55
- })
56
- }), /*#__PURE__*/_jsx(Circle, {
57
- cx: pipeRight,
58
- cy: centerY,
59
- r: pipeWidth / 2,
60
- children: /*#__PURE__*/_jsx(LinearGradient, {
61
- start: vec(pipeRight - pipeWidth / 4, centerY - pipeWidth / 4),
62
- end: vec(pipeRight + pipeWidth / 4, centerY + pipeWidth / 4),
63
- colors: ['#A0522D', '#8B4513', '#654321']
64
- })
65
- })]
66
- });
67
- } else {
68
- // Vertical pipe
69
- const length = Math.abs(end.y - start.y);
70
- const pipeTop = centerY - length / 2;
71
- const pipeBottom = centerY + length / 2;
72
- const pipeLeft = centerX - pipeWidth / 2;
73
- const pipeRight = centerX + pipeWidth / 2;
74
- return /*#__PURE__*/_jsxs(_Fragment, {
75
- children: [/*#__PURE__*/_jsxs(Path, {
76
- path: `M ${pipeLeft} ${pipeTop} L ${pipeRight} ${pipeTop} L ${pipeRight} ${pipeBottom} L ${pipeLeft} ${pipeBottom} Z`,
77
- children: [/*#__PURE__*/_jsx(LinearGradient, {
78
- start: vec(pipeLeft, centerY),
79
- end: vec(pipeRight, centerY),
80
- colors: ['#8B4513', '#A0522D', '#654321', '#4A4A4A', '#2F2F2F']
81
- }), /*#__PURE__*/_jsx(Shadow, {
82
- dx: 2,
83
- dy: 0,
84
- blur: 4,
85
- color: "rgba(0,0,0,0.4)"
86
- })]
87
- }), /*#__PURE__*/_jsx(Path, {
88
- path: `M ${pipeLeft} ${pipeTop} L ${pipeLeft + 2} ${pipeTop} L ${pipeLeft + 2} ${pipeBottom} L ${pipeLeft} ${pipeBottom} Z`,
89
- color: "rgba(160, 82, 45, 0.8)"
90
- }), /*#__PURE__*/_jsx(Path, {
91
- path: `M ${pipeRight - 2} ${pipeTop} L ${pipeRight} ${pipeTop} L ${pipeRight} ${pipeBottom} L ${pipeRight - 2} ${pipeBottom} Z`,
92
- color: "rgba(47, 47, 47, 0.8)"
93
- }), /*#__PURE__*/_jsx(Circle, {
94
- cx: centerX,
95
- cy: pipeTop,
96
- r: pipeWidth / 2,
97
- children: /*#__PURE__*/_jsx(LinearGradient, {
98
- start: vec(centerX - pipeWidth / 4, pipeTop - pipeWidth / 4),
99
- end: vec(centerX + pipeWidth / 4, pipeTop + pipeWidth / 4),
100
- colors: ['#A0522D', '#8B4513', '#654321']
101
- })
102
- }), /*#__PURE__*/_jsx(Circle, {
103
- cx: centerX,
104
- cy: pipeBottom,
105
- r: pipeWidth / 2,
106
- children: /*#__PURE__*/_jsx(LinearGradient, {
107
- start: vec(centerX - pipeWidth / 4, pipeBottom - pipeWidth / 4),
108
- end: vec(centerX + pipeWidth / 4, pipeBottom + pipeWidth / 4),
109
- colors: ['#A0522D', '#8B4513', '#654321']
110
- })
111
- })]
112
- });
113
- }
114
- };
115
- const renderCornerPipe = () => {
116
- const centerX = canvasSize / 2;
117
- const centerY = canvasSize / 2;
118
- const radius = pipeWidth * 1.5;
119
- const {
120
- cornerType
121
- } = segment;
122
- let startAngle = 0;
123
- let endAngle = 90;
124
- let sweepAngle = 90;
125
- switch (cornerType) {
126
- case 'top-right':
127
- startAngle = 0;
128
- endAngle = 90;
129
- break;
130
- case 'bottom-right':
131
- startAngle = 270;
132
- endAngle = 360;
133
- break;
134
- case 'bottom-left':
135
- startAngle = 180;
136
- endAngle = 270;
137
- break;
138
- case 'top-left':
139
- startAngle = 90;
140
- endAngle = 180;
141
- break;
142
- }
143
- const startAngleRad = startAngle * Math.PI / 180;
144
- const endAngleRad = endAngle * Math.PI / 180;
145
- const innerRadius = radius - pipeWidth / 2;
146
- const outerRadius = radius + pipeWidth / 2;
147
-
148
- // Calculate arc points
149
- const innerStartX = centerX + innerRadius * Math.cos(startAngleRad);
150
- const innerStartY = centerY + innerRadius * Math.sin(startAngleRad);
151
- const innerEndX = centerX + innerRadius * Math.cos(endAngleRad);
152
- const innerEndY = centerY + innerRadius * Math.sin(endAngleRad);
153
- const outerStartX = centerX + outerRadius * Math.cos(startAngleRad);
154
- const outerStartY = centerY + outerRadius * Math.sin(startAngleRad);
155
- const outerEndX = centerX + outerRadius * Math.cos(endAngleRad);
156
- const outerEndY = centerY + outerRadius * Math.sin(endAngleRad);
157
- const largeArcFlag = sweepAngle > 180 ? 1 : 0;
158
- return /*#__PURE__*/_jsxs(_Fragment, {
159
- children: [/*#__PURE__*/_jsxs(Path, {
160
- path: `
161
- M ${innerStartX} ${innerStartY}
162
- A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 1 ${innerEndX} ${innerEndY}
163
- L ${outerEndX} ${outerEndY}
164
- A ${outerRadius} ${outerRadius} 0 ${largeArcFlag} 0 ${outerStartX} ${outerStartY}
165
- Z
166
- `,
167
- children: [/*#__PURE__*/_jsx(LinearGradient, {
168
- start: vec(centerX - radius, centerY - radius),
169
- end: vec(centerX + radius, centerY + radius),
170
- colors: ['#8B4513', '#A0522D', '#654321', '#4A4A4A', '#2F2F2F']
171
- }), /*#__PURE__*/_jsx(Shadow, {
172
- dx: 2,
173
- dy: 2,
174
- blur: 4,
175
- color: "rgba(0,0,0,0.4)"
176
- })]
177
- }), /*#__PURE__*/_jsx(Path, {
178
- path: `
179
- M ${innerStartX} ${innerStartY}
180
- A ${innerRadius} ${innerRadius} 0 ${largeArcFlag} 1 ${innerEndX} ${innerEndY}
181
- L ${centerX + (innerRadius + 2) * Math.cos(endAngleRad)} ${centerY + (innerRadius + 2) * Math.sin(endAngleRad)}
182
- A ${innerRadius + 2} ${innerRadius + 2} 0 ${largeArcFlag} 0 ${centerX + (innerRadius + 2) * Math.cos(startAngleRad)} ${centerY + (innerRadius + 2) * Math.sin(startAngleRad)}
183
- Z
184
- `,
185
- color: "rgba(160, 82, 45, 0.6)"
186
- }), /*#__PURE__*/_jsx(Circle, {
187
- cx: centerX,
188
- cy: centerY,
189
- r: pipeWidth / 3,
190
- children: /*#__PURE__*/_jsx(LinearGradient, {
191
- start: vec(centerX - pipeWidth / 6, centerY - pipeWidth / 6),
192
- end: vec(centerX + pipeWidth / 6, centerY + pipeWidth / 6),
193
- colors: ['#A0522D', '#8B4513', '#654321']
194
- })
195
- })]
196
- });
197
- };
198
- return /*#__PURE__*/_jsx(Canvas, {
199
- style: {
200
- position: 'absolute',
201
- left: segment.start.x - canvasSize / 2,
202
- top: segment.start.y - canvasSize / 2,
203
- width: canvasSize,
204
- height: canvasSize
205
- },
206
- children: segment.type === 'straight' ? renderStraightPipe() : renderCornerPipe()
207
- });
208
- };
209
- //# sourceMappingURL=SkiaPipeComponent.js.map
1
+ "use strict";import React from 'react';import{Canvas,Path,Circle,LinearGradient,vec,Shadow}from '@shopify/react-native-skia';import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from "react/jsx-runtime";export const SkiaPipeComponent =({segment,pipeWidth})=>{const canvasWidth = Math.abs(segment.end.x - segment.start.x)+ pipeWidth * 2;const canvasHeight = Math.abs(segment.end.y - segment.start.y)+ pipeWidth * 2;const canvasSize = Math.max(canvasWidth,canvasHeight,pipeWidth * 3);const renderStraightPipe =()=>{const{start,end}= segment;const centerX = canvasSize / 2;const centerY = canvasSize / 2;if(segment.direction === 'horizontal'){const length = Math.abs(end.x - start.x);const pipeLeft = centerX - length / 2;const pipeRight = centerX + length / 2;const pipeTop = centerY - pipeWidth / 2;const pipeBottom = centerY + pipeWidth / 2;return _jsxs(_Fragment,{children:[_jsxs(Path,{path:`M ${pipeLeft}${pipeTop}L ${pipeRight}${pipeTop}L ${pipeRight}${pipeBottom}L ${pipeLeft}${pipeBottom}Z`,children:[_jsx(LinearGradient,{start:vec(centerX,pipeTop),end:vec(centerX,pipeBottom),colors:['#8B4513','#A0522D','#654321','#4A4A4A','#2F2F2F']}),_jsx(Shadow,{dx:0,dy:2,blur:4,color:"rgba(0,0,0,0.4)"})]}),_jsx(Path,{path:`M ${pipeLeft}${pipeTop}L ${pipeRight}${pipeTop}L ${pipeRight}${pipeTop + 2}L ${pipeLeft}${pipeTop + 2}Z`,color:"rgba(160,82,45,0.8)"}),_jsx(Path,{path:`M ${pipeLeft}${pipeBottom - 2}L ${pipeRight}${pipeBottom - 2}L ${pipeRight}${pipeBottom}L ${pipeLeft}${pipeBottom}Z`,color:"rgba(47,47,47,0.8)"}),_jsx(Circle,{cx:pipeLeft,cy:centerY,r:pipeWidth / 2,children:_jsx(LinearGradient,{start:vec(pipeLeft - pipeWidth / 4,centerY - pipeWidth / 4),end:vec(pipeLeft + pipeWidth / 4,centerY + pipeWidth / 4),colors:['#A0522D','#8B4513','#654321']})}),_jsx(Circle,{cx:pipeRight,cy:centerY,r:pipeWidth / 2,children:_jsx(LinearGradient,{start:vec(pipeRight - pipeWidth / 4,centerY - pipeWidth / 4),end:vec(pipeRight + pipeWidth / 4,centerY + pipeWidth / 4),colors:['#A0522D','#8B4513','#654321']})})]});}else{const length = Math.abs(end.y - start.y);const pipeTop = centerY - length / 2;const pipeBottom = centerY + length / 2;const pipeLeft = centerX - pipeWidth / 2;const pipeRight = centerX + pipeWidth / 2;return _jsxs(_Fragment,{children:[_jsxs(Path,{path:`M ${pipeLeft}${pipeTop}L ${pipeRight}${pipeTop}L ${pipeRight}${pipeBottom}L ${pipeLeft}${pipeBottom}Z`,children:[_jsx(LinearGradient,{start:vec(pipeLeft,centerY),end:vec(pipeRight,centerY),colors:['#8B4513','#A0522D','#654321','#4A4A4A','#2F2F2F']}),_jsx(Shadow,{dx:2,dy:0,blur:4,color:"rgba(0,0,0,0.4)"})]}),_jsx(Path,{path:`M ${pipeLeft}${pipeTop}L ${pipeLeft + 2}${pipeTop}L ${pipeLeft + 2}${pipeBottom}L ${pipeLeft}${pipeBottom}Z`,color:"rgba(160,82,45,0.8)"}),_jsx(Path,{path:`M ${pipeRight - 2}${pipeTop}L ${pipeRight}${pipeTop}L ${pipeRight}${pipeBottom}L ${pipeRight - 2}${pipeBottom}Z`,color:"rgba(47,47,47,0.8)"}),_jsx(Circle,{cx:centerX,cy:pipeTop,r:pipeWidth / 2,children:_jsx(LinearGradient,{start:vec(centerX - pipeWidth / 4,pipeTop - pipeWidth / 4),end:vec(centerX + pipeWidth / 4,pipeTop + pipeWidth / 4),colors:['#A0522D','#8B4513','#654321']})}),_jsx(Circle,{cx:centerX,cy:pipeBottom,r:pipeWidth / 2,children:_jsx(LinearGradient,{start:vec(centerX - pipeWidth / 4,pipeBottom - pipeWidth / 4),end:vec(centerX + pipeWidth / 4,pipeBottom + pipeWidth / 4),colors:['#A0522D','#8B4513','#654321']})})]});}};const renderCornerPipe =()=>{const centerX = canvasSize / 2;const centerY = canvasSize / 2;const radius = pipeWidth * 1.5;const{cornerType}= segment;let startAngle = 0;let endAngle = 90;let sweepAngle = 90;switch(cornerType){case 'top-right':startAngle = 0;endAngle = 90;break;case 'bottom-right':startAngle = 270;endAngle = 360;break;case 'bottom-left':startAngle = 180;endAngle = 270;break;case 'top-left':startAngle = 90;endAngle = 180;break;}const startAngleRad = startAngle * Math.PI / 180;const endAngleRad = endAngle * Math.PI / 180;const innerRadius = radius - pipeWidth / 2;const outerRadius = radius + pipeWidth / 2;const innerStartX = centerX + innerRadius * Math.cos(startAngleRad);const innerStartY = centerY + innerRadius * Math.sin(startAngleRad);const innerEndX = centerX + innerRadius * Math.cos(endAngleRad);const innerEndY = centerY + innerRadius * Math.sin(endAngleRad);const outerStartX = centerX + outerRadius * Math.cos(startAngleRad);const outerStartY = centerY + outerRadius * Math.sin(startAngleRad);const outerEndX = centerX + outerRadius * Math.cos(endAngleRad);const outerEndY = centerY + outerRadius * Math.sin(endAngleRad);const largeArcFlag = sweepAngle > 180 ? 1:0;return _jsxs(_Fragment,{children:[_jsxs(Path,{path:` M ${innerStartX}${innerStartY}A ${innerRadius}${innerRadius}0 ${largeArcFlag}1 ${innerEndX}${innerEndY}L ${outerEndX}${outerEndY}A ${outerRadius}${outerRadius}0 ${largeArcFlag}0 ${outerStartX}${outerStartY}Z `,children:[_jsx(LinearGradient,{start:vec(centerX - radius,centerY - radius),end:vec(centerX + radius,centerY + radius),colors:['#8B4513','#A0522D','#654321','#4A4A4A','#2F2F2F']}),_jsx(Shadow,{dx:2,dy:2,blur:4,color:"rgba(0,0,0,0.4)"})]}),_jsx(Path,{path:` M ${innerStartX}${innerStartY}A ${innerRadius}${innerRadius}0 ${largeArcFlag}1 ${innerEndX}${innerEndY}L ${centerX +(innerRadius + 2)* Math.cos(endAngleRad)}${centerY +(innerRadius + 2)* Math.sin(endAngleRad)}A ${innerRadius + 2}${innerRadius + 2}0 ${largeArcFlag}0 ${centerX +(innerRadius + 2)* Math.cos(startAngleRad)}${centerY +(innerRadius + 2)* Math.sin(startAngleRad)}Z `,color:"rgba(160,82,45,0.6)"}),_jsx(Circle,{cx:centerX,cy:centerY,r:pipeWidth / 3,children:_jsx(LinearGradient,{start:vec(centerX - pipeWidth / 6,centerY - pipeWidth / 6),end:vec(centerX + pipeWidth / 6,centerY + pipeWidth / 6),colors:['#A0522D','#8B4513','#654321']})})]});};return _jsx(Canvas,{style:{position:'absolute',left:segment.start.x - canvasSize / 2,top:segment.start.y - canvasSize / 2,width:canvasSize,height:canvasSize},children:segment.type === 'straight' ? renderStraightPipe():renderCornerPipe()});};
@@ -1,169 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { Canvas, LinearGradient, vec, Circle, Path, Shadow } from '@shopify/react-native-skia';
5
- import Animated from 'react-native-reanimated';
6
- import { Dimensions } from 'react-native';
7
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
- const {
9
- width: screenWidth,
10
- height: screenHeight
11
- } = Dimensions.get('window');
12
- export const GameBackground = ({
13
- children
14
- }) => {
15
- // Static background with no animations or changing elements
16
- const staticStyle = {
17
- position: 'absolute',
18
- top: 0,
19
- left: 0,
20
- right: 0,
21
- bottom: 0,
22
- zIndex: -1
23
- };
24
-
25
- // Pre-calculated static maze pattern - no Math.random() or changing values
26
- const staticMazePattern = React.useMemo(() => {
27
- const gridSize = 20;
28
- const cellSize = screenWidth / gridSize;
29
- const elements = [];
30
-
31
- // Create completely static maze pattern
32
- for (let i = 0; i < gridSize; i++) {
33
- for (let j = 0; j < gridSize; j++) {
34
- const x = i * cellSize;
35
- const y = j * cellSize;
36
- // Fixed deterministic opacity based on position
37
- const seed = (i * 31 + j * 17) % 100;
38
- const opacity = seed > 70 ? 0.08 : 0.04;
39
-
40
- // Fixed vertical lines pattern
41
- if ((i + j * 2) % 5 > 2) {
42
- elements.push(/*#__PURE__*/_jsx(Path, {
43
- path: `M ${x} ${y} L ${x} ${y + cellSize}`,
44
- style: "stroke",
45
- strokeWidth: 1,
46
- color: `rgba(139, 69, 19, ${opacity})`
47
- }, `v-${i}-${j}`));
48
- }
49
-
50
- // Fixed horizontal lines pattern
51
- if ((i * 2 + j) % 5 > 2) {
52
- elements.push(/*#__PURE__*/_jsx(Path, {
53
- path: `M ${x} ${y} L ${x + cellSize} ${y}`,
54
- style: "stroke",
55
- strokeWidth: 1,
56
- color: `rgba(139, 69, 19, ${opacity})`
57
- }, `h-${i}-${j}`));
58
- }
59
- }
60
- }
61
- return elements;
62
- }, []);
63
-
64
- // Static floating elements - no animations
65
- const staticFloatingElements = React.useMemo(() => {
66
- const elements = [];
67
-
68
- // Static maze pieces with fixed positioning
69
- for (let i = 0; i < 6; i++) {
70
- const seed = i * 37;
71
- const x = screenWidth / 6 * i + seed % 40;
72
- const y = screenHeight / 3 * (i % 3) + seed * 2 % 80;
73
- const size = 12 + seed * 3 % 8;
74
- elements.push(/*#__PURE__*/_jsx(Circle, {
75
- cx: x,
76
- cy: y,
77
- r: size,
78
- opacity: 0.1,
79
- color: "rgba(139, 69, 19, 0.2)",
80
- children: /*#__PURE__*/_jsx(Shadow, {
81
- dx: 1,
82
- dy: 1,
83
- blur: 2,
84
- color: "rgba(0,0,0,0.1)"
85
- })
86
- }, `maze-piece-${i}`));
87
- }
88
-
89
- // Static corner accents
90
- const cornerSize = 30;
91
- elements.push(
92
- /*#__PURE__*/
93
- // Top-left corner
94
- _jsx(Path, {
95
- path: `M 15 15 L ${cornerSize + 15} 15 L ${cornerSize + 15} 30 L 30 30 L 30 ${cornerSize + 15} L 15 ${cornerSize + 15} Z`,
96
- color: "rgba(139, 69, 19, 0.15)",
97
- opacity: 0.5,
98
- children: /*#__PURE__*/_jsx(Shadow, {
99
- dx: 1,
100
- dy: 1,
101
- blur: 2,
102
- color: "rgba(0,0,0,0.05)"
103
- })
104
- }, "corner-tl"),
105
- /*#__PURE__*/
106
- // Top-right corner
107
- _jsx(Path, {
108
- path: `M ${screenWidth - cornerSize - 15} 15 L ${screenWidth - 15} 15 L ${screenWidth - 15} ${cornerSize + 15} L ${screenWidth - 30} ${cornerSize + 15} L ${screenWidth - 30} 30 L ${screenWidth - cornerSize - 15} 30 Z`,
109
- color: "rgba(139, 69, 19, 0.15)",
110
- opacity: 0.5,
111
- children: /*#__PURE__*/_jsx(Shadow, {
112
- dx: -1,
113
- dy: 1,
114
- blur: 2,
115
- color: "rgba(0,0,0,0.05)"
116
- })
117
- }, "corner-tr"));
118
- return elements;
119
- }, []);
120
-
121
- // Static particles - no animations
122
- const staticParticles = React.useMemo(() => {
123
- const particles = [];
124
- for (let i = 0; i < 12; i++) {
125
- const seed = i * 43;
126
- const x = seed % screenWidth;
127
- const y = seed * 7 % screenHeight;
128
- const size = 1.5 + seed * 3 % 2;
129
- const opacity = 0.08 + seed * 5 % 15 / 100;
130
- particles.push(/*#__PURE__*/_jsx(Circle, {
131
- cx: x,
132
- cy: y,
133
- r: size,
134
- color: `rgba(160, 82, 45, ${opacity})`
135
- }, `particle-${i}`));
136
- }
137
- return particles;
138
- }, []);
139
- return /*#__PURE__*/_jsxs(_Fragment, {
140
- children: [/*#__PURE__*/_jsx(Animated.View, {
141
- style: staticStyle,
142
- children: /*#__PURE__*/_jsxs(Canvas, {
143
- style: {
144
- width: screenWidth,
145
- height: screenHeight
146
- },
147
- children: [/*#__PURE__*/_jsx(Path, {
148
- path: `M 0 0 L ${screenWidth} 0 L ${screenWidth} ${screenHeight} L 0 ${screenHeight} Z`,
149
- children: /*#__PURE__*/_jsx(LinearGradient, {
150
- start: vec(0, 0),
151
- end: vec(0, screenHeight),
152
- colors: ['#f8f4e6',
153
- // Light cream
154
- '#f0e6d2',
155
- // Warm beige
156
- '#e8d5b7',
157
- // Light brown
158
- '#d4c4a8' // Medium beige
159
- ]
160
- })
161
- }), staticMazePattern, staticFloatingElements, staticParticles, /*#__PURE__*/_jsx(Path, {
162
- path: `M 0 0 L ${screenWidth} 0 L ${screenWidth} ${screenHeight} L 0 ${screenHeight} Z`,
163
- color: "rgba(139, 69, 19, 0.02)"
164
- })]
165
- })
166
- }), children]
167
- });
168
- };
169
- //# sourceMappingURL=StaticGameBackground.js.map
1
+ "use strict";import React from 'react';import{Canvas,LinearGradient,vec,Circle,Path,Shadow}from '@shopify/react-native-skia';import Animated from 'react-native-reanimated';import{Dimensions}from 'react-native';import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from "react/jsx-runtime";const{width:screenWidth,height:screenHeight}= Dimensions.get('window');export const GameBackground =({children})=>{const staticStyle ={position:'absolute',top:0,left:0,right:0,bottom:0,zIndex:-1};const staticMazePattern = React.useMemo(()=>{const gridSize = 20;const cellSize = screenWidth / gridSize;const elements = [];for(let i = 0;i < gridSize;i++){for(let j = 0;j < gridSize;j++){const x = i * cellSize;const y = j * cellSize;const seed =(i * 31 + j * 17)% 100;const opacity = seed > 70 ? 0.08:0.04;if((i + j * 2)% 5 > 2){elements.push(_jsx(Path,{path:`M ${x}${y}L ${x}${y + cellSize}`,style:"stroke",strokeWidth:1,color:`rgba(139,69,19,${opacity})`},`v-${i}-${j}`));}if((i * 2 + j)% 5 > 2){elements.push(_jsx(Path,{path:`M ${x}${y}L ${x + cellSize}${y}`,style:"stroke",strokeWidth:1,color:`rgba(139,69,19,${opacity})`},`h-${i}-${j}`));}}}return elements;},[]);const staticFloatingElements = React.useMemo(()=>{const elements = [];for(let i = 0;i < 6;i++){const seed = i * 37;const x = screenWidth / 6 * i + seed % 40;const y = screenHeight / 3 *(i % 3)+ seed * 2 % 80;const size = 12 + seed * 3 % 8;elements.push(_jsx(Circle,{cx:x,cy:y,r:size,opacity:0.1,color:"rgba(139,69,19,0.2)",children:_jsx(Shadow,{dx:1,dy:1,blur:2,color:"rgba(0,0,0,0.1)"})},`maze-piece-${i}`));}const cornerSize = 30;elements.push(_jsx(Path,{path:`M 15 15 L ${cornerSize + 15}15 L ${cornerSize + 15}30 L 30 30 L 30 ${cornerSize + 15}L 15 ${cornerSize + 15}Z`,color:"rgba(139,69,19,0.15)",opacity:0.5,children:_jsx(Shadow,{dx:1,dy:1,blur:2,color:"rgba(0,0,0,0.05)"})},"corner-tl"),_jsx(Path,{path:`M ${screenWidth - cornerSize - 15}15 L ${screenWidth - 15}15 L ${screenWidth - 15}${cornerSize + 15}L ${screenWidth - 30}${cornerSize + 15}L ${screenWidth - 30}30 L ${screenWidth - cornerSize - 15}30 Z`,color:"rgba(139,69,19,0.15)",opacity:0.5,children:_jsx(Shadow,{dx:-1,dy:1,blur:2,color:"rgba(0,0,0,0.05)"})},"corner-tr"));return elements;},[]);const staticParticles = React.useMemo(()=>{const particles = [];for(let i = 0;i < 12;i++){const seed = i * 43;const x = seed % screenWidth;const y = seed * 7 % screenHeight;const size = 1.5 + seed * 3 % 2;const opacity = 0.08 + seed * 5 % 15 / 100;particles.push(_jsx(Circle,{cx:x,cy:y,r:size,color:`rgba(160,82,45,${opacity})`},`particle-${i}`));}return particles;},[]);return _jsxs(_Fragment,{children:[_jsx(Animated.View,{style:staticStyle,children:_jsxs(Canvas,{style:{width:screenWidth,height:screenHeight},children:[_jsx(Path,{path:`M 0 0 L ${screenWidth}0 L ${screenWidth}${screenHeight}L 0 ${screenHeight}Z`,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(0,screenHeight),colors:['#f8f4e6','#f0e6d2','#e8d5b7','#d4c4a8' ]})}),staticMazePattern,staticFloatingElements,staticParticles,_jsx(Path,{path:`M 0 0 L ${screenWidth}0 L ${screenWidth}${screenHeight}L 0 ${screenHeight}Z`,color:"rgba(139,69,19,0.02)"})]})}),children]});};