react-native-games 0.3.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 (429) hide show
  1. package/README.md +134 -130
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +116 -343
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +182 -0
  5. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -0
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +123 -101
  7. package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -1
  8. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +119 -92
  9. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -1
  10. package/lib/module/games/balloon-blaster/components/BalloonComponent.js +123 -113
  11. package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -1
  12. package/lib/module/games/balloon-blaster/components/GameArea.js +137 -23
  13. package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -1
  14. package/lib/module/games/balloon-blaster/components/GameBackground.js +8 -83
  15. package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -1
  16. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +15 -22
  17. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
  18. package/lib/module/games/balloon-blaster/components/index.js +0 -4
  19. package/lib/module/games/balloon-blaster/components/index.js.map +1 -1
  20. package/lib/module/games/fruit-ninja/FruitNinja.js +143 -0
  21. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -0
  22. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +148 -0
  23. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -0
  24. package/lib/module/games/{fruit-slicer/FruitSlicerService.js → fruit-ninja/FruitNinjaService.js} +43 -21
  25. package/lib/module/games/fruit-ninja/FruitNinjaService.js.map +1 -0
  26. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +191 -0
  27. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -0
  28. package/lib/module/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.js +1 -1
  29. package/lib/module/games/fruit-ninja/components/FruitComponent.js.map +1 -0
  30. package/lib/module/games/fruit-ninja/components/GameArea.js +215 -0
  31. package/lib/module/games/fruit-ninja/components/GameArea.js.map +1 -0
  32. package/lib/module/games/{fruit-slicer → fruit-ninja}/components/GameBackground.js +250 -304
  33. package/lib/module/games/fruit-ninja/components/GameBackground.js.map +1 -0
  34. package/lib/module/games/{fruit-slicer → fruit-ninja}/components/ScoreBoard.js +17 -47
  35. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -0
  36. package/lib/module/games/fruit-ninja/components/index.js +7 -0
  37. package/lib/module/games/fruit-ninja/components/index.js.map +1 -0
  38. package/lib/module/games/maze-runner/MazeRunner.js +184 -169
  39. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  40. package/lib/module/games/maze-runner/MazeRunnerConstants.js +100 -0
  41. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -0
  42. package/lib/module/games/maze-runner/MazeRunnerService.js +37 -14
  43. package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -1
  44. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +5 -4
  45. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -1
  46. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +20 -15
  47. package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -1
  48. package/lib/module/games/maze-runner/components/GameBackground.js +151 -192
  49. package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -1
  50. package/lib/module/games/maze-runner/components/ScoreBoard.js +15 -25
  51. package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -1
  52. package/lib/module/games/maze-runner/components/WallComponent.js +3 -2
  53. package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -1
  54. package/lib/module/games/maze-runner/components/index.js +0 -2
  55. package/lib/module/games/maze-runner/components/index.js.map +1 -1
  56. package/lib/module/games/popit-fidget/PopitFidget.js +294 -0
  57. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -0
  58. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +113 -0
  59. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -0
  60. package/lib/module/games/popit-fidget/PopitFidgetService.js +132 -0
  61. package/lib/module/games/popit-fidget/PopitFidgetService.js.map +1 -0
  62. package/lib/module/games/popit-fidget/PopitFidgetStore.js +163 -0
  63. package/lib/module/games/popit-fidget/PopitFidgetStore.js.map +1 -0
  64. package/lib/module/games/popit-fidget/components/BubbleComponent.js +198 -0
  65. package/lib/module/games/popit-fidget/components/BubbleComponent.js.map +1 -0
  66. package/lib/module/games/popit-fidget/components/FidgetGrid.js +165 -0
  67. package/lib/module/games/popit-fidget/components/FidgetGrid.js.map +1 -0
  68. package/lib/module/games/popit-fidget/components/GameBackground.js +177 -0
  69. package/lib/module/games/popit-fidget/components/GameBackground.js.map +1 -0
  70. package/lib/module/games/popit-fidget/components/ScoreBoard.js +75 -0
  71. package/lib/module/games/popit-fidget/components/ScoreBoard.js.map +1 -0
  72. package/lib/module/games/popit-fidget/components/index.js +7 -0
  73. package/lib/module/games/popit-fidget/components/index.js.map +1 -0
  74. package/lib/module/games/space-fighter/SpaceFighter.js +169 -0
  75. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -0
  76. package/lib/module/games/space-fighter/SpaceFighterConstants.js +108 -0
  77. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -0
  78. package/lib/module/games/{space-traveller/SpaceTravellerService.js → space-fighter/SpaceFighterService.js} +48 -21
  79. package/lib/module/games/space-fighter/SpaceFighterService.js.map +1 -0
  80. package/lib/module/games/space-fighter/SpaceFighterStore.js +195 -0
  81. package/lib/module/games/space-fighter/SpaceFighterStore.js.map +1 -0
  82. package/lib/module/games/{space-traveller → space-fighter}/components/AsteroidComponent.js +7 -5
  83. package/lib/module/games/space-fighter/components/AsteroidComponent.js.map +1 -0
  84. package/lib/module/games/space-fighter/components/GameArea.js +295 -0
  85. package/lib/module/games/space-fighter/components/GameArea.js.map +1 -0
  86. package/lib/module/games/{space-traveller → space-fighter}/components/GameBackground.js +10 -65
  87. package/lib/module/games/space-fighter/components/GameBackground.js.map +1 -0
  88. package/lib/module/games/{space-traveller → space-fighter}/components/ScoreBoard.js +20 -26
  89. package/lib/module/games/space-fighter/components/ScoreBoard.js.map +1 -0
  90. package/lib/module/games/{space-traveller → space-fighter}/components/Spacecraft3D.js +72 -111
  91. package/lib/module/games/space-fighter/components/Spacecraft3D.js.map +1 -0
  92. package/lib/module/games/space-fighter/components/SpacecraftPath.js +52 -0
  93. package/lib/module/games/space-fighter/components/SpacecraftPath.js.map +1 -0
  94. package/lib/module/games/{space-traveller → space-fighter}/components/index.js +0 -4
  95. package/lib/module/games/space-fighter/components/index.js.map +1 -0
  96. package/lib/module/games/whack-a-mole/WhackAMole.js +263 -0
  97. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -0
  98. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +115 -0
  99. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -0
  100. package/lib/module/games/whack-a-mole/WhackAMoleService.js +120 -0
  101. package/lib/module/games/whack-a-mole/WhackAMoleService.js.map +1 -0
  102. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +172 -0
  103. package/lib/module/games/whack-a-mole/WhackAMoleStore.js.map +1 -0
  104. package/lib/module/games/{cat-popper → whack-a-mole}/components/GameBackground.js +31 -91
  105. package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -0
  106. package/lib/module/games/whack-a-mole/components/GameGrid.js +97 -0
  107. package/lib/module/games/whack-a-mole/components/GameGrid.js.map +1 -0
  108. package/lib/module/games/{cat-popper → whack-a-mole}/components/GameHole.js +67 -54
  109. package/lib/module/games/whack-a-mole/components/GameHole.js.map +1 -0
  110. package/lib/module/games/{cat-popper/components/CatCharacter.js → whack-a-mole/components/MoleCharacter.js} +75 -115
  111. package/lib/module/games/whack-a-mole/components/MoleCharacter.js.map +1 -0
  112. package/lib/module/games/{cat-popper → whack-a-mole}/components/ScoreBoard.js +13 -17
  113. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -0
  114. package/lib/module/games/{cat-popper → whack-a-mole}/components/index.js +1 -3
  115. package/lib/module/games/whack-a-mole/components/index.js.map +1 -0
  116. package/lib/module/index.js +4 -3
  117. package/lib/module/index.js.map +1 -1
  118. package/lib/module/services/GamesConstants.js +41 -519
  119. package/lib/module/services/GamesConstants.js.map +1 -1
  120. package/lib/module/services/GamesService.js +35 -23
  121. package/lib/module/services/GamesService.js.map +1 -1
  122. package/lib/module/services/HapticsService.js +77 -0
  123. package/lib/module/services/HapticsService.js.map +1 -0
  124. package/lib/module/services/SoundsService.js +171 -0
  125. package/lib/module/services/SoundsService.js.map +1 -0
  126. package/lib/module/shared/helpers/AnimationFrame.js +120 -0
  127. package/lib/module/shared/helpers/AnimationFrame.js.map +1 -0
  128. package/lib/module/shared/helpers/AnimationTracker.js +89 -0
  129. package/lib/module/shared/helpers/AnimationTracker.js.map +1 -0
  130. package/lib/module/shared/helpers/ErrorHandler.js +269 -0
  131. package/lib/module/shared/helpers/ErrorHandler.js.map +1 -0
  132. package/lib/module/shared/helpers/GameControlButton.js +219 -0
  133. package/lib/module/shared/helpers/GameControlButton.js.map +1 -0
  134. package/lib/module/{games/balloon-blaster/components → shared/helpers}/GameOverModal.js +25 -17
  135. package/lib/module/shared/helpers/GameOverModal.js.map +1 -0
  136. package/lib/module/shared/helpers/GameSettingsModal.js +287 -0
  137. package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -0
  138. package/lib/module/shared/helpers/ParticleBlast.js +133 -0
  139. package/lib/module/shared/helpers/ParticleBlast.js.map +1 -0
  140. package/lib/module/shared/helpers/ResponsiveScoreBoard.js +81 -0
  141. package/lib/module/shared/helpers/ResponsiveScoreBoard.js.map +1 -0
  142. package/lib/module/shared/helpers/index.js +12 -0
  143. package/lib/module/shared/helpers/index.js.map +1 -0
  144. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +2 -14
  145. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  146. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +144 -0
  147. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts.map +1 -0
  148. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +1 -1
  149. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -1
  150. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +12 -2
  151. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -1
  152. package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -1
  153. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +1 -15
  154. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -1
  155. package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -1
  156. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +1 -7
  157. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  158. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +0 -4
  159. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -1
  160. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts +4 -0
  161. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -0
  162. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts +112 -0
  163. package/lib/typescript/src/games/fruit-ninja/FruitNinjaConstants.d.ts.map +1 -0
  164. package/lib/typescript/src/games/{fruit-slicer/FruitSlicerService.d.ts → fruit-ninja/FruitNinjaService.d.ts} +13 -5
  165. package/lib/typescript/src/games/fruit-ninja/FruitNinjaService.d.ts.map +1 -0
  166. package/lib/typescript/src/games/{fruit-slicer/FruitSlicerStore.d.ts → fruit-ninja/FruitNinjaStore.d.ts} +13 -4
  167. package/lib/typescript/src/games/fruit-ninja/FruitNinjaStore.d.ts.map +1 -0
  168. package/lib/typescript/src/games/{fruit-slicer → fruit-ninja}/components/FruitComponent.d.ts +1 -1
  169. package/lib/typescript/src/games/fruit-ninja/components/FruitComponent.d.ts.map +1 -0
  170. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts +3 -0
  171. package/lib/typescript/src/games/fruit-ninja/components/GameArea.d.ts.map +1 -0
  172. package/lib/typescript/src/games/fruit-ninja/components/GameBackground.d.ts.map +1 -0
  173. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts +3 -0
  174. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -0
  175. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts +5 -0
  176. package/lib/typescript/src/games/fruit-ninja/components/index.d.ts.map +1 -0
  177. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +2 -16
  178. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  179. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts +41 -0
  180. package/lib/typescript/src/games/maze-runner/MazeRunnerConstants.d.ts.map +1 -0
  181. package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +4 -2
  182. package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -1
  183. package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -1
  184. package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -1
  185. package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +2 -1
  186. package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -1
  187. package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -1
  188. package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -1
  189. package/lib/typescript/src/games/maze-runner/components/index.d.ts +0 -2
  190. package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -1
  191. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts +5 -0
  192. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -0
  193. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts +45 -0
  194. package/lib/typescript/src/games/popit-fidget/PopitFidgetConstants.d.ts.map +1 -0
  195. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts +33 -0
  196. package/lib/typescript/src/games/popit-fidget/PopitFidgetService.d.ts.map +1 -0
  197. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts +36 -0
  198. package/lib/typescript/src/games/popit-fidget/PopitFidgetStore.d.ts.map +1 -0
  199. package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts +12 -0
  200. package/lib/typescript/src/games/popit-fidget/components/BubbleComponent.d.ts.map +1 -0
  201. package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts +12 -0
  202. package/lib/typescript/src/games/popit-fidget/components/FidgetGrid.d.ts.map +1 -0
  203. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts +9 -0
  204. package/lib/typescript/src/games/popit-fidget/components/GameBackground.d.ts.map +1 -0
  205. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts +8 -0
  206. package/lib/typescript/src/games/popit-fidget/components/ScoreBoard.d.ts.map +1 -0
  207. package/lib/typescript/src/games/popit-fidget/components/index.d.ts +5 -0
  208. package/lib/typescript/src/games/popit-fidget/components/index.d.ts.map +1 -0
  209. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts +4 -0
  210. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -0
  211. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts +71 -0
  212. package/lib/typescript/src/games/space-fighter/SpaceFighterConstants.d.ts.map +1 -0
  213. package/lib/typescript/src/games/{space-traveller/SpaceTravellerService.d.ts → space-fighter/SpaceFighterService.d.ts} +7 -4
  214. package/lib/typescript/src/games/space-fighter/SpaceFighterService.d.ts.map +1 -0
  215. package/lib/typescript/src/games/{space-traveller/SpaceTravellerStore.d.ts → space-fighter/SpaceFighterStore.d.ts} +12 -4
  216. package/lib/typescript/src/games/space-fighter/SpaceFighterStore.d.ts.map +1 -0
  217. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts +8 -0
  218. package/lib/typescript/src/games/space-fighter/components/AsteroidComponent.d.ts.map +1 -0
  219. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts +3 -0
  220. package/lib/typescript/src/games/space-fighter/components/GameArea.d.ts.map +1 -0
  221. package/lib/typescript/src/games/space-fighter/components/GameBackground.d.ts.map +1 -0
  222. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts +3 -0
  223. package/lib/typescript/src/games/space-fighter/components/ScoreBoard.d.ts.map +1 -0
  224. package/lib/typescript/src/games/{space-traveller → space-fighter}/components/Spacecraft3D.d.ts +1 -1
  225. package/lib/typescript/src/games/space-fighter/components/Spacecraft3D.d.ts.map +1 -0
  226. package/lib/typescript/src/games/space-fighter/components/SpacecraftPath.d.ts.map +1 -0
  227. package/lib/typescript/src/games/{space-traveller → space-fighter}/components/index.d.ts +0 -4
  228. package/lib/typescript/src/games/space-fighter/components/index.d.ts.map +1 -0
  229. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts +4 -0
  230. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -0
  231. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +79 -0
  232. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts.map +1 -0
  233. package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts +33 -0
  234. package/lib/typescript/src/games/whack-a-mole/WhackAMoleService.d.ts.map +1 -0
  235. package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts +41 -0
  236. package/lib/typescript/src/games/whack-a-mole/WhackAMoleStore.d.ts.map +1 -0
  237. package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts.map +1 -0
  238. package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameGrid.d.ts +2 -2
  239. package/lib/typescript/src/games/whack-a-mole/components/GameGrid.d.ts.map +1 -0
  240. package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/GameHole.d.ts +3 -2
  241. package/lib/typescript/src/games/whack-a-mole/components/GameHole.d.ts.map +1 -0
  242. package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts +7 -0
  243. package/lib/typescript/src/games/whack-a-mole/components/MoleCharacter.d.ts.map +1 -0
  244. package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -0
  245. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts +6 -0
  246. package/lib/typescript/src/games/whack-a-mole/components/index.d.ts.map +1 -0
  247. package/lib/typescript/src/index.d.ts +4 -3
  248. package/lib/typescript/src/index.d.ts.map +1 -1
  249. package/lib/typescript/src/services/GamesConstants.d.ts +61 -340
  250. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  251. package/lib/typescript/src/services/GamesService.d.ts +21 -3
  252. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  253. package/lib/typescript/src/services/HapticsService.d.ts +16 -0
  254. package/lib/typescript/src/services/HapticsService.d.ts.map +1 -0
  255. package/lib/typescript/src/services/SoundsService.d.ts +154 -0
  256. package/lib/typescript/src/services/SoundsService.d.ts.map +1 -0
  257. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts +41 -0
  258. package/lib/typescript/src/shared/helpers/AnimationFrame.d.ts.map +1 -0
  259. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts +45 -0
  260. package/lib/typescript/src/shared/helpers/AnimationTracker.d.ts.map +1 -0
  261. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts +124 -0
  262. package/lib/typescript/src/shared/helpers/ErrorHandler.d.ts.map +1 -0
  263. package/lib/typescript/src/shared/helpers/GameControlButton.d.ts +17 -0
  264. package/lib/typescript/src/shared/helpers/GameControlButton.d.ts.map +1 -0
  265. package/lib/typescript/src/{games/cat-popper/components → shared/helpers}/GameOverModal.d.ts +5 -0
  266. package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -0
  267. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts +9 -0
  268. package/lib/typescript/src/shared/helpers/GameSettingsModal.d.ts.map +1 -0
  269. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts +12 -0
  270. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -0
  271. package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts +42 -0
  272. package/lib/typescript/src/shared/helpers/ResponsiveScoreBoard.d.ts.map +1 -0
  273. package/lib/typescript/src/shared/helpers/index.d.ts +13 -0
  274. package/lib/typescript/src/shared/helpers/index.d.ts.map +1 -0
  275. package/package.json +9 -6
  276. package/lib/module/games/balloon-blaster/components/GameControls.js +0 -229
  277. package/lib/module/games/balloon-blaster/components/GameControls.js.map +0 -1
  278. package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +0 -1
  279. package/lib/module/games/balloon-blaster/components/ParticleSystem.js +0 -52
  280. package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +0 -1
  281. package/lib/module/games/balloon-blaster/components/SliceTrail.js +0 -58
  282. package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +0 -1
  283. package/lib/module/games/cat-popper/CatPopper.js +0 -230
  284. package/lib/module/games/cat-popper/CatPopper.js.map +0 -1
  285. package/lib/module/games/cat-popper/CatPopperService.js +0 -100
  286. package/lib/module/games/cat-popper/CatPopperService.js.map +0 -1
  287. package/lib/module/games/cat-popper/CatPopperStore.js +0 -113
  288. package/lib/module/games/cat-popper/CatPopperStore.js.map +0 -1
  289. package/lib/module/games/cat-popper/components/CatCharacter.js.map +0 -1
  290. package/lib/module/games/cat-popper/components/GameBackground.js.map +0 -1
  291. package/lib/module/games/cat-popper/components/GameControls.js +0 -230
  292. package/lib/module/games/cat-popper/components/GameControls.js.map +0 -1
  293. package/lib/module/games/cat-popper/components/GameGrid.js +0 -66
  294. package/lib/module/games/cat-popper/components/GameGrid.js.map +0 -1
  295. package/lib/module/games/cat-popper/components/GameHole.js.map +0 -1
  296. package/lib/module/games/cat-popper/components/GameOverModal.js +0 -131
  297. package/lib/module/games/cat-popper/components/GameOverModal.js.map +0 -1
  298. package/lib/module/games/cat-popper/components/ScoreBoard.js.map +0 -1
  299. package/lib/module/games/cat-popper/components/index.js.map +0 -1
  300. package/lib/module/games/fruit-slicer/FruitSlicer.js +0 -411
  301. package/lib/module/games/fruit-slicer/FruitSlicer.js.map +0 -1
  302. package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +0 -1
  303. package/lib/module/games/fruit-slicer/FruitSlicerStore.js +0 -156
  304. package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +0 -1
  305. package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +0 -1
  306. package/lib/module/games/fruit-slicer/components/GameArea.js +0 -50
  307. package/lib/module/games/fruit-slicer/components/GameArea.js.map +0 -1
  308. package/lib/module/games/fruit-slicer/components/GameBackground.js.map +0 -1
  309. package/lib/module/games/fruit-slicer/components/GameControls.js +0 -230
  310. package/lib/module/games/fruit-slicer/components/GameControls.js.map +0 -1
  311. package/lib/module/games/fruit-slicer/components/GameOverModal.js +0 -189
  312. package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +0 -1
  313. package/lib/module/games/fruit-slicer/components/ParticleSystem.js +0 -52
  314. package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +0 -1
  315. package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +0 -1
  316. package/lib/module/games/fruit-slicer/components/SliceTrail.js +0 -58
  317. package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +0 -1
  318. package/lib/module/games/fruit-slicer/components/index.js +0 -11
  319. package/lib/module/games/fruit-slicer/components/index.js.map +0 -1
  320. package/lib/module/games/maze-runner/components/GameControls.js +0 -129
  321. package/lib/module/games/maze-runner/components/GameControls.js.map +0 -1
  322. package/lib/module/games/maze-runner/components/GameOverModal.js +0 -134
  323. package/lib/module/games/maze-runner/components/GameOverModal.js.map +0 -1
  324. package/lib/module/games/space-traveller/SpaceTraveller.js +0 -393
  325. package/lib/module/games/space-traveller/SpaceTraveller.js.map +0 -1
  326. package/lib/module/games/space-traveller/SpaceTravellerService.js.map +0 -1
  327. package/lib/module/games/space-traveller/SpaceTravellerStore.js +0 -139
  328. package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +0 -1
  329. package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +0 -1
  330. package/lib/module/games/space-traveller/components/GameArea.js +0 -75
  331. package/lib/module/games/space-traveller/components/GameArea.js.map +0 -1
  332. package/lib/module/games/space-traveller/components/GameBackground.js.map +0 -1
  333. package/lib/module/games/space-traveller/components/GameControls.js +0 -177
  334. package/lib/module/games/space-traveller/components/GameControls.js.map +0 -1
  335. package/lib/module/games/space-traveller/components/GameOverModal.js +0 -182
  336. package/lib/module/games/space-traveller/components/GameOverModal.js.map +0 -1
  337. package/lib/module/games/space-traveller/components/ParticleComponent.js +0 -34
  338. package/lib/module/games/space-traveller/components/ParticleComponent.js.map +0 -1
  339. package/lib/module/games/space-traveller/components/ScoreBoard.js.map +0 -1
  340. package/lib/module/games/space-traveller/components/SettingsModal.js +0 -222
  341. package/lib/module/games/space-traveller/components/SettingsModal.js.map +0 -1
  342. package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +0 -1
  343. package/lib/module/games/space-traveller/components/SpacecraftPath.js +0 -37
  344. package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +0 -1
  345. package/lib/module/games/space-traveller/components/index.js.map +0 -1
  346. package/lib/module/shared/settings/GameSettings.js +0 -295
  347. package/lib/module/shared/settings/GameSettings.js.map +0 -1
  348. package/lib/module/shared/settings/SettingsService.js +0 -119
  349. package/lib/module/shared/settings/SettingsService.js.map +0 -1
  350. package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +0 -10
  351. package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +0 -1
  352. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +0 -9
  353. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +0 -1
  354. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +0 -8
  355. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +0 -1
  356. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +0 -11
  357. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +0 -1
  358. package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +0 -13
  359. package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +0 -1
  360. package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +0 -32
  361. package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +0 -1
  362. package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +0 -21
  363. package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +0 -1
  364. package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +0 -7
  365. package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +0 -1
  366. package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +0 -1
  367. package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +0 -10
  368. package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +0 -1
  369. package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +0 -1
  370. package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +0 -1
  371. package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +0 -1
  372. package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +0 -1
  373. package/lib/typescript/src/games/cat-popper/components/index.d.ts +0 -8
  374. package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +0 -1
  375. package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +0 -16
  376. package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +0 -1
  377. package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +0 -1
  378. package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +0 -1
  379. package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +0 -1
  380. package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +0 -17
  381. package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +0 -1
  382. package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +0 -1
  383. package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +0 -10
  384. package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +0 -1
  385. package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +0 -9
  386. package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +0 -1
  387. package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +0 -8
  388. package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +0 -1
  389. package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +0 -9
  390. package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +0 -1
  391. package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +0 -11
  392. package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +0 -1
  393. package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +0 -9
  394. package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +0 -1
  395. package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +0 -10
  396. package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +0 -1
  397. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +0 -11
  398. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +0 -1
  399. package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +0 -17
  400. package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +0 -1
  401. package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +0 -1
  402. package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +0 -1
  403. package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +0 -9
  404. package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +0 -1
  405. package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +0 -17
  406. package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +0 -1
  407. package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +0 -1
  408. package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +0 -10
  409. package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +0 -1
  410. package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +0 -9
  411. package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +0 -1
  412. package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +0 -8
  413. package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +0 -1
  414. package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +0 -8
  415. package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +0 -1
  416. package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +0 -9
  417. package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +0 -1
  418. package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +0 -1
  419. package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +0 -1
  420. package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +0 -1
  421. package/lib/typescript/src/shared/settings/GameSettings.d.ts +0 -36
  422. package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +0 -1
  423. package/lib/typescript/src/shared/settings/SettingsService.d.ts +0 -32
  424. package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +0 -1
  425. /package/lib/typescript/src/games/{cat-popper → fruit-ninja}/components/GameBackground.d.ts +0 -0
  426. /package/lib/typescript/src/games/{fruit-slicer → space-fighter}/components/GameBackground.d.ts +0 -0
  427. /package/lib/typescript/src/games/{space-traveller → space-fighter}/components/SpacecraftPath.d.ts +0 -0
  428. /package/lib/typescript/src/games/{space-traveller → whack-a-mole}/components/GameBackground.d.ts +0 -0
  429. /package/lib/typescript/src/games/{cat-popper → whack-a-mole}/components/ScoreBoard.d.ts +0 -0
@@ -1,343 +1,111 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useEffect, useRef } 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 * as Speech from 'expo-speech';
8
- import * as Haptics from 'expo-haptics';
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, GameControls, GameOverModal, GameBackground } from "./components/index.js";
12
- // Define game-specific types and constants locally
13
-
14
- const DEFAULT_BALLOON_BLASTER_SETTINGS = {
15
- gameDuration: 120,
16
- difficulty: 'medium',
17
- soundEnabled: true,
18
- hapticEnabled: true
19
- };
20
- const getDifficultySpawnInterval = difficulty => {
21
- const intervals = {
22
- easy: 2000,
23
- medium: 1500,
24
- hard: 1000
25
- };
26
- return intervals[difficulty];
27
- };
28
- import { GameSettings } from "../../shared/settings/GameSettings.js";
29
- 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";
30
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
13
  export const BalloonBlaster = ({
32
- settings: externalSettings = DEFAULT_BALLOON_BLASTER_SETTINGS,
33
- onSettingsChange,
34
- showSettingsModal = false,
35
- onToggleSettingsModal
14
+ settings,
15
+ onSettingsChange
36
16
  }) => {
37
- // Create unified game settings store
38
- const useSettings = React.useMemo(() => {
39
- return createGameSettingsStore(externalSettings, onSettingsChange);
40
- }, []); // Empty dependency array - create store only once
41
-
42
- const settings = useSettings();
43
-
44
- // Track previous settings to prevent infinite loops
45
- const prevSettingsRef = React.useRef(externalSettings);
46
-
47
- // Update settings when external settings change (only if actually different)
48
- React.useEffect(() => {
49
- if (!externalSettings) return;
50
- const prev = prevSettingsRef.current;
51
- if (!prev) {
52
- settings.updateSettings(externalSettings);
53
- prevSettingsRef.current = externalSettings;
54
- return;
55
- }
56
- const hasChanged = prev.difficulty !== externalSettings.difficulty || prev.soundEnabled !== externalSettings.soundEnabled || prev.hapticEnabled !== externalSettings.hapticEnabled;
57
- if (hasChanged) {
58
- settings.updateSettings(externalSettings);
59
- prevSettingsRef.current = externalSettings;
60
- }
61
- }, [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
62
32
  const {
63
- score,
64
- timeLeft,
65
- isPlaying,
66
- gameOver,
67
- lives,
68
- balloons,
69
- slicePath,
70
- isSlicing,
71
- startGame,
72
- stopGame,
73
- resetGame,
74
- popBalloon,
75
- decrementTime,
76
- addBalloon,
77
- removeBalloon,
78
- updateBalloon,
79
- setSlicePath,
80
- setIsSlicing,
81
- resetCombo,
82
- loseLife,
83
- addLife
84
- } = useBalloonBlasterStore();
85
-
86
- // Simple animation tracking without shared values
87
- const balloonAnimations = useRef(new Map()).current;
88
- const particleAnimations = useRef(new Map()).current;
33
+ balloonAnimations,
34
+ particleAnimations
35
+ } = useAnimationTrackers(['balloonAnimations', 'particleAnimations']);
89
36
 
90
- // Game service
91
- const gameService = useRef(createBalloonBlasterService(balloonAnimations, particleAnimations)).current;
37
+ // Error handling for the game
38
+ const {
39
+ wrapFunction,
40
+ safeExecute
41
+ } = useGameErrorHandler(GAME_IDS.BALLOON_BLASTER);
92
42
 
93
- // Slice path tracking
94
- const currentSlicePath = useRef([]);
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;
95
47
 
96
- // Helper functions for gesture handling
97
- const checkBalloonIntersections = slicePath => {
98
- const currentBalloons = useBalloonBlasterStore.getState().balloons;
99
- currentBalloons.forEach(balloon => {
100
- if (!balloon.isPopped && gameService.checkBalloonPop(balloon, slicePath)) {
101
- handleBalloonPop(balloon.id);
102
- }
103
- });
104
- };
105
- const clearSlicePath = () => {
106
- setTimeout(() => {
107
- currentSlicePath.current = [];
108
- setSlicePath([]);
109
- }, 200);
110
- };
48
+ // Initialize game settings on mount
49
+ useEffect(() => {
50
+ return () => {
51
+ handleResetGame();
52
+ };
53
+ }, []);
111
54
 
112
- // Sound and haptic feedback
113
- const playPopSound = _balloonType => {
114
- if (settings.soundEnabled) {
115
- Speech.speak('Pop!', {
116
- pitch: 1.5,
117
- rate: 2.5,
118
- volume: 0.6
119
- });
120
- }
121
- // Always provide haptic feedback for better game feel
122
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
123
- };
124
- const playBombSound = () => {
125
- if (settings.soundEnabled) {
126
- Speech.speak('Boom!', {
127
- pitch: 0.8,
128
- rate: 1.5,
129
- volume: 0.8
130
- });
55
+ // Auto-stop balloon spawning when game over state changes
56
+ useEffect(() => {
57
+ if (gameOver && gameService) {
58
+ // Stop all timers and physics when game over
59
+ gameService.cleanup();
131
60
  }
132
- // Always provide haptic feedback for bombs
133
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy);
134
- };
61
+ }, [gameOver, gameService]);
135
62
 
136
- // Game control functions
137
- const handleStartGame = () => {
138
- startGame(settings.gameDuration);
139
- gameService.resetAnimations();
140
- gameService.startGameTimer(decrementTime);
141
- gameService.startBalloonSpawning(spawnBalloon, getDifficultySpawnInterval(settings.difficulty));
142
- gameService.startPhysicsLoop(updateBalloon, removeBalloon, () => useBalloonBlasterStore.getState().balloons);
143
- };
144
- const handleStopGame = () => {
145
- stopGame();
146
- gameService.cleanup();
147
- gameService.resetAnimations();
148
- currentSlicePath.current = [];
149
- setSlicePath([]);
150
- setIsSlicing(false);
151
- };
152
- const handleResetGame = () => {
153
- gameService.cleanup();
63
+ // Game control functions with error handling
64
+ const handleStartGame = wrapFunction(() => {
65
+ // AGGRESSIVE cleanup - force clear everything
154
66
  resetGame();
155
- gameService.resetAnimations();
156
- currentSlicePath.current = [];
157
- setSlicePath([]);
158
- setIsSlicing(false);
159
- };
160
-
161
- // Balloon spawning
162
- const spawnBalloon = balloon => {
163
- addBalloon(balloon);
164
- };
165
-
166
- // Balloon popping logic
167
- const handleBalloonPop = balloonId => {
168
- // Double-check game state to prevent race conditions
169
- const currentState = useBalloonBlasterStore.getState();
170
- if (!currentState.isPlaying || currentState.gameOver) return;
171
- const balloon = balloons.find(b => b.id === balloonId);
172
- if (!balloon || balloon.isPopped) return;
173
-
174
- // Handle different balloon types BEFORE marking as popped
175
- if (balloon.isBomb) {
176
- // Bomb hit - lose life and end combo
177
- playBombSound();
178
-
179
- // Check current state again before losing life
180
- const stateBeforeLoss = useBalloonBlasterStore.getState();
181
- if (stateBeforeLoss.lives > 0 && stateBeforeLoss.isPlaying && !stateBeforeLoss.gameOver) {
182
- loseLife();
183
- resetCombo();
184
- }
185
-
186
- // Create explosion particles
187
- gameService.createPopParticles(balloon);
188
67
 
189
- // Mark bomb as popped after processing
190
- updateBalloon(balloonId, {
191
- isPopped: true
192
- });
193
- } else {
194
- // Handle different balloon types with simplified mechanics
195
- playPopSound(balloon.type.name);
196
- if (balloon.isBonus) {
197
- // Star balloon - add a life instead of points
198
- addLife();
199
- playPopSound('bonus life!');
200
- // Mark star as popped after processing
201
- updateBalloon(balloonId, {
202
- isPopped: true
203
- });
204
- } else {
205
- // Regular balloon - add 10 points (popBalloon handles marking)
206
- popBalloon(balloonId);
207
- }
208
-
209
- // Create pop particles
210
- gameService.createPopParticles(balloon);
68
+ // Force clear any existing balloons immediately
69
+ const currentBalloons = useBalloonBlasterStore.getState().balloons;
70
+ currentBalloons.forEach(balloon => removeBalloon(balloon.id));
211
71
 
212
- // Remove combo system - no more combo sounds
72
+ // Clean up service
73
+ if (gameService) {
74
+ gameService.cleanup();
75
+ gameService.resetAnimations();
213
76
  }
214
77
 
215
- // Remove balloon after animation
78
+ // Longer delay to ensure complete cleanup
216
79
  setTimeout(() => {
217
- removeBalloon(balloonId);
218
- balloonAnimations.delete(balloonId);
219
- }, 500);
220
- };
221
-
222
- // Gesture handling for slicing
223
- const handleGestureStart = event => {
224
- if (!isPlaying) return;
225
- currentSlicePath.current = [{
226
- x: event.x,
227
- y: event.y
228
- }];
229
- setIsSlicing(true);
230
- setSlicePath([{
231
- x: event.x,
232
- y: event.y
233
- }]);
234
-
235
- // Light haptic feedback on slice start
236
- Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
237
- };
238
- const handleGestureUpdate = event => {
239
- if (!isPlaying) return;
240
- const newPoint = {
241
- x: event.x,
242
- y: event.y
243
- };
244
- currentSlicePath.current.push(newPoint);
245
-
246
- // Limit slice path length for performance
247
- if (currentSlicePath.current.length > GAME_CONFIG.SLICE_TRAIL_LENGTH) {
248
- currentSlicePath.current.shift();
249
- }
250
- setSlicePath([...currentSlicePath.current]);
251
-
252
- // Check for balloon intersections
253
- checkBalloonIntersections(currentSlicePath.current);
254
- };
255
- const handleGestureEnd = () => {
256
- if (!isPlaying) return;
257
- setIsSlicing(false);
258
- clearSlicePath();
259
- };
260
- const panGesture = Gesture.Pan().onStart(event => {
261
- runOnJS(handleGestureStart)(event);
262
- }).onUpdate(event => {
263
- runOnJS(handleGestureUpdate)(event);
264
- }).onEnd(() => {
265
- runOnJS(handleGestureEnd)();
266
- });
267
-
268
- // Track balloon animations without shared values
269
- useEffect(() => {
270
- balloons.forEach(balloon => {
271
- if (!balloonAnimations.has(balloon.id)) {
272
- // Simple animation state tracking
273
- balloonAnimations.set(balloon.id, {
274
- scale: 1,
275
- opacity: 1
276
- });
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);
277
85
  }
278
- });
279
- }, [balloons]);
280
-
281
- // Initialize and cleanup
282
- useEffect(() => {
283
- return () => {
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) {
284
97
  gameService.cleanup();
285
- };
286
- }, []);
287
-
288
- // Cleanup when game ends (gameOver becomes true)
289
- useEffect(() => {
290
- if (gameOver) {
291
- // Use a timeout to ensure state has settled
292
- const cleanupTimeout = setTimeout(() => {
293
- // Immediately stop all game activities
294
- gameService.cleanup();
295
-
296
- // Clear all existing balloons from the screen
297
- const currentBalloons = [...balloons]; // Create a copy to avoid mutation during iteration
298
- currentBalloons.forEach(balloon => {
299
- removeBalloon(balloon.id);
300
- balloonAnimations.delete(balloon.id);
301
- });
302
-
303
- // Clear slice path
304
- currentSlicePath.current = [];
305
- setSlicePath([]);
306
- setIsSlicing(false);
307
- }, 50); // Small delay to ensure state consistency
308
-
309
- return () => clearTimeout(cleanupTimeout);
310
98
  }
311
- return () => {}; // Return empty cleanup function when condition is not met
312
- }, [gameOver, balloons, removeBalloon]); // Include necessary dependencies
99
+ resetGame();
100
+ if (gameService) {
101
+ gameService.resetAnimations();
102
+ }
103
+ }, GameErrorType.UNKNOWN_ERROR);
313
104
 
314
- // Auto-remove balloons that float off screen (top)
315
- useEffect(() => {
316
- if (!isPlaying || gameOver) return;
317
- const interval = setInterval(() => {
318
- // Check if game is still active before processing
319
- const currentState = useBalloonBlasterStore.getState();
320
- if (!currentState.isPlaying || currentState.gameOver) {
321
- return;
322
- }
323
- balloons.forEach(balloon => {
324
- if (balloon.position.y < -100 && !balloon.isPopped) {
325
- // Balloon floated off screen without being popped
326
- if (!balloon.isBomb && !balloon.isBonus) {
327
- // Only lose life for regular balloons and if game is still active
328
- const livesBeforeLoss = useBalloonBlasterStore.getState().lives;
329
- if (livesBeforeLoss > 0) {
330
- loseLife();
331
- // The useEffect will handle cleanup when gameOver becomes true
332
- }
333
- }
334
- removeBalloon(balloon.id);
335
- balloonAnimations.delete(balloon.id);
336
- }
337
- });
338
- }, 100);
339
- return () => clearInterval(interval);
340
- }, [isPlaying, gameOver, balloons, removeBalloon, loseLife]);
105
+ // Balloon spawning
106
+ const spawnBalloon = balloon => {
107
+ addBalloon(balloon);
108
+ };
341
109
  return /*#__PURE__*/_jsx(GestureHandlerRootView, {
342
110
  style: {
343
111
  flex: 1
@@ -345,39 +113,36 @@ export const BalloonBlaster = ({
345
113
  children: /*#__PURE__*/_jsx(View, {
346
114
  style: styles.container,
347
115
  children: /*#__PURE__*/_jsxs(GameBackground, {
348
- children: [/*#__PURE__*/_jsx(ScoreBoard, {
349
- score: score,
350
- timeLeft: timeLeft,
351
- lives: lives
352
- }), /*#__PURE__*/_jsx(GestureDetector, {
353
- gesture: panGesture,
354
- children: /*#__PURE__*/_jsx(GameArea, {
355
- balloons: balloons,
356
- balloonAnimations: balloonAnimations,
357
- slicePath: slicePath,
358
- isSlicing: isSlicing,
359
- particles: gameService.getParticles(),
360
- onBalloonPop: handleBalloonPop
361
- })
362
- }), /*#__PURE__*/_jsx(GameControls, {
116
+ children: [/*#__PURE__*/_jsx(GameArea, {}), /*#__PURE__*/_jsx(View, {
117
+ style: styles.scoreboardContainer,
118
+ children: /*#__PURE__*/_jsx(ScoreBoard, {})
119
+ }), /*#__PURE__*/_jsx(GameControlButton, {
363
120
  isPlaying: isPlaying,
364
121
  gameOver: gameOver,
365
122
  onStartGame: handleStartGame,
366
- onStopGame: handleStopGame
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"
367
132
  }), /*#__PURE__*/_jsx(GameOverModal, {
368
133
  isVisible: gameOver,
369
134
  score: score,
370
- onPlayAgain: handleResetGame
371
- }), /*#__PURE__*/_jsx(Modal, {
372
- visible: showSettingsModal,
373
- animationType: "slide",
374
- presentationStyle: "pageSheet",
375
- onRequestClose: onToggleSettingsModal,
376
- children: /*#__PURE__*/_jsx(GameSettings, {
377
- gameId: "balloon-blaster",
378
- onClose: onToggleSettingsModal || (() => {}),
379
- settingsStore: settings
380
- })
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
381
146
  })]
382
147
  })
383
148
  })
@@ -386,6 +151,14 @@ export const BalloonBlaster = ({
386
151
  const styles = StyleSheet.create({
387
152
  container: {
388
153
  flex: 1
154
+ },
155
+ scoreboardContainer: {
156
+ position: 'absolute',
157
+ top: 0,
158
+ left: 20,
159
+ right: 20,
160
+ zIndex: 10,
161
+ pointerEvents: 'none' // Allow touches to pass through to GameArea
389
162
  }
390
163
  });
391
164
  //# sourceMappingURL=BalloonBlaster.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useRef","View","StyleSheet","Modal","runOnJS","Gesture","GestureDetector","GestureHandlerRootView","Speech","Haptics","useBalloonBlasterStore","createBalloonBlasterService","GAME_CONFIG","ScoreBoard","GameArea","GameControls","GameOverModal","GameBackground","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","slicePath","isSlicing","startGame","stopGame","resetGame","popBalloon","decrementTime","addBalloon","removeBalloon","updateBalloon","setSlicePath","setIsSlicing","resetCombo","loseLife","addLife","balloonAnimations","Map","particleAnimations","gameService","currentSlicePath","checkBalloonIntersections","currentBalloons","getState","forEach","balloon","isPopped","checkBalloonPop","handleBalloonPop","id","clearSlicePath","setTimeout","playPopSound","_balloonType","speak","pitch","rate","volume","impactAsync","ImpactFeedbackStyle","Light","playBombSound","Heavy","handleStartGame","resetAnimations","startGameTimer","startBalloonSpawning","spawnBalloon","startPhysicsLoop","handleStopGame","cleanup","handleResetGame","balloonId","currentState","find","b","isBomb","stateBeforeLoss","createPopParticles","type","name","isBonus","delete","handleGestureStart","event","x","y","handleGestureUpdate","newPoint","push","length","SLICE_TRAIL_LENGTH","shift","handleGestureEnd","panGesture","Pan","onStart","onUpdate","onEnd","has","set","scale","opacity","cleanupTimeout","clearTimeout","interval","setInterval","position","livesBeforeLoss","clearInterval","style","flex","children","styles","container","gesture","particles","getParticles","onBalloonPop","onStartGame","onStopGame","isVisible","onPlayAgain","visible","animationType","presentationStyle","onRequestClose","gameId","onClose","settingsStore","create"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlaster.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AACtD,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAASC,OAAO,EAAEC,eAAe,EAAEC,sBAAsB,QAAQ,8BAA8B;AAC/F,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,sBAAsB,QAAQ,0BAAuB;AAC9D,SAAS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andlerRootView","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,MAAM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