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,34 +1,46 @@
1
1
  "use strict";
2
2
 
3
+ import { produce } from 'immer';
4
+ export const DEFAULT_GAME_SETTINGS = {
5
+ isVisible: false,
6
+ difficulty: 'medium',
7
+ enableSounds: true,
8
+ enableHaptics: true
9
+ };
10
+ export let GAME_IDS = /*#__PURE__*/function (GAME_IDS) {
11
+ GAME_IDS["WHACK_A_MOLE"] = "whack-a-mole";
12
+ GAME_IDS["POPIT_FIDGET"] = "popit-fidget";
13
+ GAME_IDS["FRUIT_NINJA"] = "fruit-ninja";
14
+ GAME_IDS["BALLOON_BLASTER"] = "balloon-blaster";
15
+ GAME_IDS["SPACE_FIGHTER"] = "space-fighter";
16
+ GAME_IDS["MAZE_RUNNER"] = "maze-runner";
17
+ return GAME_IDS;
18
+ }({});
19
+ ;
3
20
  export const gamesList = [{
4
- id: 'cat-popper',
5
- title: 'Cat Popper',
6
- description: 'Classic cat popper game with fun animations and sound effects',
7
- icon: 'hammer',
8
- color: '#ff6b6b'
21
+ id: GAME_IDS.WHACK_A_MOLE,
22
+ title: 'Whack A Mole',
23
+ description: 'Whack cute cats popping from holes - fast reflexes needed!'
9
24
  }, {
10
- id: 'fruit-slicer',
11
- title: 'Fruit Slicer',
12
- description: 'Slice fruits with smooth gesture controls and particle effects',
13
- icon: 'cut',
14
- color: '#4ecdc4'
25
+ id: GAME_IDS.POPIT_FIDGET,
26
+ title: 'Popit Fidget',
27
+ description: 'Pop satisfying bubbles in this relaxing fidget toy game'
15
28
  }, {
16
- id: 'balloon-blaster',
29
+ id: GAME_IDS.FRUIT_NINJA,
30
+ title: 'Fruit Ninja',
31
+ description: 'Slice flying fruits with finger swipes - avoid the bombs!'
32
+ }, {
33
+ id: GAME_IDS.BALLOON_BLASTER,
17
34
  title: 'Balloon Blaster',
18
- description: 'Pop colorful balloons rising from the bottom with gesture controls',
19
- icon: 'balloon',
20
- color: '#ff9ff3'
35
+ description: 'Pop rising balloons before they escape - quick taps win!'
21
36
  }, {
22
- id: 'space-traveller',
23
- title: 'Space Traveller',
24
- description: 'Navigate through space avoiding asteroids in this endless travelling',
25
- icon: 'rocket',
26
- color: '#45b7d1'
37
+ id: GAME_IDS.SPACE_FIGHTER,
38
+ title: 'Space Fighter',
39
+ description: 'Pilot spaceship through asteroid fields in endless space'
27
40
  }, {
28
- id: 'maze-runner',
41
+ id: GAME_IDS.MAZE_RUNNER,
29
42
  title: 'Maze Runner',
30
- description: 'Guide the ball through complex mazes with physics-based gameplay',
31
- icon: 'trail-sign',
32
- color: '#96ceb4'
43
+ description: 'Navigate ball through mazes using tilt and physics controls'
33
44
  }];
45
+ export const immerMiddleware = config => (set, get, api) => config(fn => set(produce(fn)), get, api);
34
46
  //# sourceMappingURL=GamesService.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["gamesList","id","title","description","icon","color"],"sourceRoot":"../../../src","sources":["services/GamesService.ts"],"mappings":";;AAAA,OAAO,MAAMA,SAAS,GAAG,CACvB;EACEC,EAAE,EAAE,YAAY;EAChBC,KAAK,EAAE,YAAY;EACnBC,WAAW,EAAE,+DAA+D;EAC5EC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;AACT,CAAC,EACD;EACEJ,EAAE,EAAE,cAAc;EAClBC,KAAK,EAAE,cAAc;EACrBC,WAAW,EAAE,gEAAgE;EAC7EC,IAAI,EAAE,KAAK;EACXC,KAAK,EAAE;AACT,CAAC,EACD;EACEJ,EAAE,EAAE,iBAAiB;EACrBC,KAAK,EAAE,iBAAiB;EACxBC,WAAW,EAAE,oEAAoE;EACjFC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE;AACT,CAAC,EACD;EACEJ,EAAE,EAAE,iBAAiB;EACrBC,KAAK,EAAE,iBAAiB;EACxBC,WAAW,EAAE,sEAAsE;EACnFC,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;AACT,CAAC,EACD;EACEJ,EAAE,EAAE,aAAa;EACjBC,KAAK,EAAE,aAAa;EACpBC,WAAW,EAAE,kEAAkE;EAC/EC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE;AACT,CAAC,CACF","ignoreList":[]}
1
+ {"version":3,"names":["produce","DEFAULT_GAME_SETTINGS","isVisible","difficulty","enableSounds","enableHaptics","GAME_IDS","gamesList","id","WHACK_A_MOLE","title","description","POPIT_FIDGET","FRUIT_NINJA","BALLOON_BLASTER","SPACE_FIGHTER","MAZE_RUNNER","immerMiddleware","config","set","get","api","fn"],"sourceRoot":"../../../src","sources":["services/GamesService.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAc/B,OAAO,MAAMC,qBAAmC,GAAG;EACjDC,SAAS,EAAE,KAAK;EAChBC,UAAU,EAAE,QAAQ;EACpBC,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE;AACjB,CAAC;AAED,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAOnB;AAED,OAAO,MAAMC,SAAS,GAAG,CACvB;EACEC,EAAE,EAAEF,QAAQ,CAACG,YAAY;EACzBC,KAAK,EAAE,cAAc;EACrBC,WAAW,EAAE;AACf,CAAC,EACD;EACEH,EAAE,EAAEF,QAAQ,CAACM,YAAY;EACzBF,KAAK,EAAE,cAAc;EACrBC,WAAW,EAAE;AACf,CAAC,EACD;EACEH,EAAE,EAAEF,QAAQ,CAACO,WAAW;EACxBH,KAAK,EAAE,aAAa;EACpBC,WAAW,EAAE;AACf,CAAC,EACD;EACEH,EAAE,EAAEF,QAAQ,CAACQ,eAAe;EAC5BJ,KAAK,EAAE,iBAAiB;EACxBC,WAAW,EAAE;AACf,CAAC,EACD;EACEH,EAAE,EAAEF,QAAQ,CAACS,aAAa;EAC1BL,KAAK,EAAE,eAAe;EACtBC,WAAW,EAAE;AACf,CAAC,EACD;EACEH,EAAE,EAAEF,QAAQ,CAACU,WAAW;EACxBN,KAAK,EAAE,aAAa;EACpBC,WAAW,EAAE;AACf,CAAC,CACF;AAED,OAAO,MAAMM,eAAe,GAAIC,MAAW,IAAK,CAACC,GAAQ,EAAEC,GAAQ,EAAEC,GAAQ,KAAKH,MAAM,CAAEI,EAAO,IAAKH,GAAG,CAACnB,OAAO,CAACsB,EAAE,CAAC,CAAC,EAAEF,GAAG,EAAEC,GAAG,CAAC","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ import * as Haptics from 'expo-haptics';
4
+ export let HapticType = /*#__PURE__*/function (HapticType) {
5
+ HapticType["LIGHT"] = "light";
6
+ HapticType["MEDIUM"] = "medium";
7
+ HapticType["HEAVY"] = "heavy";
8
+ HapticType["SUCCESS"] = "success";
9
+ HapticType["WARNING"] = "warning";
10
+ HapticType["ERROR"] = "error";
11
+ HapticType["SELECTION"] = "selection";
12
+ return HapticType;
13
+ }({});
14
+
15
+ // Cache haptics availability to avoid repeated failed attempts
16
+ let hapticsDisabled = false;
17
+
18
+ /**
19
+ * Play haptic feedback with robust error handling
20
+ * @param type - Type of haptic feedback to play
21
+ * @param hapticEnabled - Whether haptic feedback is enabled in settings
22
+ */
23
+ export const playHaptic = (type, hapticEnabled = false) => {
24
+ // Early return if haptics are disabled in settings or previously failed
25
+ if (!hapticEnabled || hapticsDisabled) return;
26
+ try {
27
+ switch (type) {
28
+ case HapticType.LIGHT:
29
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light).catch(error => {
30
+ console.warn('Light haptic failed:', error);
31
+ hapticsDisabled = true;
32
+ });
33
+ break;
34
+ case HapticType.MEDIUM:
35
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium).catch(error => {
36
+ console.warn('Medium haptic failed:', error);
37
+ hapticsDisabled = true;
38
+ });
39
+ break;
40
+ case HapticType.HEAVY:
41
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Heavy).catch(error => {
42
+ console.warn('Heavy haptic failed:', error);
43
+ hapticsDisabled = true;
44
+ });
45
+ break;
46
+ case HapticType.SUCCESS:
47
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success).catch(error => {
48
+ console.warn('Success haptic failed:', error);
49
+ hapticsDisabled = true;
50
+ });
51
+ break;
52
+ case HapticType.WARNING:
53
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Warning).catch(error => {
54
+ console.warn('Warning haptic failed:', error);
55
+ hapticsDisabled = true;
56
+ });
57
+ break;
58
+ case HapticType.ERROR:
59
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error).catch(error => {
60
+ console.warn('Error haptic failed:', error);
61
+ hapticsDisabled = true;
62
+ });
63
+ break;
64
+ case HapticType.SELECTION:
65
+ Haptics.selectionAsync().catch(error => {
66
+ console.warn('Selection haptic failed:', error);
67
+ hapticsDisabled = true;
68
+ });
69
+ break;
70
+ }
71
+ } catch (error) {
72
+ // Synchronous error handling - disable haptics completely
73
+ console.warn('Haptic feedback failed, disabling haptics:', error);
74
+ hapticsDisabled = true;
75
+ }
76
+ };
77
+ //# sourceMappingURL=HapticsService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Haptics","HapticType","hapticsDisabled","playHaptic","type","hapticEnabled","LIGHT","impactAsync","ImpactFeedbackStyle","Light","catch","error","console","warn","MEDIUM","Medium","HEAVY","Heavy","SUCCESS","notificationAsync","NotificationFeedbackType","Success","WARNING","Warning","ERROR","Error","SELECTION","selectionAsync"],"sourceRoot":"../../../src","sources":["services/HapticsService.ts"],"mappings":";;AAAA,OAAO,KAAKA,OAAO,MAAM,cAAc;AAEvC,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;;AAUtB;AACA,IAAIC,eAAe,GAAG,KAAK;;AAE3B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAACC,IAAgB,EAAEC,aAAsB,GAAG,KAAK,KAAW;EACpF;EACA,IAAI,CAACA,aAAa,IAAIH,eAAe,EAAE;EAEvC,IAAI;IACF,QAAQE,IAAI;MACV,KAAKH,UAAU,CAACK,KAAK;QACnBN,OAAO,CAACO,WAAW,CAACP,OAAO,CAACQ,mBAAmB,CAACC,KAAK,CAAC,CAACC,KAAK,CAAEC,KAAK,IAAK;UACtEC,OAAO,CAACC,IAAI,CAAC,sBAAsB,EAAEF,KAAK,CAAC;UAC3CT,eAAe,GAAG,IAAI;QACxB,CAAC,CAAC;QACF;MACF,KAAKD,UAAU,CAACa,MAAM;QACpBd,OAAO,CAACO,WAAW,CAACP,OAAO,CAACQ,mBAAmB,CAACO,MAAM,CAAC,CAACL,KAAK,CAAEC,KAAK,IAAK;UACvEC,OAAO,CAACC,IAAI,CAAC,uBAAuB,EAAEF,KAAK,CAAC;UAC5CT,eAAe,GAAG,IAAI;QACxB,CAAC,CAAC;QACF;MACF,KAAKD,UAAU,CAACe,KAAK;QACnBhB,OAAO,CAACO,WAAW,CAACP,OAAO,CAACQ,mBAAmB,CAACS,KAAK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EACxB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ import * as Speech from 'expo-speech';
4
+ export const playSound = (soundConfig, soundEnabled) => {
5
+ if (!soundEnabled) return;
6
+ Speech.speak(soundConfig.text, {
7
+ pitch: soundConfig.pitch || 1.0,
8
+ rate: soundConfig.rate || 1.5,
9
+ language: soundConfig.language || 'en'
10
+ });
11
+ };
12
+ export const stopAllSounds = () => {
13
+ Speech.stop();
14
+ };
15
+ export const isSpeechAvailable = async () => {
16
+ try {
17
+ return await Speech.isSpeakingAsync();
18
+ } catch {
19
+ return false;
20
+ }
21
+ };
22
+
23
+ // Predefined sound configurations for common game events
24
+ export const GAME_SOUNDS = {
25
+ // Generic game sounds
26
+ POP: {
27
+ text: 'Pop!',
28
+ pitch: 1.6,
29
+ rate: 2.2
30
+ },
31
+ SWOOSH: {
32
+ text: 'Swoosh!',
33
+ pitch: 1.5,
34
+ rate: 2.5
35
+ },
36
+ BOOM: {
37
+ text: 'Boom!',
38
+ pitch: 0.8,
39
+ rate: 1.5
40
+ },
41
+ WHOOSH: {
42
+ text: 'Whoosh',
43
+ pitch: 0.7,
44
+ rate: 1.8
45
+ },
46
+ // Game state sounds - slower and more understandable
47
+ GAME_START: {
48
+ text: 'Game started!',
49
+ pitch: 1.1,
50
+ rate: 0.9
51
+ },
52
+ GAME_OVER: {
53
+ text: 'Game over!',
54
+ pitch: 0.9,
55
+ rate: 0.8
56
+ },
57
+ TIME_UP: {
58
+ text: 'Time up! Game over!',
59
+ pitch: 0.9,
60
+ rate: 0.8
61
+ },
62
+ WELL_DONE: {
63
+ text: 'Well done!',
64
+ pitch: 1.2,
65
+ rate: 1.0
66
+ },
67
+ CONGRATULATIONS: {
68
+ text: 'Congratulations!',
69
+ pitch: 1.1,
70
+ rate: 0.9
71
+ },
72
+ // Specific game sounds
73
+ BUBBLE_POPPER: {
74
+ START: {
75
+ text: 'Bubble Popper started!',
76
+ pitch: 1.1,
77
+ rate: 0.9
78
+ },
79
+ COMPLETE: {
80
+ text: 'All bubbles popped! Well done!',
81
+ pitch: 1.2,
82
+ rate: 1.0
83
+ },
84
+ POP: {
85
+ text: 'Pop!',
86
+ pitch: 1.6,
87
+ rate: 2.2
88
+ }
89
+ },
90
+ WHACK_A_MOLE: {
91
+ HIT: {
92
+ text: 'Pop!',
93
+ pitch: 1.8,
94
+ rate: 2.0
95
+ },
96
+ MISS: {
97
+ text: 'Whoosh',
98
+ pitch: 0.7,
99
+ rate: 1.8
100
+ }
101
+ },
102
+ BALLOON_BLASTER: {
103
+ POP: {
104
+ text: 'Pop!',
105
+ pitch: 1.5,
106
+ rate: 2.5
107
+ },
108
+ BOMB: {
109
+ text: 'Boom!',
110
+ pitch: 0.8,
111
+ rate: 1.5
112
+ },
113
+ BONUS: {
114
+ text: 'bonus life!',
115
+ pitch: 1.8,
116
+ rate: 2.0
117
+ }
118
+ },
119
+ FRUIT_NINJA: {
120
+ SLICE: {
121
+ text: 'Swoosh!',
122
+ pitch: 1.5,
123
+ rate: 2.5
124
+ },
125
+ BOMB: {
126
+ text: 'Boom!',
127
+ pitch: 0.8,
128
+ rate: 1.5
129
+ },
130
+ BONUS: {
131
+ text: 'bonus life!',
132
+ pitch: 1.8,
133
+ rate: 2.0
134
+ }
135
+ },
136
+ MAZE_RUNNER: {
137
+ START: {
138
+ text: 'Maze started! Navigate to the exit!',
139
+ pitch: 1.0,
140
+ rate: 0.9
141
+ },
142
+ COMPLETE: {
143
+ text: 'Congratulations! Maze completed!',
144
+ pitch: 1.1,
145
+ rate: 0.9
146
+ },
147
+ STOP: {
148
+ text: 'Maze stopped!',
149
+ pitch: 0.9,
150
+ rate: 0.8
151
+ }
152
+ },
153
+ SPACE_FIGHTER: {
154
+ START: {
155
+ text: 'Mission started! Navigate through the asteroid field!',
156
+ pitch: 1.0,
157
+ rate: 0.9
158
+ },
159
+ SUCCESS: {
160
+ text: 'Nice!',
161
+ pitch: 1.8,
162
+ rate: 2.0
163
+ },
164
+ COLLISION: {
165
+ text: 'Ouch!',
166
+ pitch: 0.8,
167
+ rate: 1.5
168
+ }
169
+ }
170
+ };
171
+ //# sourceMappingURL=SoundsService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Speech","playSound","soundConfig","soundEnabled","speak","text","pitch","rate","language","stopAllSounds","stop","isSpeechAvailable","isSpeakingAsync","GAME_SOUNDS","POP","SWOOSH","BOOM","WHOOSH","GAME_START","GAME_OVER","TIME_UP","WELL_DONE","CONGRATULATIONS","BUBBLE_POPPER","START","COMPLETE","WHACK_A_MOLE","HIT","MISS","BALLOON_BLASTER","BOMB","BONUS","FRUIT_NINJA","SLICE","MAZE_RUNNER","STOP","SPACE_FIGHTER","SUCCESS","COLLISION"],"sourceRoot":"../../../src","sources":["services/SoundsService.ts"],"mappings":";;AAAA,OAAO,KAAKA,MAAM,MAAM,aAAa;AASrC,OAAO,MAAMC,SAAS,GAAGA,CAACC,WAAwB,EAAEC,YAAqB,KAAW;EAClF,IAAI,CAACA,YAAY,EAAE;EAEnBH,MAAM,CAACI,KAAK,CAACF,WAAW,CAACG,IAAI,EAAE;IAC7BC,KAAK,EAAEJ,WAAW,CAACI,KAAK,IAAI,GAAG;IAC/BC,IAAI,EAAEL,WAAW,CAACK,IAAI,IAAI,GAAG;IAC7BC,QAAQ,EAAEN,WAAW,CAACM,QAAQ,IAAI;EACpC,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAY;EACvCT,MAAM,CAACU,IAAI,CAAC,CAAC;AACf,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAG,MAAAA,CAAA,KAA8B;EAC7D,IAAI;IACF,OAAO,MAAMX,MAAM,CAACY,eAAe,CAAC,CAAC;EACvC,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA,OAAO,MAAMC,WAAW,GAAG;EACzB;EACAC,GAAG,EAAE;IAAET,IAAI,EAAE,MAAM;IAAEC,K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AAC;EAED6B,aAAa,EAAE;IACbZ,KAAK,EAAE;MAAEnB,IAAI,EAAE,uDAAuD;MAAEC,KAAK,EAAE,GAAG;MAAEC,IAAI,EAAE;IAAI,CAAC;IAC/F8B,OAAO,EAAE;MAAEhC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE,GAAG;MAAEC,IAAI,EAAE;IAAI,CAAC;IACjD+B,SAAS,EAAE;MAAEjC,IAAI,EAAE,OAAO;MAAEC,KAAK,EAAE,GAAG;MAAEC,IAAI,EAAE;IAAI;EACpD;AACF,CAAU","ignoreList":[]}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+
5
+ /**
6
+ * Optimized animation frame utility for smooth game object cleanup and updates
7
+ * Uses requestAnimationFrame instead of setInterval for better performance
8
+ */
9
+ export class AnimationFrameManager {
10
+ animationId = null;
11
+ isRunning = false;
12
+ lastTime = 0;
13
+ constructor(callback, interval = 100) {
14
+ this.callback = callback;
15
+ this.interval = interval;
16
+ }
17
+
18
+ /**
19
+ * Start the animation frame loop
20
+ */
21
+ start() {
22
+ if (this.isRunning) return;
23
+ this.isRunning = true;
24
+ this.lastTime = performance.now();
25
+ this.loop();
26
+ }
27
+
28
+ /**
29
+ * Stop the animation frame loop
30
+ */
31
+ stop() {
32
+ if (this.animationId) {
33
+ cancelAnimationFrame(this.animationId);
34
+ this.animationId = null;
35
+ }
36
+ this.isRunning = false;
37
+ }
38
+
39
+ /**
40
+ * Internal animation frame loop
41
+ */
42
+ loop = () => {
43
+ if (!this.isRunning) return;
44
+ const currentTime = performance.now();
45
+ const deltaTime = currentTime - this.lastTime;
46
+ if (deltaTime >= this.interval) {
47
+ this.callback();
48
+ this.lastTime = currentTime;
49
+ }
50
+ this.animationId = requestAnimationFrame(this.loop);
51
+ };
52
+
53
+ /**
54
+ * Update the callback function
55
+ */
56
+ updateCallback(callback) {
57
+ this.callback = callback;
58
+ }
59
+
60
+ /**
61
+ * Update the interval
62
+ */
63
+ updateInterval(interval) {
64
+ this.interval = interval;
65
+ }
66
+ }
67
+
68
+ /**
69
+ * React hook for using optimized animation frame cleanup
70
+ */
71
+ export function useAnimationFrame(callback, interval = 100, dependencies = []) {
72
+ const managerRef = useRef(null);
73
+ useEffect(() => {
74
+ // Create or update the manager
75
+ if (!managerRef.current) {
76
+ managerRef.current = new AnimationFrameManager(callback, interval);
77
+ } else {
78
+ managerRef.current.updateCallback(callback);
79
+ managerRef.current.updateInterval(interval);
80
+ }
81
+
82
+ // Start the animation frame loop
83
+ managerRef.current.start();
84
+
85
+ // Cleanup on unmount or dependency change
86
+ return () => {
87
+ if (managerRef.current) {
88
+ managerRef.current.stop();
89
+ }
90
+ };
91
+ }, dependencies);
92
+
93
+ // Cleanup on unmount
94
+ useEffect(() => {
95
+ return () => {
96
+ if (managerRef.current) {
97
+ managerRef.current.stop();
98
+ }
99
+ };
100
+ }, []);
101
+ }
102
+
103
+ /**
104
+ * React hook for creating a reusable animation frame manager
105
+ */
106
+ export function useAnimationFrameManager(interval = 100) {
107
+ const managerRef = useRef(null);
108
+ if (!managerRef.current) {
109
+ managerRef.current = new AnimationFrameManager(() => {}, interval);
110
+ }
111
+ useEffect(() => {
112
+ return () => {
113
+ if (managerRef.current) {
114
+ managerRef.current.stop();
115
+ }
116
+ };
117
+ }, []);
118
+ return managerRef.current;
119
+ }
120
+ //# sourceMappingURL=AnimationFrame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useRef","AnimationFrameManager","animationId","isRunning","lastTime","constructor","callback","interval","start","performance","now","loop","stop","cancelAnimationFrame","currentTime","deltaTime","requestAnimationFrame","updateCallback","updateInterval","useAnimationFrame","dependencies","managerRef","current","useAnimationFrameManager"],"sourceRoot":"../../../../src","sources":["shared/helpers/AnimationFrame.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEzC;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,CAAC;EACzBC,W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AU,CAACC,OAAO,EAAE;QACtBD,UAAU,CAACC,OAAO,CAACV,IAAI,CAAC,CAAC;MAC3B;IACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOS,UAAU,CAACC,OAAO;AAC3B","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ import { useRef } from 'react';
4
+
5
+ /**
6
+ * Animation state interface for tracking game object animations
7
+ */
8
+
9
+ /**
10
+ * Default animation state values
11
+ */
12
+ export const DEFAULT_ANIMATION_STATE = {
13
+ scale: 1,
14
+ opacity: 1,
15
+ rotation: 0,
16
+ translateX: 0,
17
+ translateY: 0
18
+ };
19
+
20
+ /**
21
+ * Animation tracker class for managing game object animations
22
+ * Extends Map to maintain compatibility with existing game services
23
+ */
24
+ export class AnimationTracker extends Map {
25
+ constructor() {
26
+ super();
27
+ }
28
+
29
+ /**
30
+ * Override set to merge with default animation state
31
+ */
32
+ set(id, state) {
33
+ const currentState = super.get(id) || {
34
+ ...DEFAULT_ANIMATION_STATE
35
+ };
36
+ const newState = {
37
+ ...currentState,
38
+ ...state
39
+ };
40
+ super.set(id, newState);
41
+ return this;
42
+ }
43
+
44
+ /**
45
+ * Initialize animation for object if it doesn't exist
46
+ */
47
+ initialize(id, initialState) {
48
+ if (!this.has(id)) {
49
+ const state = {
50
+ ...DEFAULT_ANIMATION_STATE,
51
+ ...initialState
52
+ };
53
+ super.set(id, state);
54
+ return state;
55
+ }
56
+ return this.get(id);
57
+ }
58
+
59
+ /**
60
+ * Update multiple objects at once
61
+ */
62
+ updateBatch(updates) {
63
+ updates.forEach(({
64
+ id,
65
+ state
66
+ }) => {
67
+ this.set(id, state);
68
+ });
69
+ }
70
+ }
71
+
72
+ /**
73
+ * React hook for creating and managing animation trackers
74
+ */
75
+ export function useAnimationTracker() {
76
+ return useRef(new AnimationTracker()).current;
77
+ }
78
+
79
+ /**
80
+ * React hook for creating multiple animation trackers
81
+ */
82
+ export function useAnimationTrackers(trackerNames) {
83
+ const trackers = useRef(trackerNames.reduce((acc, name) => {
84
+ acc[name] = new AnimationTracker();
85
+ return acc;
86
+ }, {})).current;
87
+ return trackers;
88
+ }
89
+ //# sourceMappingURL=AnimationTracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRef","DEFAULT_ANIMATION_STATE","scale","opacity","rotation","translateX","translateY","AnimationTracker","Map","constructor","set","id","state","currentState","get","newState","initialize","initialState","has","updateBatch","updates","forEach","useAnimationTracker","current","useAnimationTrackers","trackerNames","trackers","reduce","acc","name"],"sourceRoot":"../../../../src","sources":["shared/helpers/AnimationTracker.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,OAAO;;AAE9B;AACA;AACA;;AASA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuC,GAAG;EACrDC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,QAAQ,EAAE,CAAC;EACXC,UAAU,EAAE,CAAC;EACbC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASC,GAAG,CAAyB;EAChEC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;EACT;;EAEA;AACF;AACA;EACEC,GAAGA,CAACC,EAAU,EAAEC,KAA8B,EAAQ;IACpD,MAAMC,YAAY,GAAG,KAAK,CAACC,GAAG,CAACH,EAAE,CAAC,IAAI;MAAE,GAAGV;IAAwB,CAAC;IACpE,MAAMc,QAAQ,GAAG;MAAE,GAAGF,YAAY;MAAE,GAAGD;IAAM,CAAC;IAC9C,KAAK,CAACF,GAAG,CAACC,EAAE,EAAEI,QAAQ,CAAC;IACvB,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACEC,UAAUA,CAACL,EAAU,EAAEM,YAAsC,EAAkB;IAC7E,IAAI,CAAC,IAAI,CAACC,GAAG,CAACP,EAAE,CAAC,EAAE;MACjB,MAAMC,KAAK,GAAG;QAAE,GAAGX,uBAAuB;QAAE,GAAGgB;M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