react-native-games 0.4.0 → 0.5.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 (275) hide show
  1. package/README.md +121 -130
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +111 -423
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +27 -28
  5. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +42 -117
  7. package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
  8. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +12 -1
  9. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
  10. package/lib/module/games/balloon-blaster/components/BalloonComponent.js +102 -75
  11. package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
  12. package/lib/module/games/balloon-blaster/components/GameArea.js +139 -30
  13. package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
  14. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +7 -6
  15. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
  16. package/lib/module/games/balloon-blaster/components/index.js +0 -3
  17. package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
  18. package/lib/module/games/fruit-ninja/FruitNinja.js +94 -376
  19. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  20. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +19 -22
  21. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
  22. package/lib/module/games/fruit-ninja/FruitNinjaService.js +30 -9
  23. package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -1
  24. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +29 -4
  25. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
  26. package/lib/module/games/fruit-ninja/components/GameArea.js +194 -29
  27. package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -1
  28. package/lib/module/games/fruit-ninja/components/GameBackground.js +107 -190
  29. package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -1
  30. package/lib/module/games/fruit-ninja/components/ScoreBoard.js +9 -30
  31. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
  32. package/lib/module/games/fruit-ninja/components/index.js +0 -3
  33. package/lib/module/games/fruit-ninja/components/index.js.map +1 -1
  34. package/lib/module/games/maze-runner/MazeRunner.js +106 -109
  35. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  36. package/lib/module/games/maze-runner/MazeRunnerConstants.js +19 -24
  37. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
  38. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
  39. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
  40. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +16 -7
  41. package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
  42. package/lib/module/games/maze-runner/components/ScoreBoard.js +8 -3
  43. package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
  44. package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
  45. package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
  46. package/lib/module/games/maze-runner/components/index.js +0 -1
  47. package/lib/module/games/maze-runner/components/index.js.map +1 -1
  48. package/lib/module/games/popit-fidget/PopitFidget.js +113 -112
  49. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  50. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +20 -23
  51. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
  52. package/lib/module/games/popit-fidget/PopitFidgetService.js +0 -59
  53. package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -1
  54. package/lib/module/games/popit-fidget/PopitFidgetStore.js +0 -27
  55. package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -1
  56. package/lib/module/games/popit-fidget/components/BubbleComponent.js +24 -22
  57. package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -1
  58. package/lib/module/games/popit-fidget/components/GameBackground.js +4 -1
  59. package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -1
  60. package/lib/module/games/popit-fidget/components/ScoreBoard.js +9 -2
  61. package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -1
  62. package/lib/module/games/popit-fidget/components/index.js +0 -2
  63. package/lib/module/games/popit-fidget/components/index.js.map +1 -1
  64. package/lib/module/games/space-fighter/SpaceFighter.js +121 -369
  65. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  66. package/lib/module/games/space-fighter/SpaceFighterConstants.js +21 -23
  67. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
  68. package/lib/module/games/space-fighter/SpaceFighterService.js +30 -11
  69. package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -1
  70. package/lib/module/games/space-fighter/SpaceFighterStore.js +54 -2
  71. package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -1
  72. package/lib/module/games/space-fighter/components/AsteroidComponent.js +7 -5
  73. package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -1
  74. package/lib/module/games/space-fighter/components/GameArea.js +234 -14
  75. package/lib/module/games/space-fighter/components/GameArea.js.map +1 -1
  76. package/lib/module/games/space-fighter/components/GameBackground.js +10 -65
  77. package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -1
  78. package/lib/module/games/space-fighter/components/ScoreBoard.js +9 -7
  79. package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -1
  80. package/lib/module/games/space-fighter/components/Spacecraft3D.js +72 -111
  81. package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -1
  82. package/lib/module/games/space-fighter/components/SpacecraftPath.js +42 -27
  83. package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -1
  84. package/lib/module/games/space-fighter/components/index.js +0 -3
  85. package/lib/module/games/space-fighter/components/index.js.map +1 -1
  86. package/lib/module/games/whack-a-mole/WhackAMole.js +63 -73
  87. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  88. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +17 -19
  89. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
  90. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +20 -7
  91. package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -1
  92. package/lib/module/games/whack-a-mole/components/GameHole.js +2 -2
  93. package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -1
  94. package/lib/module/games/whack-a-mole/components/ScoreBoard.js +5 -1
  95. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
  96. package/lib/module/games/whack-a-mole/components/index.js +0 -1
  97. package/lib/module/games/whack-a-mole/components/index.js.map +1 -1
  98. package/lib/module/services/GamesConstants.js +13 -21
  99. package/lib/module/services/GamesConstants.js.map +1 -1
  100. package/lib/module/services/GamesService.js +30 -26
  101. package/lib/module/services/GamesService.js.map +1 -1
  102. package/lib/module/services/SoundsService.js +21 -21
  103. package/lib/module/shared/helpers/AnimationFrame.js +120 -0
  104. package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
  105. package/lib/module/shared/helpers/AnimationTracker.js +89 -0
  106. package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
  107. package/lib/module/shared/helpers/ErrorHandler.js +269 -0
  108. package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
  109. package/lib/module/shared/helpers/GameControlButton.js +67 -58
  110. package/lib/module/shared/helpers/GameControlButton.js.map +1 -1
  111. package/lib/module/{games/whack-a-mole/components → shared/helpers}/GameOverModal.js +23 -13
  112. package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
  113. package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
  114. package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
  115. package/lib/module/shared/helpers/ParticleBlast.js +133 -0
  116. package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
  117. package/lib/module/shared/helpers/index.js +7 -0
  118. package/lib/module/shared/helpers/index.js.map +1 -1
  119. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
  120. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  121. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +8 -7
  122. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -1
  123. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +0 -2
  124. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
  125. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
  126. package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
  127. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
  128. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
  129. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
  130. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  131. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -3
  132. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
  133. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +2 -14
  134. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  135. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +5 -5
  136. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -1
  137. package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts +9 -1
  138. package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -1
  139. package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts +1 -0
  140. package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -1
  141. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +1 -15
  142. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -1
  143. package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -1
  144. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +1 -7
  145. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
  146. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +0 -3
  147. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -1
  148. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -8
  149. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  150. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +4 -4
  151. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -1
  152. package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
  153. package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
  154. package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
  155. package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
  156. package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -1
  157. package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
  158. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +2 -8
  159. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  160. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +4 -4
  161. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -1
  162. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +0 -21
  163. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -1
  164. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +1 -5
  165. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -1
  166. package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -1
  167. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +2 -2
  168. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -1
  169. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +2 -2
  170. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -1
  171. package/lib/typescript/src/games/popit-fidget/components/index.d.ts +0 -2
  172. package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -1
  173. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +3 -8
  174. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  175. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +4 -4
  176. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -1
  177. package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -1
  178. package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -1
  179. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +0 -1
  180. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -1
  181. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +1 -15
  182. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -1
  183. package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -1
  184. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +1 -6
  185. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -1
  186. package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -1
  187. package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -1
  188. package/lib/typescript/src/games/space-fighter/components/index.d.ts +0 -3
  189. package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -1
  190. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +2 -11
  191. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  192. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +2 -2
  193. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -1
  194. package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -1
  195. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +0 -1
  196. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -1
  197. package/lib/typescript/src/services/GamesConstants.d.ts +47 -38
  198. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  199. package/lib/typescript/src/services/GamesService.d.ts +20 -3
  200. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  201. package/lib/typescript/src/services/SoundsService.d.ts +20 -20
  202. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
  203. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
  204. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
  205. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
  206. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
  207. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
  208. package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -1
  209. package/lib/typescript/src/{games/balloon-blaster/components → shared/helpers}/GameOverModal.d.ts +5 -0
  210. package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
  211. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
  212. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
  213. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
  214. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
  215. package/lib/typescript/src/shared/helpers/index.d.ts +9 -0
  216. package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -1
  217. package/package.json +1 -1
  218. package/lib/module/games/balloon-blaster/components/GameOverModal.js +0 -133
  219. package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
  220. package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -55
  221. package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
  222. package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
  223. package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
  224. package/lib/module/games/fruit-ninja/components/GameOverModal.js +0 -189
  225. package/lib/module/games/fruit-ninja/components/GameOverModal.js.map +0 -1
  226. package/lib/module/games/fruit-ninja/components/ParticleSystem.js +0 -52
  227. package/lib/module/games/fruit-ninja/components/ParticleSystem.js.map +0 -1
  228. package/lib/module/games/fruit-ninja/components/SliceTrail.js +0 -58
  229. package/lib/module/games/fruit-ninja/components/SliceTrail.js.map +0 -1
  230. package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
  231. package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
  232. package/lib/module/games/popit-fidget/components/GameOverModal.js +0 -132
  233. package/lib/module/games/popit-fidget/components/GameOverModal.js.map +0 -1
  234. package/lib/module/games/popit-fidget/components/ParticleSystem.js +0 -89
  235. package/lib/module/games/popit-fidget/components/ParticleSystem.js.map +0 -1
  236. package/lib/module/games/space-fighter/components/GameOverModal.js +0 -182
  237. package/lib/module/games/space-fighter/components/GameOverModal.js.map +0 -1
  238. package/lib/module/games/space-fighter/components/ParticleComponent.js +0 -34
  239. package/lib/module/games/space-fighter/components/ParticleComponent.js.map +0 -1
  240. package/lib/module/games/space-fighter/components/SettingsModal.js +0 -222
  241. package/lib/module/games/space-fighter/components/SettingsModal.js.map +0 -1
  242. package/lib/module/games/whack-a-mole/components/GameOverModal.js.map +0 -1
  243. package/lib/module/shared/settings/GameSettings.js +0 -295
  244. package/lib/module/shared/settings/GameSettings.js.map +0 -1
  245. package/lib/module/shared/settings/SettingsService.js +0 -125
  246. package/lib/module/shared/settings/SettingsService.js.map +0 -1
  247. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
  248. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
  249. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
  250. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
  251. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
  252. package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts +0 -9
  253. package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts.map +0 -1
  254. package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts +0 -8
  255. package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts.map +0 -1
  256. package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts +0 -11
  257. package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts.map +0 -1
  258. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
  259. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
  260. package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts +0 -9
  261. package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts.map +0 -1
  262. package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts +0 -9
  263. package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts.map +0 -1
  264. package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts +0 -9
  265. package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts.map +0 -1
  266. package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts +0 -8
  267. package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts.map +0 -1
  268. package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts +0 -9
  269. package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts.map +0 -1
  270. package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts +0 -9
  271. package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts.map +0 -1
  272. package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
  273. package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
  274. package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -33
  275. package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
@@ -1,398 +1,111 @@
1
1
  "use strict";
2
2
 
3
- import React, { useEffect, useRef, useCallback } from 'react';
4
- import { View, StyleSheet, Modal } from 'react-native';
5
- import { runOnJS } from 'react-native-reanimated';
6
- import { Gesture, GestureDetector, GestureHandlerRootView } from 'react-native-gesture-handler';
7
- import { playSound, GAME_SOUNDS } from "../../services/SoundsService.js";
8
- import { playHaptic, HapticType } from "../../services/HapticsService.js";
3
+ import React, { useEffect, useRef } from 'react';
4
+ import { View, StyleSheet } from 'react-native';
5
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
9
6
  import { useBalloonBlasterStore } from "./BalloonBlasterStore.js";
10
- import { createBalloonBlasterService, GAME_CONFIG } from "./BalloonBlasterService.js";
11
- import { ScoreBoard, GameArea, GameOverModal, GameBackground } from "./components/index.js";
12
- import { GameControlButton } from "../../shared/helpers/index.js";
13
- // Define game-specific types and constants locally
14
-
15
- const DEFAULT_BALLOON_BLASTER_SETTINGS = {
16
- gameDuration: 60,
17
- // Fixed 60 seconds for all games
18
- difficulty: 'medium',
19
- soundEnabled: true,
20
- hapticEnabled: true
21
- };
22
- const getDifficultySpawnInterval = difficulty => {
23
- // Reduced spawn intervals for immediate balloon visibility and better gameplay
24
- const intervals = {
25
- easy: 800,
26
- medium: 600,
27
- hard: 400
28
- };
29
- return intervals[difficulty];
30
- };
31
- import { GameSettings } from "../../shared/settings/GameSettings.js";
32
- import { createGameSettingsStore } from "../../shared/settings/SettingsService.js";
7
+ import { createBalloonBlasterService } from "./BalloonBlasterService.js";
8
+ import { ScoreBoard, GameArea, GameBackground } from "./components/index.js";
9
+ import { GameControlButton, GameOverModal, useAnimationTrackers, useGameErrorHandler, GameErrorType } from "../../shared/helpers/index.js";
10
+ import { GameSettingsModal } from "../../shared/helpers/index.js";
11
+ import { GAME_IDS } from "../../services/GamesService.js";
33
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
13
  export const BalloonBlaster = ({
35
- settings: externalSettings = DEFAULT_BALLOON_BLASTER_SETTINGS,
36
- onSettingsChange,
37
- showSettingsModal = false,
38
- onToggleSettingsModal
14
+ settings,
15
+ onSettingsChange
39
16
  }) => {
40
- // Create unified game settings store
41
- const useSettings = React.useMemo(() => {
42
- return createGameSettingsStore(externalSettings, onSettingsChange);
43
- }, []); // Empty dependency array - create store only once
44
-
45
- const settings = useSettings();
46
-
47
- // Track previous settings to prevent infinite loops
48
- const prevSettingsRef = React.useRef(externalSettings);
49
-
50
- // Update settings when external settings change (only if actually different)
51
- React.useEffect(() => {
52
- if (!externalSettings) return;
53
- const prev = prevSettingsRef.current;
54
- if (!prev) {
55
- settings.updateSettings(externalSettings);
56
- prevSettingsRef.current = externalSettings;
57
- return;
58
- }
59
- const hasChanged = prev.difficulty !== externalSettings.difficulty || prev.soundEnabled !== externalSettings.soundEnabled || prev.hapticEnabled !== externalSettings.hapticEnabled;
60
- if (hasChanged) {
61
- settings.updateSettings(externalSettings);
62
- prevSettingsRef.current = externalSettings;
63
- }
64
- }, [externalSettings, settings]);
17
+ // Read UI-critical state independently to minimize re-renders
18
+ const isPlaying = useBalloonBlasterStore(state => state.isPlaying);
19
+ const gameOver = useBalloonBlasterStore(state => state.gameOver);
20
+ const score = useBalloonBlasterStore(state => state.score);
21
+
22
+ // Get store actions independently (these don't cause re-renders)
23
+ const startGame = useBalloonBlasterStore(state => state.startGame);
24
+ const stopGame = useBalloonBlasterStore(state => state.stopGame);
25
+ const resetGame = useBalloonBlasterStore(state => state.resetGame);
26
+ const decrementTime = useBalloonBlasterStore(state => state.decrementTime);
27
+ const addBalloon = useBalloonBlasterStore(state => state.addBalloon);
28
+ const removeBalloon = useBalloonBlasterStore(state => state.removeBalloon);
29
+ const updateBalloon = useBalloonBlasterStore(state => state.updateBalloon);
30
+
31
+ // Use shared animation tracking utility
65
32
  const {
66
- score,
67
- timeLeft,
68
- isPlaying,
69
- gameOver,
70
- lives,
71
- balloons,
72
- particles,
73
- slicePath,
74
- isSlicing,
75
- startGame,
76
- stopGame,
77
- resetGame,
78
- popBalloon,
79
- decrementTime,
80
- addBalloon,
81
- removeBalloon,
82
- updateBalloon,
83
- setParticles,
84
- setSlicePath,
85
- setIsSlicing,
86
- resetCombo,
87
- loseLife,
88
- addLife
89
- } = useBalloonBlasterStore();
90
-
91
- // Simple animation tracking without shared values
92
- const balloonAnimations = useRef(new Map()).current;
93
- const particleAnimations = useRef(new Map()).current;
94
-
95
- // Game service
96
- const gameService = useRef(createBalloonBlasterService(balloonAnimations, particleAnimations)).current;
97
-
98
- // Slice path tracking
99
- const currentSlicePath = useRef([]);
100
-
101
- // Helper functions for gesture handling - memoized to prevent unnecessary re-renders
102
- const checkBalloonIntersections = useCallback(slicePath => {
103
- const currentBalloons = useBalloonBlasterStore.getState().balloons;
104
- currentBalloons.forEach(balloon => {
105
- if (!balloon.isPopped && gameService.checkBalloonPop(balloon, slicePath)) {
106
- // Call handleBalloonPop directly to avoid circular dependency
107
- const balloonId = balloon.id;
108
- // Double-check game state to prevent race conditions
109
- const currentState = useBalloonBlasterStore.getState();
110
- if (!currentState.isPlaying || currentState.gameOver) return;
111
- const targetBalloon = currentBalloons.find(b => b.id === balloonId);
112
- if (!targetBalloon || targetBalloon.isPopped) return;
113
-
114
- // Handle different balloon types BEFORE marking as popped
115
- if (targetBalloon.isBomb) {
116
- // Bomb hit - lose life and end combo
117
- playSound(GAME_SOUNDS.BALLOON_BLASTER.BOMB, settings.soundEnabled);
118
- playHaptic(HapticType.HEAVY, settings.hapticEnabled);
119
-
120
- // Check current state again before losing life
121
- const stateBeforeLoss = useBalloonBlasterStore.getState();
122
- if (stateBeforeLoss.lives > 0 && stateBeforeLoss.isPlaying && !stateBeforeLoss.gameOver) {
123
- loseLife();
124
- resetCombo();
125
- }
126
-
127
- // Create explosion particles
128
- gameService.createPopParticles(targetBalloon);
129
-
130
- // Mark bomb as popped after processing
131
- updateBalloon(balloonId, {
132
- isPopped: true
133
- });
134
- } else {
135
- // Handle different balloon types with simplified mechanics
136
- playSound(GAME_SOUNDS.BALLOON_BLASTER.POP, settings.soundEnabled);
137
- playHaptic(HapticType.LIGHT, settings.hapticEnabled);
138
- if (targetBalloon.isBonus) {
139
- // Star balloon - add a life instead of points
140
- addLife();
141
- playSound(GAME_SOUNDS.BALLOON_BLASTER.POP, settings.soundEnabled);
142
- // Mark star as popped after processing
143
- updateBalloon(balloonId, {
144
- isPopped: true
145
- });
146
- } else {
147
- // Regular balloon - add 10 points (popBalloon handles marking)
148
- popBalloon(balloonId);
149
- }
150
-
151
- // Create pop particles
152
- gameService.createPopParticles(targetBalloon);
153
- }
154
-
155
- // Remove balloon after animation
156
- setTimeout(() => {
157
- removeBalloon(balloonId);
158
- balloonAnimations.delete(balloonId);
159
- }, 500);
160
- }
161
- });
162
- }, [gameService, loseLife, resetCombo, updateBalloon, addLife, popBalloon, removeBalloon, balloonAnimations]);
163
- const clearSlicePath = useCallback(() => {
164
- setTimeout(() => {
165
- currentSlicePath.current = [];
166
- setSlicePath([]);
167
- }, 200);
168
- }, [setSlicePath]);
169
-
170
- // Balloon spawning - memoized to prevent unnecessary re-renders
171
- const spawnBalloon = useCallback(balloon => {
172
- addBalloon(balloon);
173
- }, [addBalloon]);
174
-
175
- // Game control functions - memoized to prevent unnecessary re-renders
176
- const handleStartGame = useCallback(() => {
177
- startGame(); // Store uses fixed 60s duration internally
178
- gameService.resetAnimations();
179
- gameService.startGameTimer(decrementTime);
180
- gameService.startBalloonSpawning(spawnBalloon, getDifficultySpawnInterval(settings.difficulty));
181
- gameService.startPhysicsLoop(updateBalloon, removeBalloon, () => useBalloonBlasterStore.getState().balloons);
182
- }, [startGame, gameService, decrementTime, spawnBalloon, settings.difficulty, updateBalloon, removeBalloon]);
183
- const handleStopGame = useCallback(() => {
184
- stopGame();
185
- gameService.cleanup();
186
- gameService.resetAnimations();
187
- currentSlicePath.current = [];
188
- setSlicePath([]);
189
- setIsSlicing(false);
190
- }, [stopGame, gameService, setSlicePath, setIsSlicing]);
191
- const handleResetGame = useCallback(() => {
192
- gameService.cleanup();
193
- resetGame();
194
- gameService.resetAnimations();
195
- currentSlicePath.current = [];
196
- setSlicePath([]);
197
- setIsSlicing(false);
198
- }, [gameService, resetGame, setSlicePath, setIsSlicing]);
199
-
200
- // Balloon popping logic - memoized to prevent unnecessary re-renders
201
- const handleBalloonPop = useCallback(balloonId => {
202
- // Double-check game state to prevent race conditions
203
- const currentState = useBalloonBlasterStore.getState();
204
- if (!currentState.isPlaying || currentState.gameOver) return;
205
- const balloon = balloons.find(b => b.id === balloonId);
206
- if (!balloon || balloon.isPopped) return;
207
-
208
- // Handle different balloon types BEFORE marking as popped
209
- if (balloon.isBomb) {
210
- // Bomb hit - lose life and end combo
211
- playSound(GAME_SOUNDS.BALLOON_BLASTER.BOMB, settings.soundEnabled);
212
- playHaptic(HapticType.HEAVY, settings.hapticEnabled);
213
-
214
- // Check current state again before losing life
215
- const stateBeforeLoss = useBalloonBlasterStore.getState();
216
- if (stateBeforeLoss.lives > 0 && stateBeforeLoss.isPlaying && !stateBeforeLoss.gameOver) {
217
- loseLife();
218
- resetCombo();
219
- }
220
-
221
- // Create explosion particles
222
- gameService.createPopParticles(balloon);
223
-
224
- // Mark bomb as popped after processing
225
- updateBalloon(balloonId, {
226
- isPopped: true
227
- });
228
- } else {
229
- // Handle different balloon types with simplified mechanics
230
- playSound(GAME_SOUNDS.BALLOON_BLASTER.POP, settings.soundEnabled);
231
- playHaptic(HapticType.LIGHT, settings.hapticEnabled);
232
- if (balloon.isBonus) {
233
- // Star balloon - add a life instead of points
234
- addLife();
235
- playSound(GAME_SOUNDS.BALLOON_BLASTER.POP, settings.soundEnabled);
236
- // Mark star as popped after processing
237
- updateBalloon(balloonId, {
238
- isPopped: true
239
- });
240
- } else {
241
- // Regular balloon - add 10 points (popBalloon handles marking)
242
- popBalloon(balloonId);
243
- }
244
-
245
- // Create pop particles
246
- gameService.createPopParticles(balloon);
247
-
248
- // Remove combo system - no more combo sounds
249
- }
33
+ balloonAnimations,
34
+ particleAnimations
35
+ } = useAnimationTrackers(['balloonAnimations', 'particleAnimations']);
250
36
 
251
- // Remove balloon after animation
252
- setTimeout(() => {
253
- removeBalloon(balloonId);
254
- balloonAnimations.delete(balloonId);
255
- }, 500);
256
- }, [balloons, loseLife, resetCombo, gameService, updateBalloon, addLife, popBalloon, removeBalloon, balloonAnimations, settings.soundEnabled, settings.hapticEnabled]);
257
-
258
- // Gesture handling for slicing - memoized to prevent unnecessary re-renders
259
- const handleGestureStart = useCallback(event => {
260
- if (!isPlaying) return;
261
- currentSlicePath.current = [{
262
- x: event.x,
263
- y: event.y
264
- }];
265
- setIsSlicing(true);
266
- setSlicePath([{
267
- x: event.x,
268
- y: event.y
269
- }]);
270
-
271
- // Light haptic feedback on slice start
272
- playHaptic(HapticType.LIGHT, settings.hapticEnabled);
273
- }, [isPlaying, setIsSlicing, setSlicePath, settings.hapticEnabled]);
274
- const handleGestureUpdate = useCallback(event => {
275
- if (!isPlaying) return;
276
- const newPoint = {
277
- x: event.x,
278
- y: event.y
279
- };
280
- currentSlicePath.current.push(newPoint);
281
-
282
- // Limit slice path length for performance
283
- if (currentSlicePath.current.length > GAME_CONFIG.SLICE_TRAIL_LENGTH) {
284
- currentSlicePath.current.shift();
285
- }
286
- setSlicePath([...currentSlicePath.current]);
287
-
288
- // Check for balloon intersections
289
- checkBalloonIntersections(currentSlicePath.current);
290
- }, [isPlaying, setSlicePath, checkBalloonIntersections]);
291
- const handleGestureEnd = useCallback(() => {
292
- if (!isPlaying) return;
293
- setIsSlicing(false);
294
- clearSlicePath();
295
- }, [isPlaying, setIsSlicing, clearSlicePath]);
296
- const panGesture = Gesture.Pan().onStart(event => {
297
- runOnJS(handleGestureStart)(event);
298
- }).onUpdate(event => {
299
- runOnJS(handleGestureUpdate)(event);
300
- }).onEnd(() => {
301
- runOnJS(handleGestureEnd)();
302
- });
37
+ // Error handling for the game
38
+ const {
39
+ wrapFunction,
40
+ safeExecute
41
+ } = useGameErrorHandler(GAME_IDS.BALLOON_BLASTER);
303
42
 
304
- // Track balloon animations without shared values
305
- useEffect(() => {
306
- balloons.forEach(balloon => {
307
- if (!balloonAnimations.has(balloon.id)) {
308
- // Simple animation state tracking
309
- balloonAnimations.set(balloon.id, {
310
- scale: 1,
311
- opacity: 1
312
- });
313
- }
314
- });
315
- }, [balloons]);
43
+ // Game service for main game control only with error handling
44
+ const gameService = useRef(safeExecute(() => createBalloonBlasterService(balloonAnimations, particleAnimations), createBalloonBlasterService(balloonAnimations, particleAnimations),
45
+ // Fallback to direct creation
46
+ GameErrorType.INITIALIZATION_ERROR)).current;
316
47
 
317
- // Initialize and cleanup
48
+ // Initialize game settings on mount
318
49
  useEffect(() => {
319
50
  return () => {
320
- gameService.cleanup();
51
+ handleResetGame();
321
52
  };
322
53
  }, []);
323
54
 
324
- // Sync particles from service to store for React re-rendering
55
+ // Auto-stop balloon spawning when game over state changes
325
56
  useEffect(() => {
326
- if (isPlaying && !gameOver) {
327
- const syncParticles = () => {
328
- const currentParticles = gameService.getParticles();
329
- // Force re-render by creating new array reference
330
- setParticles([...currentParticles]);
331
- requestAnimationFrame(syncParticles);
332
- };
333
- const animationId = requestAnimationFrame(syncParticles);
334
- return () => {
335
- cancelAnimationFrame(animationId);
336
- };
57
+ if (gameOver && gameService) {
58
+ // Stop all timers and physics when game over
59
+ gameService.cleanup();
337
60
  }
61
+ }, [gameOver, gameService]);
338
62
 
339
- // Return empty cleanup function when not playing
340
- return () => {};
341
- }, [isPlaying, gameOver, setParticles]);
342
-
343
- // Cleanup when game ends (gameOver becomes true)
344
- useEffect(() => {
345
- if (gameOver) {
346
- // Use a timeout to ensure state has settled
347
- const cleanupTimeout = setTimeout(() => {
348
- // Immediately stop all game activities
349
- gameService.cleanup();
350
-
351
- // Clear all existing balloons from the screen
352
- const currentBalloons = [...balloons]; // Create a copy to avoid mutation during iteration
353
- currentBalloons.forEach(balloon => {
354
- removeBalloon(balloon.id);
355
- balloonAnimations.delete(balloon.id);
356
- });
63
+ // Game control functions with error handling
64
+ const handleStartGame = wrapFunction(() => {
65
+ // AGGRESSIVE cleanup - force clear everything
66
+ resetGame();
357
67
 
358
- // Clear slice path
359
- currentSlicePath.current = [];
360
- setSlicePath([]);
361
- setIsSlicing(false);
362
- }, 50); // Small delay to ensure state consistency
68
+ // Force clear any existing balloons immediately
69
+ const currentBalloons = useBalloonBlasterStore.getState().balloons;
70
+ currentBalloons.forEach(balloon => removeBalloon(balloon.id));
363
71
 
364
- return () => clearTimeout(cleanupTimeout);
72
+ // Clean up service
73
+ if (gameService) {
74
+ gameService.cleanup();
75
+ gameService.resetAnimations();
365
76
  }
366
- return () => {}; // Return empty cleanup function when condition is not met
367
- }, [gameOver, balloons, removeBalloon]); // Include necessary dependencies
368
77
 
369
- // Auto-remove balloons that float off screen (top)
370
- useEffect(() => {
371
- if (!isPlaying || gameOver) return;
372
- const interval = setInterval(() => {
373
- // Check if game is still active before processing
374
- const currentState = useBalloonBlasterStore.getState();
375
- if (!currentState.isPlaying || currentState.gameOver) {
376
- return;
78
+ // Longer delay to ensure complete cleanup
79
+ setTimeout(() => {
80
+ startGame(); // Store uses fixed 60s duration internally
81
+ if (gameService) {
82
+ gameService.startGameTimer(decrementTime);
83
+ gameService.startBalloonSpawning(spawnBalloon, 1000); // Default spawn interval
84
+ gameService.startPhysicsLoop(updateBalloon, removeBalloon, () => useBalloonBlasterStore.getState().balloons);
377
85
  }
378
- balloons.forEach(balloon => {
379
- if (balloon.position.y < -100 && !balloon.isPopped) {
380
- // Balloon floated off screen without being popped
381
- if (!balloon.isBomb && !balloon.isBonus) {
382
- // Only lose life for regular balloons and if game is still active
383
- const livesBeforeLoss = useBalloonBlasterStore.getState().lives;
384
- if (livesBeforeLoss > 0) {
385
- loseLife();
386
- // The useEffect will handle cleanup when gameOver becomes true
387
- }
388
- }
389
- removeBalloon(balloon.id);
390
- balloonAnimations.delete(balloon.id);
391
- }
392
- });
393
- }, 100);
394
- return () => clearInterval(interval);
395
- }, [isPlaying, gameOver, balloons, removeBalloon, loseLife]);
86
+ }, 200); // Longer delay to ensure complete cleanup
87
+ }, GameErrorType.INITIALIZATION_ERROR);
88
+ const handleStopGame = wrapFunction(() => {
89
+ stopGame();
90
+ if (gameService) {
91
+ gameService.cleanup();
92
+ gameService.resetAnimations();
93
+ }
94
+ }, GameErrorType.UNKNOWN_ERROR);
95
+ const handleResetGame = wrapFunction(() => {
96
+ if (gameService) {
97
+ gameService.cleanup();
98
+ }
99
+ resetGame();
100
+ if (gameService) {
101
+ gameService.resetAnimations();
102
+ }
103
+ }, GameErrorType.UNKNOWN_ERROR);
104
+
105
+ // Balloon spawning
106
+ const spawnBalloon = balloon => {
107
+ addBalloon(balloon);
108
+ };
396
109
  return /*#__PURE__*/_jsx(GestureHandlerRootView, {
397
110
  style: {
398
111
  flex: 1
@@ -400,53 +113,36 @@ export const BalloonBlaster = ({
400
113
  children: /*#__PURE__*/_jsx(View, {
401
114
  style: styles.container,
402
115
  children: /*#__PURE__*/_jsxs(GameBackground, {
403
- children: [/*#__PURE__*/_jsx(GestureDetector, {
404
- gesture: panGesture,
405
- children: /*#__PURE__*/_jsx(GameArea, {
406
- balloons: balloons,
407
- balloonAnimations: balloonAnimations,
408
- slicePath: slicePath,
409
- isSlicing: isSlicing,
410
- particles: particles,
411
- onBalloonPop: handleBalloonPop
412
- })
413
- }), /*#__PURE__*/_jsx(View, {
116
+ children: [/*#__PURE__*/_jsx(GameArea, {}), /*#__PURE__*/_jsx(View, {
414
117
  style: styles.scoreboardContainer,
415
- children: /*#__PURE__*/_jsx(ScoreBoard, {
416
- score: score,
417
- timeLeft: timeLeft,
418
- lives: lives
419
- })
420
- }), /*#__PURE__*/_jsx(View, {
421
- style: styles.controlButtonContainer,
422
- children: /*#__PURE__*/_jsx(GameControlButton, {
423
- isPlaying: isPlaying,
424
- gameOver: gameOver,
425
- onStartGame: handleStartGame,
426
- onStopGame: handleStopGame,
427
- startButtonText: "START POPPING",
428
- stopButtonText: "STOP GAME",
429
- startButtonSubtext: "Pop balloons to score!",
430
- stopButtonSubtext: "End current game",
431
- startButtonColor: "#3b82f6",
432
- stopButtonColor: "#dc2626",
433
- startButtonBorderColor: "#60a5fa",
434
- stopButtonBorderColor: "#f87171"
435
- })
118
+ children: /*#__PURE__*/_jsx(ScoreBoard, {})
119
+ }), /*#__PURE__*/_jsx(GameControlButton, {
120
+ isPlaying: isPlaying,
121
+ gameOver: gameOver,
122
+ onStartGame: handleStartGame,
123
+ onStopGame: handleStopGame,
124
+ startButtonText: "START POPPING",
125
+ stopButtonText: "STOP GAME",
126
+ startButtonSubtext: "Pop balloons to score!",
127
+ stopButtonSubtext: "End current game",
128
+ startButtonColor: "#3b82f6",
129
+ stopButtonColor: "#dc2626",
130
+ startButtonBorderColor: "#60a5fa",
131
+ stopButtonBorderColor: "#f87171"
436
132
  }), /*#__PURE__*/_jsx(GameOverModal, {
437
133
  isVisible: gameOver,
438
134
  score: score,
439
- onPlayAgain: handleResetGame
440
- }), /*#__PURE__*/_jsx(Modal, {
441
- visible: showSettingsModal,
442
- animationType: "slide",
443
- presentationStyle: "pageSheet",
444
- onRequestClose: onToggleSettingsModal,
445
- children: /*#__PURE__*/_jsx(GameSettings, {
446
- gameId: "balloon-blaster",
447
- onClose: onToggleSettingsModal || (() => {}),
448
- settingsStore: settings
449
- })
135
+ onPlayAgain: handleResetGame,
136
+ buttonText: "Pop Again!",
137
+ primaryColor: "rgba(59, 130, 246, 0.8)" // Blue theme for Balloon Blaster
138
+ ,
139
+ borderColor: "rgba(59, 130, 246, 0.9)",
140
+ buttonColor: "#10b981",
141
+ buttonBorderColor: "#34d399"
142
+ }), /*#__PURE__*/_jsx(GameSettingsModal, {
143
+ gameId: GAME_IDS.BALLOON_BLASTER,
144
+ settings: settings,
145
+ onSettingsChange: onSettingsChange
450
146
  })]
451
147
  })
452
148
  })
@@ -463,14 +159,6 @@ const styles = StyleSheet.create({
463
159
  right: 20,
464
160
  zIndex: 10,
465
161
  pointerEvents: 'none' // Allow touches to pass through to GameArea
466
- },
467
- controlButtonContainer: {
468
- position: 'absolute',
469
- bottom: 20,
470
- left: 20,
471
- right: 20,
472
- zIndex: 10,
473
- alignItems: 'center'
474
162
  }
475
163
  });
476
164
  //# sourceMappingURL=BalloonBlaster.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRef","useCallback","View","StyleSheet","Modal","runOnJS","Gesture","GestureDetector","GestureHandlerRootView","playSound","GAME_SOUNDS","playHaptic","HapticType","useBalloonBlasterStore","createBalloonBlasterService","GAME_CONFIG","ScoreBoard","GameArea","GameOverModal","GameBackground","GameControlButton","DEFAULT_BALLOON_BLASTER_SETTINGS","gameDuration","difficulty","soundEnabled","hapticEnabled","getDifficultySpawnInterval","intervals","easy","medium","hard","GameSettings","createGameSettingsStore","jsx","_jsx","jsxs","_jsxs","BalloonBlaster","settings","externalSettings","onSettingsChange","showSettingsModal","onToggleSettingsModal","useSettings","useMemo","prevSettingsRef","prev","current","updateSettings","hasChanged","score","timeLeft","isPlaying","gameOver","lives","balloons","particles","slicePath","isSlicing","startGame","stopGame","resetGame","popBalloon","decrementTime","addBalloon","removeBalloon","updateBalloon","setParticles","setSlicePath","setIsSlicing","resetCombo","loseLife","addLife","balloonAnimations","Map","particleAnimations","gameService","currentSlicePath","checkBalloonIntersections","currentBalloons","getState","forEach","balloon","isPopped","checkBalloonPop","balloonId","id","currentState","targetBalloon","find","b","isBomb","BALLOON_BLASTER","BOMB","HEAVY","stateBeforeLoss","createPopParticles","POP","LIGHT","isBonus","setTimeout","delete","clearSlicePath","spawnBalloon","handleStartGame","resetAnimations","startGameTimer","startBalloonSpawning","startPhysicsLoop","handleStopGame","cleanup","handleResetGame","handleBalloonPop","handleGestureStart","event","x","y","handleGestureUpdate","newPoint","push","length","SLICE_TRAIL_LENGTH","shift","handleGestureEnd","panGesture","Pan","onStart","onUpdate","onEnd","has","set","scale","opacity","syncParticles","currentParticles","getParticles","requestAnimationFrame","animationId","cancelAnimationFrame","cleanupTimeout","clearTimeout","interval","setInterval","position","livesBeforeLoss","clearInterval","style","flex","children","styles","container","gesture","onBalloonPop","scoreboardContainer","controlButtonContainer","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","isVisible","onPlayAgain","visible","animationType","presentationStyle","onRequestClose","gameId","onClose","settingsStore","create","top","left","right","zIndex","pointerEvents","bottom","alignItems"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlaster.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,WAAW,QAAQ,OAAO;AAC7D,SAASC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AACtD,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,OAAO,EAAEC,eAAe,EAAEC,sBAAsB,QAAQ,8BAA8B;AAC/F,SAASC,SAAS,EAAEC,WAAW,QAAQ,iCAA8B;AACrE,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AACtE,SAASC,sBAAsB,QAAQ,0BAAuB;AAC9D,SAASC,2BAA2B,EAAEC,WAAW,QAAQ,4BAAyB;AAClF,SAASC,UAAU,EAAEC,QAAQ,EAAEC,aAAa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AAK,EAAEA,KAAM;UAACoH,WAAW,EAAEvD;QAAgB,CAAE,CAAC,eAGlF7E,IAAA,CAAC9B,KAAK;UACJmK,OAAO,EAAE9H,iBAAkB;UAC3B+H,aAAa,EAAC,OAAO;UACrBC,iBAAiB,EAAC,WAAW;UAC7BC,cAAc,EAAEhI,qBAAsB;UAAA0G,QAAA,eAEtClH,IAAA,CAACH,YAAY;YACX4I,MAAM,EAAC,iBAAiB;YACxBC,OAAO,EAAElI,qBAAqB,KAAK,MAAM,CAAC,CAAC,CAAE;YAC7CmI,aAAa,EAAEvI;UAAS,CACzB;QAAC,CACG,CAAC;MAAA,CACQ;IAAC,CACb;EAAC,CACe,CAAC;AAE7B,CAAC;AAED,MAAM+G,MAAM,GAAGlJ,UAAU,CAAC2K,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IACTH,IAAI,EAAE;EACR,CAAC;EACDM,mBAAmB,EAAE;IACnBV,QAAQ,EAAE,UAAU;IACpBgC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,MAAM,CAAE;EACzB,CAAC;EACDzB,sBAAsB,EAAE;IACtBX,QAAQ,EAAE,UAAU;IACpBqC,MAAM,EAAE,EAAE;IACVJ,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVG,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useRef","View","StyleSheet","GestureHandlerRootView","useBalloonBlasterStore","createBalloonBlasterService","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useAnimationTrackers","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","jsx","_jsx","jsxs","_jsxs","BalloonBlaster","settings","onSettingsChange","isPlaying","state","gameOver","score","startGame","stopGame","resetGame","decrementTime","addBalloon","removeBalloon","updateBalloon","balloonAnimations","particleAnimations","wrapFunction","safeExecute","BALLOON_BLASTER","gameService","INITIALIZATION_ERROR","current","handleResetGame","cleanup","handleStartGame","currentBalloons","getState","balloons","forEach","balloon","id","resetAnimations","setTimeout","startGameTimer","startBalloonSpawning","spawnBalloon","startPhysicsLoop","handleStopGame","UNKNOWN_ERROR","style","flex","children","styles","container","scoreboardContainer","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameId","create","position","top","left","right","zIndex","pointerEvents"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlaster.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,sBAAsB,QAAQ,0BAAuB;AAC9D,SAASC,2BAA2B,QAAQ,4BAAyB;AACrE,SAASC,UAAU,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,uBAAc;AACnE,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,oBAAoB,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,+BAAsB;AACjI,SAASC,iBAAiB,QAAQ,+BAAsB;AACxD,SAASC,QAAQ,QAAwB,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvE,OAAO,MAAMC,cAAmC,GAAGA,CAAC;EAClDC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ;EACA,MAAMC,SAAS,GAAGnB,sBAAsB,CAACoB,KAAK,IAAIA,KAAK,CAACD,SAAS,CAAC;EAClE,MAAME,QAAQ,GAAGrB,sBAAsB,CAACoB,KAAK,IAAIA,KAAK,CAACC,QAAQ,CAAC;EAChE,MAAMC,KAAK,GAAGtB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