react-native-games 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/README.md +101 -30
  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/bike-racing/BikeRacing.js +1 -0
  15. package/lib/module/games/bike-racing/BikeRacing.js.map +1 -0
  16. package/lib/module/games/bike-racing/BikeRacingConstants.js +1 -0
  17. package/lib/module/games/bike-racing/BikeRacingConstants.js.map +1 -0
  18. package/lib/module/games/bike-racing/BikeRacingService.js +1 -0
  19. package/lib/module/games/bike-racing/BikeRacingService.js.map +1 -0
  20. package/lib/module/games/bike-racing/BikeRacingStore.js +1 -0
  21. package/lib/module/games/bike-racing/BikeRacingStore.js.map +1 -0
  22. package/lib/module/games/bike-racing/components/BikeComponent.js +1 -0
  23. package/lib/module/games/bike-racing/components/BikeComponent.js.map +1 -0
  24. package/lib/module/games/bike-racing/components/GameBackground.js +1 -0
  25. package/lib/module/games/bike-racing/components/GameBackground.js.map +1 -0
  26. package/lib/module/games/bike-racing/components/ScoreBoard.js +1 -0
  27. package/lib/module/games/bike-racing/components/ScoreBoard.js.map +1 -0
  28. package/lib/module/games/bike-racing/components/index.js +1 -0
  29. package/lib/module/games/bike-racing/components/index.js.map +1 -0
  30. package/lib/module/games/bike-racing/index.js +1 -0
  31. package/lib/module/games/bike-racing/index.js.map +1 -0
  32. package/lib/module/games/block-blast/BlockBlast.js +1 -0
  33. package/lib/module/games/block-blast/BlockBlast.js.map +1 -0
  34. package/lib/module/games/block-blast/BlockBlastConstants.js +1 -0
  35. package/lib/module/games/block-blast/BlockBlastConstants.js.map +1 -0
  36. package/lib/module/games/block-blast/BlockBlastService.js +1 -0
  37. package/lib/module/games/block-blast/BlockBlastService.js.map +1 -0
  38. package/lib/module/games/block-blast/BlockBlastStore.js +1 -0
  39. package/lib/module/games/block-blast/BlockBlastStore.js.map +1 -0
  40. package/lib/module/games/block-blast/components/BlockPieceComponent.js +1 -0
  41. package/lib/module/games/block-blast/components/BlockPieceComponent.js.map +1 -0
  42. package/lib/module/games/block-blast/components/GameArea.js +1 -0
  43. package/lib/module/games/block-blast/components/GameArea.js.map +1 -0
  44. package/lib/module/games/block-blast/components/GameBackground.js +1 -0
  45. package/lib/module/games/block-blast/components/GameBackground.js.map +1 -0
  46. package/lib/module/games/block-blast/components/GridComponent.js +1 -0
  47. package/lib/module/games/block-blast/components/GridComponent.js.map +1 -0
  48. package/lib/module/games/block-blast/components/ScoreBoard.js +1 -0
  49. package/lib/module/games/block-blast/components/ScoreBoard.js.map +1 -0
  50. package/lib/module/games/block-blast/components/index.js +1 -0
  51. package/lib/module/games/block-blast/components/index.js.map +1 -0
  52. package/lib/module/games/block-blast/index.js +1 -0
  53. package/lib/module/games/block-blast/index.js.map +1 -0
  54. package/lib/module/games/bubble-shooter/BubbleShooter.js +1 -0
  55. package/lib/module/games/bubble-shooter/BubbleShooter.js.map +1 -0
  56. package/lib/module/games/bubble-shooter/BubbleShooterConstants.js +1 -0
  57. package/lib/module/games/bubble-shooter/BubbleShooterConstants.js.map +1 -0
  58. package/lib/module/games/bubble-shooter/BubbleShooterService.js +1 -0
  59. package/lib/module/games/bubble-shooter/BubbleShooterService.js.map +1 -0
  60. package/lib/module/games/bubble-shooter/BubbleShooterStore.js +1 -0
  61. package/lib/module/games/bubble-shooter/BubbleShooterStore.js.map +1 -0
  62. package/lib/module/games/bubble-shooter/components/GameArea.js +1 -0
  63. package/lib/module/games/bubble-shooter/components/GameArea.js.map +1 -0
  64. package/lib/module/games/bubble-shooter/components/GameBackground.js +1 -0
  65. package/lib/module/games/bubble-shooter/components/GameBackground.js.map +1 -0
  66. package/lib/module/games/bubble-shooter/components/ScoreBoard.js +1 -0
  67. package/lib/module/games/bubble-shooter/components/ScoreBoard.js.map +1 -0
  68. package/lib/module/games/bubble-shooter/components/index.js +1 -0
  69. package/lib/module/games/bubble-shooter/components/index.js.map +1 -0
  70. package/lib/module/games/bubble-shooter/index.js +1 -0
  71. package/lib/module/games/bubble-shooter/index.js.map +1 -0
  72. package/lib/module/games/candy-crush/CandyCrush.js +1 -131
  73. package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
  74. package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
  75. package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
  76. package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
  77. package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
  78. package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
  79. package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
  80. package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
  81. package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
  82. package/lib/module/games/candy-crush/components/index.js +1 -7
  83. package/lib/module/games/candy-crush/index.js +1 -6
  84. package/lib/module/games/car-racing/CarRacing.js +1 -0
  85. package/lib/module/games/car-racing/CarRacing.js.map +1 -0
  86. package/lib/module/games/car-racing/CarRacingConstants.js +1 -0
  87. package/lib/module/games/car-racing/CarRacingConstants.js.map +1 -0
  88. package/lib/module/games/car-racing/CarRacingService.js +1 -0
  89. package/lib/module/games/car-racing/CarRacingService.js.map +1 -0
  90. package/lib/module/games/car-racing/CarRacingStore.js +1 -0
  91. package/lib/module/games/car-racing/CarRacingStore.js.map +1 -0
  92. package/lib/module/games/car-racing/components/CarComponent.js +1 -0
  93. package/lib/module/games/car-racing/components/CarComponent.js.map +1 -0
  94. package/lib/module/games/car-racing/components/GameBackground.js +1 -0
  95. package/lib/module/games/car-racing/components/GameBackground.js.map +1 -0
  96. package/lib/module/games/car-racing/components/ScoreBoard.js +1 -0
  97. package/lib/module/games/car-racing/components/ScoreBoard.js.map +1 -0
  98. package/lib/module/games/car-racing/components/index.js +1 -0
  99. package/lib/module/games/car-racing/components/index.js.map +1 -0
  100. package/lib/module/games/colors-sort/ColorsSort.js +1 -143
  101. package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
  102. package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
  103. package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
  104. package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
  105. package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
  106. package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
  107. package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
  108. package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
  109. package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
  110. package/lib/module/games/colors-sort/components/index.js +1 -6
  111. package/lib/module/games/dino-jump/DinoJump.js +1 -209
  112. package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
  113. package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
  114. package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
  115. package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
  116. package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
  117. package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
  118. package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
  119. package/lib/module/games/dino-jump/components/GameArea.js +1 -68
  120. package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
  121. package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
  122. package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
  123. package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
  124. package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
  125. package/lib/module/games/dino-jump/components/index.js +1 -9
  126. package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
  127. package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
  128. package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
  129. package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
  130. package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
  131. package/lib/module/games/flappy-bird/components/Bird.js +1 -87
  132. package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
  133. package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
  134. package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
  135. package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
  136. package/lib/module/games/flappy-bird/components/index.js +1 -8
  137. package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
  138. package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
  139. package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
  140. package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
  141. package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
  142. package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
  143. package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
  144. package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
  145. package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
  146. package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
  147. package/lib/module/games/fruit-merger/components/index.js +1 -7
  148. package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
  149. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  150. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
  151. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
  152. package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
  153. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
  154. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
  155. package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
  156. package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
  157. package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
  158. package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
  159. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
  160. package/lib/module/games/fruit-ninja/components/index.js +1 -7
  161. package/lib/module/games/game-2048/Game2048.js +1 -149
  162. package/lib/module/games/game-2048/Game2048.js.map +1 -1
  163. package/lib/module/games/game-2048/Game2048Constants.js +1 -263
  164. package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
  165. package/lib/module/games/game-2048/Game2048Service.js +1 -457
  166. package/lib/module/games/game-2048/Game2048Store.js +1 -236
  167. package/lib/module/games/game-2048/components/GameBackground.js +1 -247
  168. package/lib/module/games/game-2048/components/GameGrid.js +1 -139
  169. package/lib/module/games/game-2048/components/GameTile.js +1 -72
  170. package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
  171. package/lib/module/games/game-2048/components/index.js +1 -7
  172. package/lib/module/games/maze-runner/MazeRunner.js +1 -267
  173. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  174. package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
  175. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
  176. package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
  177. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
  178. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
  179. package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
  180. package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
  181. package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
  182. package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
  183. package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
  184. package/lib/module/games/maze-runner/components/index.js +1 -8
  185. package/lib/module/games/perfect-circle/PerfectCircle.js +1 -0
  186. package/lib/module/games/perfect-circle/PerfectCircle.js.map +1 -0
  187. package/lib/module/games/perfect-circle/PerfectCircleConstants.js +1 -0
  188. package/lib/module/games/perfect-circle/PerfectCircleConstants.js.map +1 -0
  189. package/lib/module/games/perfect-circle/PerfectCircleService.js +1 -0
  190. package/lib/module/games/perfect-circle/PerfectCircleService.js.map +1 -0
  191. package/lib/module/games/perfect-circle/PerfectCircleStore.js +1 -0
  192. package/lib/module/games/perfect-circle/PerfectCircleStore.js.map +1 -0
  193. package/lib/module/games/perfect-circle/components/DrawingCanvas.js +1 -0
  194. package/lib/module/games/perfect-circle/components/DrawingCanvas.js.map +1 -0
  195. package/lib/module/games/perfect-circle/components/GameBackground.js +1 -0
  196. package/lib/module/games/perfect-circle/components/GameBackground.js.map +1 -0
  197. package/lib/module/games/perfect-circle/components/ScoreBoard.js +1 -0
  198. package/lib/module/games/perfect-circle/components/ScoreBoard.js.map +1 -0
  199. package/lib/module/games/perfect-circle/index.js +1 -0
  200. package/lib/module/games/perfect-circle/index.js.map +1 -0
  201. package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
  202. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  203. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
  204. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
  205. package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
  206. package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
  207. package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
  208. package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
  209. package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
  210. package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
  211. package/lib/module/games/popit-fidget/components/index.js +1 -7
  212. package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
  213. package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
  214. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
  215. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
  216. package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
  217. package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
  218. package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
  219. package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
  220. package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
  221. package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
  222. package/lib/module/games/sliding-numbers/components/index.js +1 -7
  223. package/lib/module/games/snake/Snake.js +1 -189
  224. package/lib/module/games/snake/Snake.js.map +1 -1
  225. package/lib/module/games/snake/SnakeConstants.js +1 -138
  226. package/lib/module/games/snake/SnakeConstants.js.map +1 -1
  227. package/lib/module/games/snake/SnakeService.js +1 -148
  228. package/lib/module/games/snake/SnakeStore.js +1 -182
  229. package/lib/module/games/snake/SnakeStore.js.map +1 -1
  230. package/lib/module/games/snake/components/GameBackground.js +1 -221
  231. package/lib/module/games/snake/components/GameGrid.js +1 -153
  232. package/lib/module/games/snake/components/ScoreBoard.js +1 -51
  233. package/lib/module/games/snake/components/ScoreBoard.js.map +1 -1
  234. package/lib/module/games/snake/components/index.js +1 -6
  235. package/lib/module/games/snake/index.js +1 -6
  236. package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
  237. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  238. package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
  239. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
  240. package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
  241. package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
  242. package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
  243. package/lib/module/games/space-fighter/components/GameArea.js +1 -289
  244. package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
  245. package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
  246. package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
  247. package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
  248. package/lib/module/games/space-fighter/components/index.js +1 -9
  249. package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
  250. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  251. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
  252. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
  253. package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
  254. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
  255. package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
  256. package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
  257. package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
  258. package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
  259. package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
  260. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
  261. package/lib/module/games/whack-a-mole/components/index.js +1 -8
  262. package/lib/module/helpers/AnimationFrame.js +1 -120
  263. package/lib/module/helpers/AnimationTracker.js +1 -89
  264. package/lib/module/helpers/ErrorHandler.js +1 -269
  265. package/lib/module/helpers/GameControlButton.js +1 -219
  266. package/lib/module/helpers/GameOverModal.js +1 -144
  267. package/lib/module/helpers/GameOverModal.js.map +1 -1
  268. package/lib/module/helpers/GameSettingsModal.js +1 -287
  269. package/lib/module/helpers/GameSettingsModal.js.map +1 -1
  270. package/lib/module/helpers/ParticleBlast.js +1 -134
  271. package/lib/module/helpers/ScoreBoardContainer.js +1 -34
  272. package/lib/module/helpers/ScoreBoardContainer.js.map +1 -1
  273. package/lib/module/helpers/index.js +1 -12
  274. package/lib/module/index.js +1 -22
  275. package/lib/module/index.js.map +1 -1
  276. package/lib/module/services/GamesConstants.js +1 -178
  277. package/lib/module/services/GamesConstants.js.map +1 -1
  278. package/lib/module/services/GamesService.js +1 -112
  279. package/lib/module/services/GamesService.js.map +1 -1
  280. package/lib/module/services/HapticsService.js +1 -77
  281. package/lib/module/services/ScoringService.js +1 -0
  282. package/lib/module/services/ScoringService.js.map +1 -0
  283. package/lib/module/services/SoundsService.js +1 -302
  284. package/lib/module/services/SoundsService.js.map +1 -1
  285. package/lib/module/services/UtilsService.js +1 -32
  286. package/lib/module/services/UtilsService.js.map +1 -1
  287. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  288. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +1 -1
  289. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  290. package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts +4 -0
  291. package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts.map +1 -0
  292. package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts +76 -0
  293. package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts.map +1 -0
  294. package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts +22 -0
  295. package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts.map +1 -0
  296. package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts +72 -0
  297. package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts.map +1 -0
  298. package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts +12 -0
  299. package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts.map +1 -0
  300. package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts +9 -0
  301. package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts.map +1 -0
  302. package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts +7 -0
  303. package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts.map +1 -0
  304. package/lib/typescript/src/games/bike-racing/components/index.d.ts +4 -0
  305. package/lib/typescript/src/games/bike-racing/components/index.d.ts.map +1 -0
  306. package/lib/typescript/src/games/bike-racing/index.d.ts +5 -0
  307. package/lib/typescript/src/games/bike-racing/index.d.ts.map +1 -0
  308. package/lib/typescript/src/games/block-blast/BlockBlast.d.ts +4 -0
  309. package/lib/typescript/src/games/block-blast/BlockBlast.d.ts.map +1 -0
  310. package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts +82 -0
  311. package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts.map +1 -0
  312. package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts +17 -0
  313. package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts.map +1 -0
  314. package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts +62 -0
  315. package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts.map +1 -0
  316. package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts +14 -0
  317. package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts.map +1 -0
  318. package/lib/typescript/src/games/block-blast/components/GameArea.d.ts +12 -0
  319. package/lib/typescript/src/games/block-blast/components/GameArea.d.ts.map +1 -0
  320. package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts +7 -0
  321. package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts.map +1 -0
  322. package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts +17 -0
  323. package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts.map +1 -0
  324. package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts +7 -0
  325. package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts.map +1 -0
  326. package/lib/typescript/src/games/block-blast/components/index.d.ts +6 -0
  327. package/lib/typescript/src/games/block-blast/components/index.d.ts.map +1 -0
  328. package/lib/typescript/src/games/block-blast/index.d.ts +5 -0
  329. package/lib/typescript/src/games/block-blast/index.d.ts.map +1 -0
  330. package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts +4 -0
  331. package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts.map +1 -0
  332. package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts +61 -0
  333. package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts.map +1 -0
  334. package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts +26 -0
  335. package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts.map +1 -0
  336. package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts +62 -0
  337. package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts.map +1 -0
  338. package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts +9 -0
  339. package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts.map +1 -0
  340. package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts +8 -0
  341. package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts.map +1 -0
  342. package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts +7 -0
  343. package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts.map +1 -0
  344. package/lib/typescript/src/games/bubble-shooter/components/index.d.ts +4 -0
  345. package/lib/typescript/src/games/bubble-shooter/components/index.d.ts.map +1 -0
  346. package/lib/typescript/src/games/bubble-shooter/index.d.ts +3 -0
  347. package/lib/typescript/src/games/bubble-shooter/index.d.ts.map +1 -0
  348. package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts.map +1 -1
  349. package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
  350. package/lib/typescript/src/games/car-racing/CarRacing.d.ts +4 -0
  351. package/lib/typescript/src/games/car-racing/CarRacing.d.ts.map +1 -0
  352. package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts +76 -0
  353. package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts.map +1 -0
  354. package/lib/typescript/src/games/car-racing/CarRacingService.d.ts +22 -0
  355. package/lib/typescript/src/games/car-racing/CarRacingService.d.ts.map +1 -0
  356. package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts +72 -0
  357. package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts.map +1 -0
  358. package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts +13 -0
  359. package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts.map +1 -0
  360. package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts +9 -0
  361. package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts.map +1 -0
  362. package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts +7 -0
  363. package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts.map +1 -0
  364. package/lib/typescript/src/games/car-racing/components/index.d.ts +4 -0
  365. package/lib/typescript/src/games/car-racing/components/index.d.ts.map +1 -0
  366. package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
  367. package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
  368. package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
  369. package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
  370. package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
  371. package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
  372. package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
  373. package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
  374. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  375. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
  376. package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
  377. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  378. package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts +4 -0
  379. package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts.map +1 -0
  380. package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts +81 -0
  381. package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts.map +1 -0
  382. package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts +14 -0
  383. package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts.map +1 -0
  384. package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts +40 -0
  385. package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts.map +1 -0
  386. package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts +9 -0
  387. package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts.map +1 -0
  388. package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts +8 -0
  389. package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts.map +1 -0
  390. package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts +7 -0
  391. package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts.map +1 -0
  392. package/lib/typescript/src/games/perfect-circle/index.d.ts +3 -0
  393. package/lib/typescript/src/games/perfect-circle/index.d.ts.map +1 -0
  394. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  395. package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
  396. package/lib/typescript/src/games/snake/Snake.d.ts.map +1 -1
  397. package/lib/typescript/src/games/snake/SnakeStore.d.ts +4 -0
  398. package/lib/typescript/src/games/snake/SnakeStore.d.ts.map +1 -1
  399. package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts.map +1 -1
  400. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  401. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  402. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
  403. package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
  404. package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
  405. package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
  406. package/lib/typescript/src/helpers/ScoreBoardContainer.d.ts.map +1 -1
  407. package/lib/typescript/src/index.d.ts +6 -1
  408. package/lib/typescript/src/index.d.ts.map +1 -1
  409. package/lib/typescript/src/services/GamesConstants.d.ts +57 -7
  410. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  411. package/lib/typescript/src/services/GamesService.d.ts +2 -1
  412. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  413. package/lib/typescript/src/services/ScoringService.d.ts +2 -0
  414. package/lib/typescript/src/services/ScoringService.d.ts.map +1 -0
  415. package/lib/typescript/src/services/SoundsService.d.ts +88 -0
  416. package/lib/typescript/src/services/SoundsService.d.ts.map +1 -1
  417. package/lib/typescript/src/services/UtilsService.d.ts +12 -1
  418. package/lib/typescript/src/services/UtilsService.d.ts.map +1 -1
  419. package/package.json +2 -2
@@ -1,113 +1 @@
1
- "use strict";
2
-
3
- // Popit Fidget Game Constants
4
- export const POPIT_FIDGET_GAME_CONFIG = {
5
- GAME_DURATION: 120,
6
- // seconds
7
- POINTS_PER_BUBBLE: 10,
8
- COMPLETION_BONUS: 500,
9
- TIME_BONUS_MULTIPLIER: 5,
10
- BUBBLE_SIZE: 40,
11
- ANIMATION_DURATION: 300,
12
- PARTICLE_COUNT: 4,
13
- // Reduced for better performance
14
- PARTICLE_LIFETIME: 800,
15
- // Difficulty-based square grid sizes
16
- GRID_SIZES: {
17
- easy: 5,
18
- // 5x5 = 25 bubbles
19
- medium: 6,
20
- // 6x6 = 36 bubbles
21
- hard: 7 // 7x7 = 49 bubbles
22
- }
23
- };
24
- export const POPIT_FIDGET_ANIMATION_CONFIG = {
25
- POP_SCALE: 1.3,
26
- POP_DURATION: 200,
27
- FADE_DURATION: 300,
28
- BOUNCE_SCALE: 0.9,
29
- PARTICLE_VELOCITY: 3,
30
- PARTICLE_GRAVITY: 0.2
31
- };
32
- export const POPIT_FIDGET_COLORS = {
33
- BACKGROUND: '#f5f5f5',
34
- // Light gray background
35
- FIDGET_BORDER: '#333',
36
- FIDGET_SHADOW: 'rgba(0,0,0,0.3)',
37
- SCORE: '#4a90e2',
38
- UI: '#6c5ce7',
39
- POPPED_BUBBLE: '#d0d0d0',
40
- PARTICLE_GLOW: 'rgba(255,255,255,0.9)',
41
- // Pop It fidget toy colors - rainbow gradient
42
- FIDGET_BASE: '#ffffff',
43
- BUBBLE_SHADOW: 'rgba(0,0,0,0.2)',
44
- BUBBLE_HIGHLIGHT: 'rgba(255,255,255,0.6)'
45
- };
46
-
47
- // Rainbow gradient colors for authentic Pop It fidget toy look - enhanced vibrancy
48
- export const RAINBOW_COLORS = ['#E91E63',
49
- // Vibrant pink/magenta (like image)
50
- '#F44336',
51
- // Bright red
52
- '#FF5722',
53
- // Deep orange
54
- '#FF9800',
55
- // Orange
56
- '#FFC107',
57
- // Amber/yellow
58
- '#8E24AA',
59
- // Deep purple
60
- '#CDDC39',
61
- // Lime
62
- '#8BC34A',
63
- // Light green
64
- '#4CAF50',
65
- // Green
66
- '#009688',
67
- // Teal
68
- '#00BCD4',
69
- // Cyan
70
- '#03A9F4',
71
- // Light blue
72
- '#2196F3',
73
- // Blue
74
- '#3F51B5',
75
- // Indigo
76
- '#9C27B0',
77
- // Purple
78
- '#E91E63' // Back to vibrant pink for seamless loop
79
- ];
80
-
81
- // Legacy bubble colors for backward compatibility
82
- export const BUBBLE_COLORS = RAINBOW_COLORS;
83
-
84
- // Popit Fidget Game Theme - Matches scoreboard purple
85
- export const POPIT_FIDGET_THEME = {
86
- backgroundColor: '#fef7ff',
87
- // Very light lavender to match game background
88
- headerBackgroundColor: 'rgba(108, 92, 231, 0.9)',
89
- // Purple header to match scoreboard
90
- headerTextColor: '#ffffff',
91
- sectionBackgroundColor: 'rgba(108, 92, 231, 0.4)',
92
- // Match scoreboard transparency
93
- sectionTitleColor: '#ffffff',
94
- // White text on purple sections
95
- buttonSelectedColor: '#9c27b0',
96
- // Match start button purple
97
- buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
98
- buttonSelectedTextColor: '#ffffff',
99
- buttonUnselectedTextColor: '#1f2937',
100
- switchTrackColorFalse: 'rgba(108, 92, 231, 0.5)',
101
- switchTrackColorTrue: '#9c27b0',
102
- // Match start button
103
- switchThumbColor: '#ffffff',
104
- infoTextColor: '#1f2937' // Dark text for readability
105
- };
106
-
107
- // Popit Fidget Difficulty Descriptions
108
- export const POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS = {
109
- easy: 'Smaller fidget grids, relaxing pace',
110
- medium: 'Medium grids, satisfying pops',
111
- hard: 'Large complex shapes, ultimate satisfaction!'
112
- };
113
- //# sourceMappingURL=PopitFidgetConstants.js.map
1
+ "use strict";export const POPIT_FIDGET_GAME_CONFIG ={GAME_DURATION:120,POINTS_PER_BUBBLE:10,COMPLETION_BONUS:500,TIME_BONUS_MULTIPLIER:5,BUBBLE_SIZE:40,ANIMATION_DURATION:300,PARTICLE_COUNT:4,PARTICLE_LIFETIME:800,GRID_SIZES:{easy:5,medium:6,hard:7}};export const POPIT_FIDGET_ANIMATION_CONFIG ={POP_SCALE:1.3,POP_DURATION:200,FADE_DURATION:300,BOUNCE_SCALE:0.9,PARTICLE_VELOCITY:3,PARTICLE_GRAVITY:0.2};export const POPIT_FIDGET_COLORS ={BACKGROUND:'#f5f5f5',FIDGET_BORDER:'#333',FIDGET_SHADOW:'rgba(0,0,0,0.3)',SCORE:'#4a90e2',UI:'#6c5ce7',POPPED_BUBBLE:'#d0d0d0',PARTICLE_GLOW:'rgba(255,255,255,0.9)',FIDGET_BASE:'#ffffff',BUBBLE_SHADOW:'rgba(0,0,0,0.2)',BUBBLE_HIGHLIGHT:'rgba(255,255,255,0.6)'};export const RAINBOW_COLORS = ['#E91E63','#F44336','#FF5722','#FF9800','#FFC107','#8E24AA','#CDDC39','#8BC34A','#4CAF50','#009688','#00BCD4','#03A9F4','#2196F3','#3F51B5','#9C27B0','#E91E63' ];export const BUBBLE_COLORS = RAINBOW_COLORS;export const POPIT_FIDGET_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#9c27b0',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(156,39,176,0.15)',sectionTitleColor:'#9c27b0',buttonSelectedColor:'#9c27b0',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(156,39,176,0.3)',switchTrackColorTrue:'#9c27b0',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS ={easy:'Smaller fidget grids,relaxing pace',medium:'Medium grids,satisfying pops',hard:'Large complex shapes,ultimate satisfaction!'};
@@ -1 +1 @@
1
- {"version":3,"names":["POPIT_FIDGET_GAME_CONFIG","GAME_DURATION","POINTS_PER_BUBBLE","COMPLETION_BONUS","TIME_BONUS_MULTIPLIER","BUBBLE_SIZE","ANIMATION_DURATION","PARTICLE_COUNT","PARTICLE_LIFETIME","GRID_SIZES","easy","medium","hard","POPIT_FIDGET_ANIMATION_CONFIG","POP_SCALE","POP_DURATION","FADE_DURATION","BOUNCE_SCALE","PARTICLE_VELOCITY","PARTICLE_GRAVITY","POPIT_FIDGET_COLORS","BACKGROUND","FIDGET_BORDER","FIDGET_SHADOW","SCORE","UI","POPPED_BUBBLE","PARTICLE_GLOW","FIDGET_BASE","BUBBLE_SHADOW","BUBBLE_HIGHLIGHT","RAINBOW_COLORS","BUBBLE_COLORS","POPIT_FIDGET_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/popit-fidget/PopitFidgetConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,aAAa,EAAE,GAAG;EAAE;EACpBC,iBAAiB,EAAE,EAAE;EACrBC,gBAAgB,EAAE,GAAG;EACrBC,qBAAqB,EAAE,CAAC;EACxBC,WAAW,EAAE,EAAE;EACfC,kBAAkB,EAAE,GAAG;EACvBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG;EACtB;EACAC,UAAU,EAAE;IACVC,IAAI,EAAE,CAAC;IAAK;IACZC,MAAM,EAAE,CAAC;IAAG;IACZC,IAAI,EAAE,CAAC,CAAK;EACd;AACF,CAAU;AAEV,OAAO,MAAMC,6BAA6B,GAAG;EAC3CC,SAAS,EAAE,GAAG;EACdC,YAAY,EAAE,GAAG;EACjBC,aAAa,EAAE,GAAG;EAClBC,YAAY,EAAE,GAAG;EACjBC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE;AACpB,CAAU;AAEV,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,UAAU,EAAE,SAAS;EAAE;EACvBC,aAAa,EAAE,MAAM;EACrBC,aAAa,EAAE,iBAAiB;EAChCC,KAAK,EAAE,SAAS;EAChBC,EAAE,EAAE,SAAS;EACbC,aAAa,EAAE,SAAS;EACxBC,aAAa,EAAE,uBAAuB;EACtC;EACAC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,iBAAiB;EAChCC,gBAAgB,EAAE;AACpB,CAAU;;AAEV;AACA,OAAO,MAAMC,cAAc,GAAG,CAC5B,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS,CAAE;AAAA,CACH;;AAEV;AACA,OAAO,MAAMC,aAAa,GAAGD,cAAc;;AAE3C;AACA,OAAO,MAAME,kBAAqC,GAAG;EACnDC,eAAe,EAAE,SAAS;EAAE;EAC5BC,qBAAqB,EAAE,yBAAyB;EAAE;EAClDC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,yBAAyB;EAAE;EACnDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,SAAS;EACpCC,qBAAqB,EAAE,yBAAyB;EAChDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,SAAS,CAAE;AAC5B,CAAC;;AAED;AACA,OAAO,MAAMC,oCAAoC,GAAG;EAClDrC,IAAI,EAAE,qCAAqC;EAC3CC,MAAM,EAAE,+BAA+B;EACvCC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["POPIT_FIDGET_GAME_CONFIG","GAME_DURATION","POINTS_PER_BUBBLE","COMPLETION_BONUS","TIME_BONUS_MULTIPLIER","BUBBLE_SIZE","ANIMATION_DURATION","PARTICLE_COUNT","PARTICLE_LIFETIME","GRID_SIZES","easy","medium","hard","POPIT_FIDGET_ANIMATION_CONFIG","POP_SCALE","POP_DURATION","FADE_DURATION","BOUNCE_SCALE","PARTICLE_VELOCITY","PARTICLE_GRAVITY","POPIT_FIDGET_COLORS","BACKGROUND","FIDGET_BORDER","FIDGET_SHADOW","SCORE","UI","POPPED_BUBBLE","PARTICLE_GLOW","FIDGET_BASE","BUBBLE_SHADOW","BUBBLE_HIGHLIGHT","RAINBOW_COLORS","BUBBLE_COLORS","POPIT_FIDGET_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","POPIT_FIDGET_DIFFICULTY_DESCRIPTIONS"],"sourceRoot":"../../../../src","sources":["games/popit-fidget/PopitFidgetConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,wBAAwB,GAAG;EACtCC,aAAa,EAAE,GAAG;EAAE;EACpBC,iBAAiB,EAAE,EAAE;EACrBC,gBAAgB,EAAE,GAAG;EACrBC,qBAAqB,EAAE,CAAC;EACxBC,WAAW,EAAE,EAAE;EACfC,kBAAkB,EAAE,GAAG;EACvBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG;EACtB;EACAC,UAAU,EAAE;IACVC,IAAI,EAAE,CAAC;IAAK;IACZC,MAAM,EAAE,CAAC;IAAG;IACZC,IAAI,EAAE,CAAC,CAAK;EACd;AACF,CAAU;AAEV,OAAO,MAAMC,6BAA6B,GAAG;EAC3CC,SAAS,EAAE,GAAG;EACdC,YAAY,EAAE,GAAG;EACjBC,aAAa,EAAE,GAAG;EAClBC,YAAY,EAAE,GAAG;EACjBC,iBAAiB,EAAE,CAAC;EACpBC,gBAAgB,EAAE;AACpB,CAAU;AAEV,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,UAAU,EAAE,SAAS;EAAE;EACvBC,aAAa,EAAE,MAAM;EACrBC,aAAa,EAAE,iBAAiB;EAChCC,KAAK,EAAE,SAAS;EAChBC,EAAE,EAAE,SAAS;EACbC,aAAa,EAAE,SAAS;EACxBC,aAAa,EAAE,uBAAuB;EACtC;EACAC,WAAW,EAAE,SAAS;EACtBC,aAAa,EAAE,iBAAiB;EAChCC,gBAAgB,EAAE;AACpB,CAAU;;AAEV;AACA,OAAO,MAAMC,cAAc,GAAG,CAC5B,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS,CAAE;AAAA,CACH;;AAEV;AACA,OAAO,MAAMC,aAAa,GAAGD,cAAc;;AAE3C;AACA,OAAO,MAAME,kBAAqC,GAAG;EACnDC,eAAe,EAAE,oBAAoB;EAAE;EACvCC,qBAAqB,EAAE,SAAS;EAAE;EAClCC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,0BAA0B;EAAE;EACpDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,0BAA0B;EAAE;EACvDC,qBAAqB,EAAE,yBAAyB;EAChDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,0BAA0B,CAAE;AAC7C,CAAC;;AAED;AACA,OAAO,MAAMC,oCAAoC,GAAG;EAClDrC,IAAI,EAAE,qCAAqC;EAC3CC,MAAM,EAAE,+BAA+B;EACvCC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
@@ -1,132 +1 @@
1
- "use strict";
2
-
3
- import { Dimensions } from 'react-native';
4
- import { POPIT_FIDGET_GAME_CONFIG as GAME_CONFIG, POPIT_FIDGET_ANIMATION_CONFIG as ANIMATION_CONFIG, POPIT_FIDGET_COLORS as COLORS, RAINBOW_COLORS, BUBBLE_COLORS } from "./PopitFidgetConstants.js";
5
- const {
6
- width,
7
- height
8
- } = Dimensions.get('window');
9
-
10
- // Constants now imported from PopitFidgetConstants.ts
11
- // Re-export for backward compatibility
12
- export { GAME_CONFIG, ANIMATION_CONFIG, COLORS, BUBBLE_COLORS };
13
-
14
- // Types - Simplified to always use square grids
15
-
16
- export class PopitFidgetService {
17
- gameTimerRef = null;
18
- constructor() {}
19
-
20
- // Generate square fidget grid based on difficulty
21
- generateFidgetGrid(difficulty) {
22
- const availableWidth = width * 0.85; // Match PopitFidget component calculation
23
- const availableHeight = height * 0.6; // Match PopitFidget component calculation
24
-
25
- // Get grid size from difficulty-based configuration
26
- const gridSize = GAME_CONFIG.GRID_SIZES[difficulty];
27
-
28
- // Use same bubble size calculation as PopitFidget component
29
- const maxSize = Math.min(availableWidth / gridSize, availableHeight / gridSize);
30
- const bubbleSize = Math.max(45, Math.min(80, maxSize * 0.9));
31
-
32
- // Calculate grid dimensions with proper spacing
33
- const spacing = bubbleSize * 1.1;
34
- const gridWidth = (gridSize - 1) * spacing + bubbleSize;
35
- const gridHeight = (gridSize - 1) * spacing + bubbleSize;
36
- const bubbles = [];
37
-
38
- // Generate square grid - all bubbles are included (no shape filtering)
39
- for (let row = 0; row < gridSize; row++) {
40
- bubbles[row] = [];
41
- for (let col = 0; col < gridSize; col++) {
42
- // Position bubbles with proper spacing to prevent overlap
43
- const x = col * spacing + bubbleSize / 2;
44
- const y = row * spacing + bubbleSize / 2;
45
- bubbles[row][col] = {
46
- id: `${row}-${col}`,
47
- row,
48
- col,
49
- x,
50
- y,
51
- isPopped: false,
52
- color: this.getRainbowColorForPosition(row, gridSize),
53
- animationProgress: 0
54
- };
55
- }
56
- }
57
- return {
58
- size: gridSize,
59
- bubbles,
60
- centerX: gridWidth / 2,
61
- centerY: gridHeight / 2,
62
- width: gridWidth,
63
- height: gridHeight
64
- };
65
- }
66
-
67
- // Get rainbow gradient color based on row position for authentic Pop It look
68
- getRainbowColorForPosition(row, totalRows) {
69
- // Create rainbow gradient effect like real Pop It fidget toys
70
- const colorIndex = Math.floor(row / totalRows * RAINBOW_COLORS.length);
71
- return RAINBOW_COLORS[colorIndex] || RAINBOW_COLORS[0];
72
- }
73
-
74
- // Check if all bubbles are popped
75
- checkAllBubblesPopped(grid) {
76
- for (let row = 0; row < grid.size; row++) {
77
- for (let col = 0; col < grid.size; col++) {
78
- const bubble = grid.bubbles[row]?.[col];
79
- if (bubble && !bubble.isPopped) {
80
- return false;
81
- }
82
- }
83
- }
84
- return true;
85
- }
86
-
87
- // Calculate completion percentage
88
- calculateCompletionPercentage(grid) {
89
- let totalBubbles = 0;
90
- let poppedBubbles = 0;
91
- for (let row = 0; row < grid.size; row++) {
92
- for (let col = 0; col < grid.size; col++) {
93
- const bubble = grid.bubbles[row]?.[col];
94
- if (bubble) {
95
- totalBubbles++;
96
- if (bubble.isPopped) {
97
- poppedBubbles++;
98
- }
99
- }
100
- }
101
- }
102
- return totalBubbles > 0 ? poppedBubbles / totalBubbles * 100 : 0;
103
- }
104
-
105
- // Start game timer
106
- startGameTimer(duration, onTick, onComplete) {
107
- this.stopGameTimer();
108
- let timeLeft = duration;
109
- this.gameTimerRef = setInterval(() => {
110
- timeLeft -= 1;
111
- onTick(timeLeft);
112
- if (timeLeft <= 0) {
113
- this.stopGameTimer();
114
- onComplete();
115
- }
116
- }, 1000);
117
- }
118
-
119
- // Stop game timer
120
- stopGameTimer() {
121
- if (this.gameTimerRef) {
122
- clearInterval(this.gameTimerRef);
123
- this.gameTimerRef = null;
124
- }
125
- }
126
-
127
- // Cleanup
128
- cleanup() {
129
- this.stopGameTimer();
130
- }
131
- }
132
- //# sourceMappingURL=PopitFidgetService.js.map
1
+ "use strict";import{Dimensions}from 'react-native';import{POPIT_FIDGET_GAME_CONFIG as GAME_CONFIG,POPIT_FIDGET_ANIMATION_CONFIG as ANIMATION_CONFIG,POPIT_FIDGET_COLORS as COLORS,RAINBOW_COLORS,BUBBLE_COLORS}from "./PopitFidgetConstants.js";const{width,height}= Dimensions.get('window');export{GAME_CONFIG,ANIMATION_CONFIG,COLORS,BUBBLE_COLORS};export class PopitFidgetService{gameTimerRef = null;constructor(){}generateFidgetGrid(difficulty){const availableWidth = width * 0.85;const availableHeight = height * 0.6;const gridSize = GAME_CONFIG.GRID_SIZES[difficulty];const maxSize = Math.min(availableWidth / gridSize,availableHeight / gridSize);const bubbleSize = Math.max(45,Math.min(80,maxSize * 0.9));const spacing = bubbleSize * 1.1;const gridWidth =(gridSize - 1)* spacing + bubbleSize;const gridHeight =(gridSize - 1)* spacing + bubbleSize;const bubbles = [];for(let row = 0;row < gridSize;row++){bubbles[row] = [];for(let col = 0;col < gridSize;col++){const x = col * spacing + bubbleSize / 2;const y = row * spacing + bubbleSize / 2;bubbles[row][col] ={id:`${row}-${col}`,row,col,x,y,isPopped:false,color:this.getRainbowColorForPosition(row,gridSize),animationProgress:0};}}return{size:gridSize,bubbles,centerX:gridWidth / 2,centerY:gridHeight / 2,width:gridWidth,height:gridHeight};}getRainbowColorForPosition(row,totalRows){const colorIndex = Math.floor(row / totalRows * RAINBOW_COLORS.length);return RAINBOW_COLORS[colorIndex] || RAINBOW_COLORS[0];}checkAllBubblesPopped(grid){for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble && !bubble.isPopped){return false;}}}return true;}calculateCompletionPercentage(grid){let totalBubbles = 0;let poppedBubbles = 0;for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble){totalBubbles++;if(bubble.isPopped){poppedBubbles++;}}}}return totalBubbles > 0 ? poppedBubbles / totalBubbles * 100:0;}startGameTimer(duration,onTick,onComplete){this.stopGameTimer();let timeLeft = duration;this.gameTimerRef = setInterval(()=>{timeLeft -= 1;onTick(timeLeft);if(timeLeft <= 0){this.stopGameTimer();onComplete();}},1000);}stopGameTimer(){if(this.gameTimerRef){clearInterval(this.gameTimerRef);this.gameTimerRef = null;}}cleanup(){this.stopGameTimer();}}
@@ -1,125 +1 @@
1
- "use strict";
2
-
3
- import { create } from 'zustand';
4
- import { subscribeWithSelector } from 'zustand/middleware';
5
- import { immerMiddleware } from "../../services/UtilsService.js";
6
- // Optimized store with selective subscriptions for low-end devices
7
- export const usePopitFidgetStore = create()(subscribeWithSelector(immerMiddleware((set, get) => ({
8
- // Initial state
9
- timeElapsed: 0,
10
- isPlaying: false,
11
- gameOver: false,
12
- gameWon: false,
13
- fidgetGrid: null,
14
- bubblesPopped: 0,
15
- totalBubbles: 0,
16
- bubbleStates: {},
17
- // Actions
18
- startGame: _gameDuration => {
19
- set(draft => {
20
- draft.isPlaying = true;
21
- draft.gameOver = false;
22
- draft.gameWon = false;
23
- draft.timeElapsed = 0;
24
- draft.bubblesPopped = 0;
25
- });
26
- },
27
- stopGame: () => {
28
- set(draft => {
29
- draft.isPlaying = false;
30
- draft.gameOver = true;
31
- });
32
- },
33
- resetGame: () => {
34
- set(draft => {
35
- draft.timeElapsed = 0;
36
- draft.isPlaying = false;
37
- draft.gameOver = false;
38
- draft.gameWon = false;
39
- draft.fidgetGrid = null;
40
- draft.bubblesPopped = 0;
41
- draft.totalBubbles = 0;
42
- });
43
- },
44
- setFidgetGrid: grid => {
45
- // For square grids, total bubbles = size * size
46
- const totalCount = grid.size * grid.size;
47
- set(draft => {
48
- draft.fidgetGrid = grid;
49
- draft.totalBubbles = totalCount;
50
- draft.bubblesPopped = 0;
51
-
52
- // Initialize bubble states for all bubbles
53
- draft.bubbleStates = {};
54
- for (let row = 0; row < grid.size; row++) {
55
- for (let col = 0; col < grid.size; col++) {
56
- const bubble = grid.bubbles[row]?.[col];
57
- if (bubble) {
58
- draft.bubbleStates[bubble.id] = {
59
- isPopped: bubble.isPopped || false,
60
- popTime: bubble.popTime
61
- };
62
- }
63
- }
64
- }
65
- });
66
- },
67
- popBubble: (row, col) => {
68
- set(draft => {
69
- if (!draft.fidgetGrid) return;
70
- const bubble = draft.fidgetGrid.bubbles[row]?.[col];
71
- if (!bubble) return;
72
-
73
- // Check if bubble is already popped using bubbleStates
74
- const bubbleState = draft.bubbleStates[bubble.id];
75
- if (bubbleState?.isPopped) return;
76
-
77
- // Update only the bubbleStates, not the fidgetGrid
78
- // This prevents the entire fidgetGrid array from changing references
79
- draft.bubbleStates[bubble.id] = {
80
- isPopped: true,
81
- popTime: Date.now()
82
- };
83
- draft.bubblesPopped = draft.bubblesPopped + 1;
84
- });
85
-
86
- // Check if game is won (only if actively playing)
87
- const state = get();
88
- if (state.isPlaying) {
89
- get().checkGameWon();
90
- }
91
- },
92
- incrementTime: () => {
93
- set(draft => {
94
- draft.timeElapsed = draft.timeElapsed + 1;
95
- });
96
- },
97
- checkGameWon: () => {
98
- const state = get();
99
- if (!state.fidgetGrid) return;
100
-
101
- // Check if all bubbles are popped using bubbleStates
102
- let allPopped = true;
103
- for (let row = 0; row < state.fidgetGrid.size; row++) {
104
- for (let col = 0; col < state.fidgetGrid.size; col++) {
105
- const bubble = state.fidgetGrid.bubbles[row]?.[col];
106
- if (bubble) {
107
- const bubbleState = state.bubbleStates[bubble.id];
108
- if (!bubbleState?.isPopped) {
109
- allPopped = false;
110
- break;
111
- }
112
- }
113
- }
114
- if (!allPopped) break;
115
- }
116
- if (allPopped && state.isPlaying) {
117
- set(draft => {
118
- draft.isPlaying = false;
119
- draft.gameWon = true;
120
- draft.gameOver = true;
121
- });
122
- }
123
- }
124
- }))));
125
- //# sourceMappingURL=PopitFidgetStore.js.map
1
+ "use strict";import{create}from 'zustand';import{subscribeWithSelector}from 'zustand/middleware';import{immerMiddleware}from "../../services/UtilsService.js";export const usePopitFidgetStore = create()(subscribeWithSelector(immerMiddleware((set,get)=>({timeElapsed:0,isPlaying:false,gameOver:false,gameWon:false,fidgetGrid:null,bubblesPopped:0,totalBubbles:0,bubbleStates:{},startGame:_gameDuration =>{set(draft =>{draft.isPlaying = true;draft.gameOver = false;draft.gameWon = false;draft.timeElapsed = 0;draft.bubblesPopped = 0;});},stopGame:()=>{set(draft =>{draft.isPlaying = false;draft.gameOver = true;});},resetGame:()=>{set(draft =>{draft.timeElapsed = 0;draft.isPlaying = false;draft.gameOver = false;draft.gameWon = false;draft.fidgetGrid = null;draft.bubblesPopped = 0;draft.totalBubbles = 0;});},setFidgetGrid:grid =>{const totalCount = grid.size * grid.size;set(draft =>{draft.fidgetGrid = grid;draft.totalBubbles = totalCount;draft.bubblesPopped = 0;draft.bubbleStates ={};for(let row = 0;row < grid.size;row++){for(let col = 0;col < grid.size;col++){const bubble = grid.bubbles[row]?.[col];if(bubble){draft.bubbleStates[bubble.id] ={isPopped:bubble.isPopped || false,popTime:bubble.popTime};}}}});},popBubble:(row,col)=>{set(draft =>{if(!draft.fidgetGrid)return;const bubble = draft.fidgetGrid.bubbles[row]?.[col];if(!bubble)return;const bubbleState = draft.bubbleStates[bubble.id];if(bubbleState?.isPopped)return;draft.bubbleStates[bubble.id] ={isPopped:true,popTime:Date.now()};draft.bubblesPopped = draft.bubblesPopped + 1;});const state = get();if(state.isPlaying){get().checkGameWon();}},incrementTime:()=>{set(draft =>{draft.timeElapsed = draft.timeElapsed + 1;});},checkGameWon:()=>{const state = get();if(!state.fidgetGrid)return;let allPopped = true;for(let row = 0;row < state.fidgetGrid.size;row++){for(let col = 0;col < state.fidgetGrid.size;col++){const bubble = state.fidgetGrid.bubbles[row]?.[col];if(bubble){const bubbleState = state.bubbleStates[bubble.id];if(!bubbleState?.isPopped){allPopped = false;break;}}}if(!allPopped)break;}if(allPopped && state.isPlaying){set(draft =>{draft.isPlaying = false;draft.gameWon = true;draft.gameOver = true;});}}}))));
@@ -1,198 +1 @@
1
- "use strict";
2
-
3
- import React, { useState, useCallback, useMemo } from 'react';
4
- import { View, TouchableOpacity } from 'react-native';
5
- import { Canvas, Circle, LinearGradient, vec, Shadow } from '@shopify/react-native-skia';
6
- import { playHaptic, HapticType } from "../../../services/HapticsService.js";
7
- import { usePopitFidgetStore } from "../PopitFidgetStore.js";
8
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
- const BubbleComponent = ({
10
- bubble,
11
- size,
12
- onPop,
13
- hapticEnabled = true,
14
- isPlaying
15
- }) => {
16
- // Get bubble state from store to prevent re-renders when other bubbles change
17
- const bubbleState = usePopitFidgetStore(state => state.bubbleStates[bubble.id]);
18
- const isPopped = bubbleState?.isPopped || false;
19
- // Simple state for press feedback - no animations to prevent crashes
20
- const [isPressed, setIsPressed] = useState(false);
21
-
22
- // Memoize callbacks to prevent unnecessary re-renders
23
- const handlePop = useCallback(() => {
24
- // Only allow popping when game is actively playing
25
- if (!isPlaying || isPopped) return;
26
-
27
- // Enhanced haptic feedback - stronger for more satisfaction
28
- playHaptic(HapticType.MEDIUM, hapticEnabled || false);
29
-
30
- // Trigger pop callback
31
- onPop();
32
- }, [onPop, hapticEnabled, isPlaying, isPopped]);
33
- const handlePressIn = useCallback(() => {
34
- if (!isPopped && isPlaying) {
35
- setIsPressed(true);
36
- // Haptic feedback on press
37
- playHaptic(HapticType.LIGHT, hapticEnabled || false);
38
- }
39
- }, [isPopped, isPlaying, hapticEnabled]);
40
- const handlePressOut = useCallback(() => {
41
- setIsPressed(false);
42
- }, []);
43
-
44
- // Memoize bubble style to prevent recalculation
45
- const bubbleStyle = useMemo(() => ({
46
- position: 'absolute',
47
- left: bubble.x - size / 2,
48
- top: bubble.y - size / 2,
49
- width: size,
50
- height: size,
51
- transform: [{
52
- scale: isPressed ? 0.95 : 1
53
- }]
54
- }), [bubble.x, bubble.y, size, isPressed]);
55
-
56
- // Simplified popped state rendering
57
- if (isPopped) {
58
- return /*#__PURE__*/_jsx(View, {
59
- style: bubbleStyle,
60
- children: /*#__PURE__*/_jsxs(Canvas, {
61
- style: {
62
- width: size,
63
- height: size
64
- },
65
- children: [/*#__PURE__*/_jsx(Circle, {
66
- cx: size / 2,
67
- cy: size / 2,
68
- r: size / 2,
69
- color: bubble.color,
70
- children: /*#__PURE__*/_jsx(LinearGradient, {
71
- start: vec(0, 0),
72
- end: vec(size, size),
73
- colors: [`${bubble.color}60`,
74
- // Muted to show flatness
75
- `${bubble.color}40`,
76
- // More muted
77
- `${bubble.color}30` // Very muted to show depression
78
- ]
79
- })
80
- }), /*#__PURE__*/_jsx(Circle, {
81
- cx: size / 2,
82
- cy: size / 2 + 1,
83
- r: size / 2 - 6,
84
- color: bubble.color,
85
- children: /*#__PURE__*/_jsx(LinearGradient, {
86
- start: vec(size * 0.7, size * 0.7),
87
- end: vec(size * 0.3, size * 0.3),
88
- colors: ['#FFFFFF30',
89
- // Light highlight
90
- `${bubble.color}80`,
91
- // Bubble color
92
- '#00000020' // Subtle shadow
93
- ]
94
- })
95
- }), /*#__PURE__*/_jsx(Circle, {
96
- cx: size / 2 + size * 0.15,
97
- cy: size / 2 + size * 0.2,
98
- r: size * 0.06,
99
- color: "#FFFFFF",
100
- opacity: 0.6
101
- })]
102
- })
103
- });
104
- }
105
-
106
- // Simplified unpopped bubble rendering with TouchableOpacity wrapper for iOS/Android compatibility
107
- return /*#__PURE__*/_jsxs(View, {
108
- style: bubbleStyle,
109
- children: [/*#__PURE__*/_jsxs(Canvas, {
110
- style: {
111
- width: size,
112
- height: size
113
- },
114
- children: [/*#__PURE__*/_jsx(Circle, {
115
- cx: size / 2,
116
- cy: size / 2,
117
- r: size / 2,
118
- color: bubble.color,
119
- children: /*#__PURE__*/_jsx(LinearGradient, {
120
- start: vec(0, 0),
121
- end: vec(size, size),
122
- colors: [`${bubble.color}E0`, `${bubble.color}A0`, `${bubble.color}80`]
123
- })
124
- }), /*#__PURE__*/_jsx(Circle, {
125
- cx: size / 2,
126
- cy: size / 2 + 2,
127
- r: size / 2 - 4,
128
- color: "rgba(0,0,0,0.15)"
129
- }), /*#__PURE__*/_jsxs(Circle, {
130
- cx: size / 2,
131
- cy: size / 2 - 1,
132
- r: size / 2 - 4,
133
- color: bubble.color,
134
- children: [/*#__PURE__*/_jsx(LinearGradient, {
135
- start: vec(size * 0.2, size * 0.2),
136
- end: vec(size * 0.8, size * 0.8),
137
- colors: ['#FFFFFF', '#FFFFFFA0', bubble.color, `${bubble.color}C0`, '#00000020']
138
- }), /*#__PURE__*/_jsx(Shadow, {
139
- dx: 0,
140
- dy: 3,
141
- blur: 6,
142
- color: "rgba(0,0,0,0.2)"
143
- })]
144
- }), /*#__PURE__*/_jsx(Circle, {
145
- cx: size / 2 - size * 0.15,
146
- cy: size / 2 - size * 0.2,
147
- r: size * 0.12,
148
- color: "#FFFFFF",
149
- opacity: 0.8,
150
- children: /*#__PURE__*/_jsx(LinearGradient, {
151
- start: vec(0, 0),
152
- end: vec(size * 0.24, size * 0.24),
153
- colors: ['#FFFFFF', '#FFFFFF80', '#FFFFFF00']
154
- })
155
- }), /*#__PURE__*/_jsx(Circle, {
156
- cx: size / 2 + size * 0.1,
157
- cy: size / 2 - size * 0.15,
158
- r: size * 0.06,
159
- color: "#FFFFFF",
160
- opacity: 0.6
161
- })]
162
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
163
- style: {
164
- position: 'absolute',
165
- top: 0,
166
- left: 0,
167
- width: size,
168
- height: size,
169
- backgroundColor: 'transparent'
170
- },
171
- onPress: handlePop,
172
- onPressIn: handlePressIn,
173
- onPressOut: handlePressOut,
174
- activeOpacity: 1,
175
- disabled: isPopped || !isPlaying,
176
- hitSlop: {
177
- top: 10,
178
- bottom: 10,
179
- left: 10,
180
- right: 10
181
- },
182
- delayPressIn: 0,
183
- delayPressOut: 0
184
- })]
185
- });
186
- };
187
-
188
- // Memoized BubbleComponent with custom comparison to prevent unnecessary re-renders
189
- // Note: We don't compare onPop function reference as it may change but functionality remains the same
190
- // Note: We don't compare bubble.isPopped as we now use store state which is subscribed individually
191
- const MemoizedBubbleComponent = /*#__PURE__*/React.memo(BubbleComponent, (prevProps, nextProps) => {
192
- return prevProps.bubble.id === nextProps.bubble.id && prevProps.bubble.x === nextProps.bubble.x && prevProps.bubble.y === nextProps.bubble.y && prevProps.bubble.color === nextProps.bubble.color && prevProps.size === nextProps.size && prevProps.hapticEnabled === nextProps.hapticEnabled && prevProps.isPlaying === nextProps.isPlaying
193
- // Removed bubble.isPopped comparison as we now use individual store subscriptions
194
- // Removed onPop comparison as function reference may change but behavior is the same
195
- ;
196
- });
197
- export default MemoizedBubbleComponent;
198
- //# sourceMappingURL=BubbleComponent.js.map
1
+ "use strict";import React,{useState,useCallback,useMemo}from 'react';import{View,TouchableOpacity}from 'react-native';import{Canvas,Circle,LinearGradient,vec,Shadow}from '@shopify/react-native-skia';import{playHaptic,HapticType}from "../../../services/HapticsService.js";import{usePopitFidgetStore}from "../PopitFidgetStore.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const BubbleComponent =({bubble,size,onPop,hapticEnabled = true,isPlaying})=>{const bubbleState = usePopitFidgetStore(state => state.bubbleStates[bubble.id]);const isPopped = bubbleState?.isPopped || false;const [isPressed,setIsPressed] = useState(false);const handlePop = useCallback(()=>{if(!isPlaying || isPopped)return;playHaptic(HapticType.MEDIUM,hapticEnabled || false);onPop();},[onPop,hapticEnabled,isPlaying,isPopped]);const handlePressIn = useCallback(()=>{if(!isPopped && isPlaying){setIsPressed(true);playHaptic(HapticType.LIGHT,hapticEnabled || false);}},[isPopped,isPlaying,hapticEnabled]);const handlePressOut = useCallback(()=>{setIsPressed(false);},[]);const bubbleStyle = useMemo(()=>({position:'absolute',left:bubble.x - size / 2,top:bubble.y - size / 2,width:size,height:size,transform:[{scale:isPressed ? 0.95:1}]}),[bubble.x,bubble.y,size,isPressed]);if(isPopped){return _jsx(View,{style:bubbleStyle,children:_jsxs(Canvas,{style:{width:size,height:size},children:[_jsx(Circle,{cx:size / 2,cy:size / 2,r:size / 2,color:bubble.color,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size,size),colors:[`${bubble.color}60`,`${bubble.color}40`,`${bubble.color}30` ]})}),_jsx(Circle,{cx:size / 2,cy:size / 2 + 1,r:size / 2 - 6,color:bubble.color,children:_jsx(LinearGradient,{start:vec(size * 0.7,size * 0.7),end:vec(size * 0.3,size * 0.3),colors:['#FFFFFF30',`${bubble.color}80`,'#00000020' ]})}),_jsx(Circle,{cx:size / 2 + size * 0.15,cy:size / 2 + size * 0.2,r:size * 0.06,color:"#FFFFFF",opacity:0.6})]})});}return _jsxs(View,{style:bubbleStyle,children:[_jsxs(Canvas,{style:{width:size,height:size},children:[_jsx(Circle,{cx:size / 2,cy:size / 2,r:size / 2,color:bubble.color,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size,size),colors:[`${bubble.color}E0`,`${bubble.color}A0`,`${bubble.color}80`]})}),_jsx(Circle,{cx:size / 2,cy:size / 2 + 2,r:size / 2 - 4,color:"rgba(0,0,0,0.15)"}),_jsxs(Circle,{cx:size / 2,cy:size / 2 - 1,r:size / 2 - 4,color:bubble.color,children:[_jsx(LinearGradient,{start:vec(size * 0.2,size * 0.2),end:vec(size * 0.8,size * 0.8),colors:['#FFFFFF','#FFFFFFA0',bubble.color,`${bubble.color}C0`,'#00000020']}),_jsx(Shadow,{dx:0,dy:3,blur:6,color:"rgba(0,0,0,0.2)"})]}),_jsx(Circle,{cx:size / 2 - size * 0.15,cy:size / 2 - size * 0.2,r:size * 0.12,color:"#FFFFFF",opacity:0.8,children:_jsx(LinearGradient,{start:vec(0,0),end:vec(size * 0.24,size * 0.24),colors:['#FFFFFF','#FFFFFF80','#FFFFFF00']})}),_jsx(Circle,{cx:size / 2 + size * 0.1,cy:size / 2 - size * 0.15,r:size * 0.06,color:"#FFFFFF",opacity:0.6})]}),_jsx(TouchableOpacity,{style:{position:'absolute',top:0,left:0,width:size,height:size,backgroundColor:'transparent'},onPress:handlePop,onPressIn:handlePressIn,onPressOut:handlePressOut,activeOpacity:1,disabled:isPopped || !isPlaying,hitSlop:{top:10,bottom:10,left:10,right:10},delayPressIn:0,delayPressOut:0})]});};const MemoizedBubbleComponent = React.memo(BubbleComponent,(prevProps,nextProps)=>{return prevProps.bubble.id === nextProps.bubble.id && prevProps.bubble.x === nextProps.bubble.x && prevProps.bubble.y === nextProps.bubble.y && prevProps.bubble.color === nextProps.bubble.color && prevProps.size === nextProps.size && prevProps.hapticEnabled === nextProps.hapticEnabled && prevProps.isPlaying === nextProps.isPlaying;});export default MemoizedBubbleComponent;