react-native-games 0.4.0 → 0.6.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 (281) hide show
  1. package/README.md +121 -130
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +121 -422
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +30 -31
  5. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +52 -124
  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/GameBackground.js +2 -2
  15. package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
  16. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +7 -6
  17. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
  18. package/lib/module/games/balloon-blaster/components/index.js +0 -3
  19. package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
  20. package/lib/module/games/fruit-ninja/FruitNinja.js +93 -376
  21. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  22. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +19 -22
  23. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
  24. package/lib/module/games/fruit-ninja/FruitNinjaService.js +25 -8
  25. package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -1
  26. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +29 -4
  27. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
  28. package/lib/module/games/fruit-ninja/components/GameArea.js +194 -29
  29. package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -1
  30. package/lib/module/games/fruit-ninja/components/GameBackground.js +107 -190
  31. package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -1
  32. package/lib/module/games/fruit-ninja/components/ScoreBoard.js +9 -30
  33. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
  34. package/lib/module/games/fruit-ninja/components/index.js +0 -3
  35. package/lib/module/games/fruit-ninja/components/index.js.map +1 -1
  36. package/lib/module/games/maze-runner/MazeRunner.js +106 -109
  37. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  38. package/lib/module/games/maze-runner/MazeRunnerConstants.js +19 -24
  39. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
  40. package/lib/module/games/maze-runner/MazeRunnerService.js +2 -1
  41. package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -1
  42. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
  43. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
  44. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +32 -15
  45. package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
  46. package/lib/module/games/maze-runner/components/ScoreBoard.js +8 -3
  47. package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
  48. package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
  49. package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
  50. package/lib/module/games/maze-runner/components/index.js +0 -1
  51. package/lib/module/games/maze-runner/components/index.js.map +1 -1
  52. package/lib/module/games/popit-fidget/PopitFidget.js +113 -112
  53. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  54. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +20 -23
  55. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
  56. package/lib/module/games/popit-fidget/PopitFidgetService.js +0 -59
  57. package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -1
  58. package/lib/module/games/popit-fidget/PopitFidgetStore.js +0 -27
  59. package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -1
  60. package/lib/module/games/popit-fidget/components/BubbleComponent.js +24 -22
  61. package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -1
  62. package/lib/module/games/popit-fidget/components/GameBackground.js +4 -1
  63. package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -1
  64. package/lib/module/games/popit-fidget/components/ScoreBoard.js +9 -2
  65. package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -1
  66. package/lib/module/games/popit-fidget/components/index.js +0 -2
  67. package/lib/module/games/popit-fidget/components/index.js.map +1 -1
  68. package/lib/module/games/space-fighter/SpaceFighter.js +121 -369
  69. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  70. package/lib/module/games/space-fighter/SpaceFighterConstants.js +21 -23
  71. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
  72. package/lib/module/games/space-fighter/SpaceFighterService.js +30 -11
  73. package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -1
  74. package/lib/module/games/space-fighter/SpaceFighterStore.js +54 -2
  75. package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -1
  76. package/lib/module/games/space-fighter/components/AsteroidComponent.js +7 -5
  77. package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -1
  78. package/lib/module/games/space-fighter/components/GameArea.js +234 -14
  79. package/lib/module/games/space-fighter/components/GameArea.js.map +1 -1
  80. package/lib/module/games/space-fighter/components/GameBackground.js +10 -65
  81. package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -1
  82. package/lib/module/games/space-fighter/components/ScoreBoard.js +9 -7
  83. package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -1
  84. package/lib/module/games/space-fighter/components/Spacecraft3D.js +90 -250
  85. package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -1
  86. package/lib/module/games/space-fighter/components/SpacecraftPath.js +42 -27
  87. package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -1
  88. package/lib/module/games/space-fighter/components/index.js +0 -3
  89. package/lib/module/games/space-fighter/components/index.js.map +1 -1
  90. package/lib/module/games/whack-a-mole/WhackAMole.js +63 -73
  91. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  92. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +17 -19
  93. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
  94. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +20 -7
  95. package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -1
  96. package/lib/module/games/whack-a-mole/components/GameHole.js +2 -2
  97. package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -1
  98. package/lib/module/games/whack-a-mole/components/ScoreBoard.js +5 -1
  99. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
  100. package/lib/module/games/whack-a-mole/components/index.js +0 -1
  101. package/lib/module/games/whack-a-mole/components/index.js.map +1 -1
  102. package/lib/module/services/GamesConstants.js +13 -21
  103. package/lib/module/services/GamesConstants.js.map +1 -1
  104. package/lib/module/services/GamesService.js +30 -26
  105. package/lib/module/services/GamesService.js.map +1 -1
  106. package/lib/module/services/SoundsService.js +21 -21
  107. package/lib/module/shared/helpers/AnimationFrame.js +120 -0
  108. package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
  109. package/lib/module/shared/helpers/AnimationTracker.js +89 -0
  110. package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
  111. package/lib/module/shared/helpers/ErrorHandler.js +269 -0
  112. package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
  113. package/lib/module/shared/helpers/GameControlButton.js +67 -58
  114. package/lib/module/shared/helpers/GameControlButton.js.map +1 -1
  115. package/lib/module/{games/whack-a-mole/components → shared/helpers}/GameOverModal.js +23 -13
  116. package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
  117. package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
  118. package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
  119. package/lib/module/shared/helpers/ParticleBlast.js +133 -0
  120. package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
  121. package/lib/module/shared/helpers/index.js +7 -0
  122. package/lib/module/shared/helpers/index.js.map +1 -1
  123. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
  124. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  125. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +10 -9
  126. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -1
  127. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +0 -2
  128. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
  129. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
  130. package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
  131. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
  132. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
  133. package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -1
  134. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
  135. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  136. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -3
  137. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
  138. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +2 -14
  139. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  140. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +5 -5
  141. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -1
  142. package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts +8 -0
  143. package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -1
  144. package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts +1 -0
  145. package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -1
  146. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +1 -15
  147. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -1
  148. package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -1
  149. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +1 -7
  150. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
  151. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +0 -3
  152. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -1
  153. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -8
  154. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  155. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +4 -4
  156. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -1
  157. package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -1
  158. package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
  159. package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
  160. package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
  161. package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
  162. package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -1
  163. package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
  164. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +2 -8
  165. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  166. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +4 -4
  167. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -1
  168. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +0 -21
  169. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -1
  170. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +1 -5
  171. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -1
  172. package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -1
  173. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +2 -2
  174. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -1
  175. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +2 -2
  176. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -1
  177. package/lib/typescript/src/games/popit-fidget/components/index.d.ts +0 -2
  178. package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -1
  179. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +3 -8
  180. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  181. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +4 -4
  182. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -1
  183. package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -1
  184. package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -1
  185. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +0 -1
  186. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -1
  187. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +1 -15
  188. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -1
  189. package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -1
  190. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +1 -6
  191. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -1
  192. package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -1
  193. package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -1
  194. package/lib/typescript/src/games/space-fighter/components/index.d.ts +0 -3
  195. package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -1
  196. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +2 -11
  197. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  198. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +2 -2
  199. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -1
  200. package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -1
  201. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +0 -1
  202. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -1
  203. package/lib/typescript/src/services/GamesConstants.d.ts +47 -38
  204. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  205. package/lib/typescript/src/services/GamesService.d.ts +20 -3
  206. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  207. package/lib/typescript/src/services/SoundsService.d.ts +20 -20
  208. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
  209. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
  210. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
  211. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
  212. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
  213. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
  214. package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -1
  215. package/lib/typescript/src/{games/balloon-blaster/components → shared/helpers}/GameOverModal.d.ts +5 -0
  216. package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
  217. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
  218. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
  219. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
  220. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
  221. package/lib/typescript/src/shared/helpers/index.d.ts +9 -0
  222. package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -1
  223. package/package.json +2 -2
  224. package/lib/module/games/balloon-blaster/components/GameOverModal.js +0 -133
  225. package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
  226. package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -55
  227. package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
  228. package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
  229. package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
  230. package/lib/module/games/fruit-ninja/components/GameOverModal.js +0 -189
  231. package/lib/module/games/fruit-ninja/components/GameOverModal.js.map +0 -1
  232. package/lib/module/games/fruit-ninja/components/ParticleSystem.js +0 -52
  233. package/lib/module/games/fruit-ninja/components/ParticleSystem.js.map +0 -1
  234. package/lib/module/games/fruit-ninja/components/SliceTrail.js +0 -58
  235. package/lib/module/games/fruit-ninja/components/SliceTrail.js.map +0 -1
  236. package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
  237. package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
  238. package/lib/module/games/popit-fidget/components/GameOverModal.js +0 -132
  239. package/lib/module/games/popit-fidget/components/GameOverModal.js.map +0 -1
  240. package/lib/module/games/popit-fidget/components/ParticleSystem.js +0 -89
  241. package/lib/module/games/popit-fidget/components/ParticleSystem.js.map +0 -1
  242. package/lib/module/games/space-fighter/components/GameOverModal.js +0 -182
  243. package/lib/module/games/space-fighter/components/GameOverModal.js.map +0 -1
  244. package/lib/module/games/space-fighter/components/ParticleComponent.js +0 -34
  245. package/lib/module/games/space-fighter/components/ParticleComponent.js.map +0 -1
  246. package/lib/module/games/space-fighter/components/SettingsModal.js +0 -222
  247. package/lib/module/games/space-fighter/components/SettingsModal.js.map +0 -1
  248. package/lib/module/games/whack-a-mole/components/GameOverModal.js.map +0 -1
  249. package/lib/module/shared/settings/GameSettings.js +0 -295
  250. package/lib/module/shared/settings/GameSettings.js.map +0 -1
  251. package/lib/module/shared/settings/SettingsService.js +0 -125
  252. package/lib/module/shared/settings/SettingsService.js.map +0 -1
  253. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
  254. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
  255. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
  256. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
  257. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
  258. package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts +0 -9
  259. package/lib/typescript/src/games/fruit-ninja/components/GameOverModal.d.ts.map +0 -1
  260. package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts +0 -8
  261. package/lib/typescript/src/games/fruit-ninja/components/ParticleSystem.d.ts.map +0 -1
  262. package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts +0 -11
  263. package/lib/typescript/src/games/fruit-ninja/components/SliceTrail.d.ts.map +0 -1
  264. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
  265. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
  266. package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts +0 -9
  267. package/lib/typescript/src/games/popit-fidget/components/GameOverModal.d.ts.map +0 -1
  268. package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts +0 -9
  269. package/lib/typescript/src/games/popit-fidget/components/ParticleSystem.d.ts.map +0 -1
  270. package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts +0 -9
  271. package/lib/typescript/src/games/space-fighter/components/GameOverModal.d.ts.map +0 -1
  272. package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts +0 -8
  273. package/lib/typescript/src/games/space-fighter/components/ParticleComponent.d.ts.map +0 -1
  274. package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts +0 -9
  275. package/lib/typescript/src/games/space-fighter/components/SettingsModal.d.ts.map +0 -1
  276. package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts +0 -9
  277. package/lib/typescript/src/games/whack-a-mole/components/GameOverModal.d.ts.map +0 -1
  278. package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
  279. package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
  280. package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -33
  281. package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
@@ -1,398 +1,143 @@
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, useMemo, useCallback } 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
- export const BalloonBlaster = ({
35
- settings: externalSettings = DEFAULT_BALLOON_BLASTER_SETTINGS,
36
- onSettingsChange,
37
- showSettingsModal = false,
38
- onToggleSettingsModal
13
+ export const BalloonBlaster = /*#__PURE__*/React.memo(({
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);
33
+ balloonAnimations,
34
+ particleAnimations
35
+ } = useAnimationTrackers(['balloonAnimations', 'particleAnimations']);
129
36
 
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]);
37
+ // Error handling for the game
38
+ const {
39
+ wrapFunction,
40
+ safeExecute
41
+ } = useGameErrorHandler(GAME_IDS.BALLOON_BLASTER);
169
42
 
170
- // Balloon spawning - memoized to prevent unnecessary re-renders
43
+ // Memoized balloon spawning callback
171
44
  const spawnBalloon = useCallback(balloon => {
172
45
  addBalloon(balloon);
173
46
  }, [addBalloon]);
174
47
 
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();
48
+ // Memoized game control functions with error handling
49
+ const handleResetGame = useCallback(wrapFunction(() => {
50
+ resetGame();
51
+ }, GameErrorType.UNKNOWN_ERROR), [wrapFunction, resetGame]);
52
+
53
+ // Memoized game service creation to prevent recreation
54
+ const gameService = useMemo(() => {
55
+ return safeExecute(() => createBalloonBlasterService(balloonAnimations, particleAnimations), createBalloonBlasterService(balloonAnimations, particleAnimations),
56
+ // Fallback to direct creation
57
+ GameErrorType.INITIALIZATION_ERROR);
58
+ }, [balloonAnimations, particleAnimations, safeExecute]);
59
+ const handleStartGame = useCallback(wrapFunction(() => {
60
+ // AGGRESSIVE cleanup - force clear everything
193
61
  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
62
 
245
- // Create pop particles
246
- gameService.createPopParticles(balloon);
63
+ // Force clear any existing balloons immediately
64
+ const currentBalloons = useBalloonBlasterStore.getState().balloons;
65
+ currentBalloons.forEach(balloon => removeBalloon(balloon.id));
247
66
 
248
- // Remove combo system - no more combo sounds
67
+ // Clean up service
68
+ if (gameService) {
69
+ gameService.cleanup();
70
+ gameService.resetAnimations();
249
71
  }
250
72
 
251
- // Remove balloon after animation
73
+ // Minimal delay to ensure complete cleanup
252
74
  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
- });
303
-
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
- });
75
+ startGame(); // Store uses fixed 60s duration internally
76
+ if (gameService) {
77
+ gameService.startGameTimer(decrementTime);
78
+ gameService.startBalloonSpawning(spawnBalloon, 600); // Even faster spawn interval
79
+ gameService.startPhysicsLoop(updateBalloon, removeBalloon, () => useBalloonBlasterStore.getState().balloons);
313
80
  }
314
- });
315
- }, [balloons]);
81
+ }, 50); // Minimal delay for immediate game start
82
+ }, GameErrorType.INITIALIZATION_ERROR), [wrapFunction, resetGame, removeBalloon, gameService, startGame, decrementTime, spawnBalloon, updateBalloon]);
83
+ const handleStopGame = useCallback(wrapFunction(() => {
84
+ stopGame();
85
+ if (gameService) {
86
+ gameService.cleanup();
87
+ gameService.resetAnimations();
88
+ }
89
+ }, GameErrorType.UNKNOWN_ERROR), [wrapFunction, stopGame, gameService]);
316
90
 
317
- // Initialize and cleanup
91
+ // Initialize game settings on mount
318
92
  useEffect(() => {
319
93
  return () => {
320
- gameService.cleanup();
94
+ handleResetGame();
321
95
  };
322
- }, []);
323
-
324
- // Sync particles from service to store for React re-rendering
325
- 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
- };
337
- }
96
+ }, [handleResetGame]);
338
97
 
339
- // Return empty cleanup function when not playing
340
- return () => {};
341
- }, [isPlaying, gameOver, setParticles]);
342
-
343
- // Cleanup when game ends (gameOver becomes true)
98
+ // Auto-stop balloon spawning when game over state changes
344
99
  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
- });
357
-
358
- // Clear slice path
359
- currentSlicePath.current = [];
360
- setSlicePath([]);
361
- setIsSlicing(false);
362
- }, 50); // Small delay to ensure state consistency
363
-
364
- return () => clearTimeout(cleanupTimeout);
100
+ if (gameOver && gameService) {
101
+ // Stop all timers and physics when game over
102
+ gameService.cleanup();
365
103
  }
366
- return () => {}; // Return empty cleanup function when condition is not met
367
- }, [gameOver, balloons, removeBalloon]); // Include necessary dependencies
104
+ }, [gameOver, gameService]);
368
105
 
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;
377
- }
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]);
106
+ // Memoized GameControlButton props to prevent unnecessary re-renders
107
+ const gameControlButtonProps = useMemo(() => ({
108
+ isPlaying,
109
+ gameOver,
110
+ onStartGame: handleStartGame,
111
+ onStopGame: handleStopGame,
112
+ startButtonText: "START POPPING",
113
+ stopButtonText: "STOP GAME",
114
+ startButtonSubtext: "Pop balloons to score!",
115
+ stopButtonSubtext: "End current game",
116
+ startButtonColor: "#3b82f6",
117
+ stopButtonColor: "#dc2626",
118
+ startButtonBorderColor: "#60a5fa",
119
+ stopButtonBorderColor: "#f87171"
120
+ }), [isPlaying, gameOver, handleStartGame, handleStopGame]);
121
+
122
+ // Memoized GameOverModal props to prevent unnecessary re-renders
123
+ const gameOverModalProps = useMemo(() => ({
124
+ isVisible: gameOver,
125
+ score,
126
+ onPlayAgain: handleResetGame,
127
+ buttonText: "Pop Again!",
128
+ primaryColor: "rgba(59, 130, 246, 0.8)",
129
+ // Blue theme for Balloon Blaster
130
+ borderColor: "rgba(59, 130, 246, 0.9)",
131
+ buttonColor: "#10b981",
132
+ buttonBorderColor: "#34d399"
133
+ }), [gameOver, score, handleResetGame]);
134
+
135
+ // Memoized GameSettingsModal props to prevent unnecessary re-renders
136
+ const gameSettingsModalProps = useMemo(() => ({
137
+ gameId: GAME_IDS.BALLOON_BLASTER,
138
+ settings,
139
+ onSettingsChange
140
+ }), [settings, onSettingsChange]);
396
141
  return /*#__PURE__*/_jsx(GestureHandlerRootView, {
397
142
  style: {
398
143
  flex: 1
@@ -400,58 +145,20 @@ export const BalloonBlaster = ({
400
145
  children: /*#__PURE__*/_jsx(View, {
401
146
  style: styles.container,
402
147
  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, {
148
+ children: [/*#__PURE__*/_jsx(GameArea, {}), /*#__PURE__*/_jsx(View, {
414
149
  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
- })
150
+ children: /*#__PURE__*/_jsx(ScoreBoard, {})
151
+ }), /*#__PURE__*/_jsx(GameControlButton, {
152
+ ...gameControlButtonProps
436
153
  }), /*#__PURE__*/_jsx(GameOverModal, {
437
- isVisible: gameOver,
438
- 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
- })
154
+ ...gameOverModalProps
155
+ }), /*#__PURE__*/_jsx(GameSettingsModal, {
156
+ ...gameSettingsModalProps
450
157
  })]
451
158
  })
452
159
  })
453
160
  });
454
- };
161
+ });
455
162
  const styles = StyleSheet.create({
456
163
  container: {
457
164
  flex: 1
@@ -463,14 +170,6 @@ const styles = StyleSheet.create({
463
170
  right: 20,
464
171
  zIndex: 10,
465
172
  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
173
  }
475
174
  });
476
175
  //# 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,EAAEC,cAAc,QAAQ,uBAAc;AAClF,SAASC,iBAAiB,QAAQ,+BAAsB;AACxD;;AAQA,MAAMC,gCAA4D,GAAG;EACnEC,YAAY,EAAE,EAAE;EAAE;EAClBC,UAAU,EAAE,QAAQ;EACpBC,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE;AACjB,CAAC;AAED,MAAMC,0BAA0B,GAAIH,UAAsC,IAAa;EACrF;EACA,MAAMI,SAAS,GAAG;IAAEC,IAAI,EAAE,GAAG;IAAEC,MAAM,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAI,CAAC;EACvD,OAAOH,SAAS,CAACJ,UAAU,CAAC;AAC9B,CAAC;AACD,SAASQ,YAAY,QAAQ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,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","useMemo","useCallback","View","StyleSheet","GestureHandlerRootView","useBalloonBlasterStore","createBalloonBlasterService","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","useAnimationTrackers","useGameErrorHandler","GameErrorType","GameSettingsModal","GAME_IDS","jsx","_jsx","jsxs","_jsxs","BalloonBlaster","memo","settings","onSettingsChange","isPlaying","state","gameOver","score","startGame","stopGame","resetGame","decrementTime","addBalloon","removeBalloon","updateBalloon","balloonAnimations","particleAnimations","wrapFunction","safeExecute","BALLOON_BLASTER","spawnBalloon","balloon","handleResetGame","UNKNOWN_ERROR","gameService","INITIALIZATION_ERROR","handleStartGame","currentBalloons","getState","balloons","forEach","id","cleanup","resetAnimations","setTimeout","startGameTimer","startBalloonSpawning","startPhysicsLoop","handleStopGame","gameControlButtonProps","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameSettingsModalProps","gameId","style","flex","children","styles","container","scoreboardContainer","create","position","top","left","right","zIndex","pointerEv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