react-native-games 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/LICENSE +66 -0
  2. package/README.md +269 -0
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js +391 -0
  4. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -0
  5. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +293 -0
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js.map +1 -0
  7. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +156 -0
  8. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js.map +1 -0
  9. package/lib/module/games/balloon-blaster/components/BalloonComponent.js +227 -0
  10. package/lib/module/games/balloon-blaster/components/BalloonComponent.js.map +1 -0
  11. package/lib/module/games/balloon-blaster/components/GameArea.js +42 -0
  12. package/lib/module/games/balloon-blaster/components/GameArea.js.map +1 -0
  13. package/lib/module/games/balloon-blaster/components/GameBackground.js +544 -0
  14. package/lib/module/games/balloon-blaster/components/GameBackground.js.map +1 -0
  15. package/lib/module/games/balloon-blaster/components/GameControls.js +229 -0
  16. package/lib/module/games/balloon-blaster/components/GameControls.js.map +1 -0
  17. package/lib/module/games/balloon-blaster/components/GameOverModal.js +133 -0
  18. package/lib/module/games/balloon-blaster/components/GameOverModal.js.map +1 -0
  19. package/lib/module/games/balloon-blaster/components/ParticleSystem.js +52 -0
  20. package/lib/module/games/balloon-blaster/components/ParticleSystem.js.map +1 -0
  21. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +119 -0
  22. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -0
  23. package/lib/module/games/balloon-blaster/components/SliceTrail.js +58 -0
  24. package/lib/module/games/balloon-blaster/components/SliceTrail.js.map +1 -0
  25. package/lib/module/games/balloon-blaster/components/index.js +11 -0
  26. package/lib/module/games/balloon-blaster/components/index.js.map +1 -0
  27. package/lib/module/games/cat-popper/CatPopper.js +230 -0
  28. package/lib/module/games/cat-popper/CatPopper.js.map +1 -0
  29. package/lib/module/games/cat-popper/CatPopperService.js +100 -0
  30. package/lib/module/games/cat-popper/CatPopperService.js.map +1 -0
  31. package/lib/module/games/cat-popper/CatPopperStore.js +113 -0
  32. package/lib/module/games/cat-popper/CatPopperStore.js.map +1 -0
  33. package/lib/module/games/cat-popper/components/CatCharacter.js +281 -0
  34. package/lib/module/games/cat-popper/components/CatCharacter.js.map +1 -0
  35. package/lib/module/games/cat-popper/components/GameBackground.js +531 -0
  36. package/lib/module/games/cat-popper/components/GameBackground.js.map +1 -0
  37. package/lib/module/games/cat-popper/components/GameControls.js +230 -0
  38. package/lib/module/games/cat-popper/components/GameControls.js.map +1 -0
  39. package/lib/module/games/cat-popper/components/GameGrid.js +66 -0
  40. package/lib/module/games/cat-popper/components/GameGrid.js.map +1 -0
  41. package/lib/module/games/cat-popper/components/GameHole.js +183 -0
  42. package/lib/module/games/cat-popper/components/GameHole.js.map +1 -0
  43. package/lib/module/games/cat-popper/components/GameOverModal.js +131 -0
  44. package/lib/module/games/cat-popper/components/GameOverModal.js.map +1 -0
  45. package/lib/module/games/cat-popper/components/ScoreBoard.js +77 -0
  46. package/lib/module/games/cat-popper/components/ScoreBoard.js.map +1 -0
  47. package/lib/module/games/cat-popper/components/index.js +10 -0
  48. package/lib/module/games/cat-popper/components/index.js.map +1 -0
  49. package/lib/module/games/fruit-slicer/FruitSlicer.js +411 -0
  50. package/lib/module/games/fruit-slicer/FruitSlicer.js.map +1 -0
  51. package/lib/module/games/fruit-slicer/FruitSlicerService.js +293 -0
  52. package/lib/module/games/fruit-slicer/FruitSlicerService.js.map +1 -0
  53. package/lib/module/games/fruit-slicer/FruitSlicerStore.js +156 -0
  54. package/lib/module/games/fruit-slicer/FruitSlicerStore.js.map +1 -0
  55. package/lib/module/games/fruit-slicer/components/FruitComponent.js +99 -0
  56. package/lib/module/games/fruit-slicer/components/FruitComponent.js.map +1 -0
  57. package/lib/module/games/fruit-slicer/components/GameArea.js +50 -0
  58. package/lib/module/games/fruit-slicer/components/GameArea.js.map +1 -0
  59. package/lib/module/games/fruit-slicer/components/GameBackground.js +1296 -0
  60. package/lib/module/games/fruit-slicer/components/GameBackground.js.map +1 -0
  61. package/lib/module/games/fruit-slicer/components/GameControls.js +230 -0
  62. package/lib/module/games/fruit-slicer/components/GameControls.js.map +1 -0
  63. package/lib/module/games/fruit-slicer/components/GameOverModal.js +189 -0
  64. package/lib/module/games/fruit-slicer/components/GameOverModal.js.map +1 -0
  65. package/lib/module/games/fruit-slicer/components/ParticleSystem.js +52 -0
  66. package/lib/module/games/fruit-slicer/components/ParticleSystem.js.map +1 -0
  67. package/lib/module/games/fruit-slicer/components/ScoreBoard.js +121 -0
  68. package/lib/module/games/fruit-slicer/components/ScoreBoard.js.map +1 -0
  69. package/lib/module/games/fruit-slicer/components/SliceTrail.js +58 -0
  70. package/lib/module/games/fruit-slicer/components/SliceTrail.js.map +1 -0
  71. package/lib/module/games/fruit-slicer/components/index.js +11 -0
  72. package/lib/module/games/fruit-slicer/components/index.js.map +1 -0
  73. package/lib/module/games/maze-runner/MazeRunner.js +242 -0
  74. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -0
  75. package/lib/module/games/maze-runner/MazeRunnerService.js +560 -0
  76. package/lib/module/games/maze-runner/MazeRunnerService.js.map +1 -0
  77. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +149 -0
  78. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js.map +1 -0
  79. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +357 -0
  80. package/lib/module/games/maze-runner/components/EnhancedGameArea.js.map +1 -0
  81. package/lib/module/games/maze-runner/components/GameBackground.js +216 -0
  82. package/lib/module/games/maze-runner/components/GameBackground.js.map +1 -0
  83. package/lib/module/games/maze-runner/components/GameControls.js +129 -0
  84. package/lib/module/games/maze-runner/components/GameControls.js.map +1 -0
  85. package/lib/module/games/maze-runner/components/GameOverModal.js +134 -0
  86. package/lib/module/games/maze-runner/components/GameOverModal.js.map +1 -0
  87. package/lib/module/games/maze-runner/components/ScoreBoard.js +81 -0
  88. package/lib/module/games/maze-runner/components/ScoreBoard.js.map +1 -0
  89. package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +209 -0
  90. package/lib/module/games/maze-runner/components/SkiaPipeComponent.js.map +1 -0
  91. package/lib/module/games/maze-runner/components/StaticGameBackground.js +169 -0
  92. package/lib/module/games/maze-runner/components/StaticGameBackground.js.map +1 -0
  93. package/lib/module/games/maze-runner/components/WallComponent.js +90 -0
  94. package/lib/module/games/maze-runner/components/WallComponent.js.map +1 -0
  95. package/lib/module/games/maze-runner/components/index.js +10 -0
  96. package/lib/module/games/maze-runner/components/index.js.map +1 -0
  97. package/lib/module/games/space-traveller/SpaceTraveller.js +393 -0
  98. package/lib/module/games/space-traveller/SpaceTraveller.js.map +1 -0
  99. package/lib/module/games/space-traveller/SpaceTravellerService.js +298 -0
  100. package/lib/module/games/space-traveller/SpaceTravellerService.js.map +1 -0
  101. package/lib/module/games/space-traveller/SpaceTravellerStore.js +139 -0
  102. package/lib/module/games/space-traveller/SpaceTravellerStore.js.map +1 -0
  103. package/lib/module/games/space-traveller/components/AsteroidComponent.js +111 -0
  104. package/lib/module/games/space-traveller/components/AsteroidComponent.js.map +1 -0
  105. package/lib/module/games/space-traveller/components/GameArea.js +75 -0
  106. package/lib/module/games/space-traveller/components/GameArea.js.map +1 -0
  107. package/lib/module/games/space-traveller/components/GameBackground.js +294 -0
  108. package/lib/module/games/space-traveller/components/GameBackground.js.map +1 -0
  109. package/lib/module/games/space-traveller/components/GameControls.js +177 -0
  110. package/lib/module/games/space-traveller/components/GameControls.js.map +1 -0
  111. package/lib/module/games/space-traveller/components/GameOverModal.js +182 -0
  112. package/lib/module/games/space-traveller/components/GameOverModal.js.map +1 -0
  113. package/lib/module/games/space-traveller/components/ParticleComponent.js +34 -0
  114. package/lib/module/games/space-traveller/components/ParticleComponent.js.map +1 -0
  115. package/lib/module/games/space-traveller/components/ScoreBoard.js +143 -0
  116. package/lib/module/games/space-traveller/components/ScoreBoard.js.map +1 -0
  117. package/lib/module/games/space-traveller/components/SettingsModal.js +222 -0
  118. package/lib/module/games/space-traveller/components/SettingsModal.js.map +1 -0
  119. package/lib/module/games/space-traveller/components/Spacecraft3D.js +362 -0
  120. package/lib/module/games/space-traveller/components/Spacecraft3D.js.map +1 -0
  121. package/lib/module/games/space-traveller/components/SpacecraftPath.js +37 -0
  122. package/lib/module/games/space-traveller/components/SpacecraftPath.js.map +1 -0
  123. package/lib/module/games/space-traveller/components/index.js +13 -0
  124. package/lib/module/games/space-traveller/components/index.js.map +1 -0
  125. package/lib/module/index.js +12 -0
  126. package/lib/module/index.js.map +1 -0
  127. package/lib/module/package.json +1 -0
  128. package/lib/module/services/GamesConstants.js +561 -0
  129. package/lib/module/services/GamesConstants.js.map +1 -0
  130. package/lib/module/services/GamesService.js +34 -0
  131. package/lib/module/services/GamesService.js.map +1 -0
  132. package/lib/module/shared/settings/GameSettings.js +295 -0
  133. package/lib/module/shared/settings/GameSettings.js.map +1 -0
  134. package/lib/module/shared/settings/SettingsService.js +119 -0
  135. package/lib/module/shared/settings/SettingsService.js.map +1 -0
  136. package/lib/typescript/package.json +1 -0
  137. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts +16 -0
  138. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -0
  139. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts +66 -0
  140. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterService.d.ts.map +1 -0
  141. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts +37 -0
  142. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterStore.d.ts.map +1 -0
  143. package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts +10 -0
  144. package/lib/typescript/src/games/balloon-blaster/components/BalloonComponent.d.ts.map +1 -0
  145. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts +17 -0
  146. package/lib/typescript/src/games/balloon-blaster/components/GameArea.d.ts.map +1 -0
  147. package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts +7 -0
  148. package/lib/typescript/src/games/balloon-blaster/components/GameBackground.d.ts.map +1 -0
  149. package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts +10 -0
  150. package/lib/typescript/src/games/balloon-blaster/components/GameControls.d.ts.map +1 -0
  151. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts +9 -0
  152. package/lib/typescript/src/games/balloon-blaster/components/GameOverModal.d.ts.map +1 -0
  153. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts +8 -0
  154. package/lib/typescript/src/games/balloon-blaster/components/ParticleSystem.d.ts.map +1 -0
  155. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts +9 -0
  156. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -0
  157. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts +11 -0
  158. package/lib/typescript/src/games/balloon-blaster/components/SliceTrail.d.ts.map +1 -0
  159. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts +9 -0
  160. package/lib/typescript/src/games/balloon-blaster/components/index.d.ts.map +1 -0
  161. package/lib/typescript/src/games/cat-popper/CatPopper.d.ts +13 -0
  162. package/lib/typescript/src/games/cat-popper/CatPopper.d.ts.map +1 -0
  163. package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts +32 -0
  164. package/lib/typescript/src/games/cat-popper/CatPopperService.d.ts.map +1 -0
  165. package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts +21 -0
  166. package/lib/typescript/src/games/cat-popper/CatPopperStore.d.ts.map +1 -0
  167. package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts +7 -0
  168. package/lib/typescript/src/games/cat-popper/components/CatCharacter.d.ts.map +1 -0
  169. package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts +7 -0
  170. package/lib/typescript/src/games/cat-popper/components/GameBackground.d.ts.map +1 -0
  171. package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts +10 -0
  172. package/lib/typescript/src/games/cat-popper/components/GameControls.d.ts.map +1 -0
  173. package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts +13 -0
  174. package/lib/typescript/src/games/cat-popper/components/GameGrid.d.ts.map +1 -0
  175. package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts +12 -0
  176. package/lib/typescript/src/games/cat-popper/components/GameHole.d.ts.map +1 -0
  177. package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts +9 -0
  178. package/lib/typescript/src/games/cat-popper/components/GameOverModal.d.ts.map +1 -0
  179. package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts +8 -0
  180. package/lib/typescript/src/games/cat-popper/components/ScoreBoard.d.ts.map +1 -0
  181. package/lib/typescript/src/games/cat-popper/components/index.d.ts +8 -0
  182. package/lib/typescript/src/games/cat-popper/components/index.d.ts.map +1 -0
  183. package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts +16 -0
  184. package/lib/typescript/src/games/fruit-slicer/FruitSlicer.d.ts.map +1 -0
  185. package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts +67 -0
  186. package/lib/typescript/src/games/fruit-slicer/FruitSlicerService.d.ts.map +1 -0
  187. package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts +37 -0
  188. package/lib/typescript/src/games/fruit-slicer/FruitSlicerStore.d.ts.map +1 -0
  189. package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts +10 -0
  190. package/lib/typescript/src/games/fruit-slicer/components/FruitComponent.d.ts.map +1 -0
  191. package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts +17 -0
  192. package/lib/typescript/src/games/fruit-slicer/components/GameArea.d.ts.map +1 -0
  193. package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts +7 -0
  194. package/lib/typescript/src/games/fruit-slicer/components/GameBackground.d.ts.map +1 -0
  195. package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts +10 -0
  196. package/lib/typescript/src/games/fruit-slicer/components/GameControls.d.ts.map +1 -0
  197. package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts +9 -0
  198. package/lib/typescript/src/games/fruit-slicer/components/GameOverModal.d.ts.map +1 -0
  199. package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts +8 -0
  200. package/lib/typescript/src/games/fruit-slicer/components/ParticleSystem.d.ts.map +1 -0
  201. package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts +9 -0
  202. package/lib/typescript/src/games/fruit-slicer/components/ScoreBoard.d.ts.map +1 -0
  203. package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts +11 -0
  204. package/lib/typescript/src/games/fruit-slicer/components/SliceTrail.d.ts.map +1 -0
  205. package/lib/typescript/src/games/fruit-slicer/components/index.d.ts +9 -0
  206. package/lib/typescript/src/games/fruit-slicer/components/index.d.ts.map +1 -0
  207. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts +18 -0
  208. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -0
  209. package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts +82 -0
  210. package/lib/typescript/src/games/maze-runner/MazeRunnerService.d.ts.map +1 -0
  211. package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts +11 -0
  212. package/lib/typescript/src/games/maze-runner/components/EnhancedBallComponent.d.ts.map +1 -0
  213. package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts +12 -0
  214. package/lib/typescript/src/games/maze-runner/components/EnhancedGameArea.d.ts.map +1 -0
  215. package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts +7 -0
  216. package/lib/typescript/src/games/maze-runner/components/GameBackground.d.ts.map +1 -0
  217. package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts +10 -0
  218. package/lib/typescript/src/games/maze-runner/components/GameControls.d.ts.map +1 -0
  219. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts +11 -0
  220. package/lib/typescript/src/games/maze-runner/components/GameOverModal.d.ts.map +1 -0
  221. package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts +8 -0
  222. package/lib/typescript/src/games/maze-runner/components/ScoreBoard.d.ts.map +1 -0
  223. package/lib/typescript/src/games/maze-runner/components/SkiaPipeComponent.d.ts +25 -0
  224. package/lib/typescript/src/games/maze-runner/components/SkiaPipeComponent.d.ts.map +1 -0
  225. package/lib/typescript/src/games/maze-runner/components/StaticGameBackground.d.ts +7 -0
  226. package/lib/typescript/src/games/maze-runner/components/StaticGameBackground.d.ts.map +1 -0
  227. package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts +10 -0
  228. package/lib/typescript/src/games/maze-runner/components/WallComponent.d.ts.map +1 -0
  229. package/lib/typescript/src/games/maze-runner/components/index.d.ts +8 -0
  230. package/lib/typescript/src/games/maze-runner/components/index.d.ts.map +1 -0
  231. package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts +17 -0
  232. package/lib/typescript/src/games/space-traveller/SpaceTraveller.d.ts.map +1 -0
  233. package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts +65 -0
  234. package/lib/typescript/src/games/space-traveller/SpaceTravellerService.d.ts.map +1 -0
  235. package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts +35 -0
  236. package/lib/typescript/src/games/space-traveller/SpaceTravellerStore.d.ts.map +1 -0
  237. package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts +9 -0
  238. package/lib/typescript/src/games/space-traveller/components/AsteroidComponent.d.ts.map +1 -0
  239. package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts +17 -0
  240. package/lib/typescript/src/games/space-traveller/components/GameArea.d.ts.map +1 -0
  241. package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts +7 -0
  242. package/lib/typescript/src/games/space-traveller/components/GameBackground.d.ts.map +1 -0
  243. package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts +10 -0
  244. package/lib/typescript/src/games/space-traveller/components/GameControls.d.ts.map +1 -0
  245. package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts +9 -0
  246. package/lib/typescript/src/games/space-traveller/components/GameOverModal.d.ts.map +1 -0
  247. package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts +8 -0
  248. package/lib/typescript/src/games/space-traveller/components/ParticleComponent.d.ts.map +1 -0
  249. package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts +8 -0
  250. package/lib/typescript/src/games/space-traveller/components/ScoreBoard.d.ts.map +1 -0
  251. package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts +9 -0
  252. package/lib/typescript/src/games/space-traveller/components/SettingsModal.d.ts.map +1 -0
  253. package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts +9 -0
  254. package/lib/typescript/src/games/space-traveller/components/Spacecraft3D.d.ts.map +1 -0
  255. package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts +10 -0
  256. package/lib/typescript/src/games/space-traveller/components/SpacecraftPath.d.ts.map +1 -0
  257. package/lib/typescript/src/games/space-traveller/components/index.d.ts +11 -0
  258. package/lib/typescript/src/games/space-traveller/components/index.d.ts.map +1 -0
  259. package/lib/typescript/src/index.d.ts +7 -0
  260. package/lib/typescript/src/index.d.ts.map +1 -0
  261. package/lib/typescript/src/services/GamesConstants.d.ts +372 -0
  262. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -0
  263. package/lib/typescript/src/services/GamesService.d.ts +8 -0
  264. package/lib/typescript/src/services/GamesService.d.ts.map +1 -0
  265. package/lib/typescript/src/shared/settings/GameSettings.d.ts +36 -0
  266. package/lib/typescript/src/shared/settings/GameSettings.d.ts.map +1 -0
  267. package/lib/typescript/src/shared/settings/SettingsService.d.ts +32 -0
  268. package/lib/typescript/src/shared/settings/SettingsService.d.ts.map +1 -0
  269. package/package.json +125 -0
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Text, StyleSheet } from 'react-native';
5
+ import { GAME_CONFIG } from "../FruitSlicerService.js";
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export const ScoreBoard = ({
8
+ score,
9
+ timeLeft,
10
+ lives
11
+ }) => {
12
+ return /*#__PURE__*/_jsxs(View, {
13
+ style: styles.scoreBoard,
14
+ children: [/*#__PURE__*/_jsxs(View, {
15
+ style: styles.scoreSection,
16
+ children: [/*#__PURE__*/_jsx(Text, {
17
+ style: styles.scoreLabel,
18
+ children: "Score"
19
+ }), /*#__PURE__*/_jsx(Text, {
20
+ style: styles.scoreValue,
21
+ children: score
22
+ })]
23
+ }), /*#__PURE__*/_jsxs(View, {
24
+ style: styles.scoreSection,
25
+ children: [/*#__PURE__*/_jsx(Text, {
26
+ style: styles.scoreLabel,
27
+ children: "Time"
28
+ }), /*#__PURE__*/_jsx(Text, {
29
+ style: styles.timeValue,
30
+ children: timeLeft
31
+ })]
32
+ }), /*#__PURE__*/_jsxs(View, {
33
+ style: styles.scoreSection,
34
+ children: [/*#__PURE__*/_jsx(Text, {
35
+ style: styles.scoreLabel,
36
+ children: "Lives"
37
+ }), /*#__PURE__*/_jsx(View, {
38
+ style: styles.livesRow,
39
+ children: Array.from({
40
+ length: GAME_CONFIG.MAX_LIVES
41
+ }).map((_, index) => /*#__PURE__*/_jsx(Text, {
42
+ style: [styles.heartIcon, index < lives ? styles.heartActive : styles.heartInactive],
43
+ children: "\u2665"
44
+ }, index))
45
+ })]
46
+ })]
47
+ });
48
+ };
49
+ const styles = StyleSheet.create({
50
+ scoreBoard: {
51
+ flexDirection: 'row',
52
+ justifyContent: 'space-between',
53
+ alignItems: 'center',
54
+ backgroundColor: 'rgba(34, 139, 34, 0.3)',
55
+ // More opaque forest green to stand out on garden background
56
+ borderRadius: 16,
57
+ padding: 20,
58
+ margin: 20,
59
+ borderWidth: 2,
60
+ borderColor: 'rgba(255, 255, 255, 0.4)',
61
+ // Slightly more visible white border
62
+ shadowColor: '#000',
63
+ shadowOffset: {
64
+ width: 0,
65
+ height: 4
66
+ },
67
+ shadowOpacity: 0.25,
68
+ shadowRadius: 6,
69
+ elevation: 8 // Higher elevation for better visibility on garden background
70
+ },
71
+ scoreSection: {
72
+ alignItems: 'center',
73
+ flex: 1
74
+ },
75
+ scoreLabel: {
76
+ fontSize: 18,
77
+ fontWeight: 'bold',
78
+ color: '#ffffff',
79
+ marginBottom: 4
80
+ },
81
+ scoreValue: {
82
+ fontSize: 30,
83
+ fontWeight: 'bold',
84
+ color: '#92400e' // Brown color (matching WhackIt)
85
+ },
86
+ timeValue: {
87
+ fontSize: 30,
88
+ fontWeight: 'bold',
89
+ color: '#92400e' // Brown color (matching WhackIt)
90
+ },
91
+ livesRow: {
92
+ flexDirection: 'row',
93
+ justifyContent: 'center'
94
+ },
95
+ heartIcon: {
96
+ fontSize: 24,
97
+ marginHorizontal: 3,
98
+ fontWeight: 'bold'
99
+ },
100
+ heartActive: {
101
+ color: '#ef4444',
102
+ // Bright red hearts for available lives
103
+ textShadowColor: 'rgba(0, 0, 0, 0.5)',
104
+ textShadowOffset: {
105
+ width: 1,
106
+ height: 1
107
+ },
108
+ textShadowRadius: 2
109
+ },
110
+ heartInactive: {
111
+ color: '#1f2937',
112
+ // Dark black hearts for lost lives
113
+ textShadowColor: 'rgba(255, 255, 255, 0.3)',
114
+ textShadowOffset: {
115
+ width: 1,
116
+ height: 1
117
+ },
118
+ textShadowRadius: 1
119
+ }
120
+ });
121
+ //# sourceMappingURL=ScoreBoard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Text","StyleSheet","GAME_CONFIG","jsx","_jsx","jsxs","_jsxs","ScoreBoard","score","timeLeft","lives","style","styles","scoreBoard","children","scoreSection","scoreLabel","scoreValue","timeValue","livesRow","Array","from","length","MAX_LIVES","map","_","index","heartIcon","heartActive","heartInactive","create","flexDirection","justifyContent","alignItems","backgroundColor","borderRadius","padding","margin","borderWidth","borderColor","shadowColor","shadowOffset","width","height","shadowOpacity","shadowRadius","elevation","flex","fontSize","fontWeight","color","marginBottom","marginHorizontal","textShadowColor","textShadowOffset","textShadowRadius"],"sourceRoot":"../../../../../src","sources":["games/fruit-slicer/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,WAAW,QAAQ,0BAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQpD,OAAO,MAAMC,UAAqC,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EACnF,oBACEJ,KAAA,CAACP,IAAI;IAACY,KAAK,EAAEC,MAAM,CAACC,UAAW;IAAAC,QAAA,gBAC7BR,KAAA,CAACP,IAAI;MAACY,KAAK,EAAEC,MAAM,CAACG,YAAa;MAAAD,QAAA,gBAC/BV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACI,UAAW;QAAAF,QAAA,EAAC;MAAK,CAAM,CAAC,eAC5CV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACK,UAAW;QAAAH,QAAA,EAAEN;MAAK,CAAO,CAAC;IAAA,CAC1C,CAAC,eAEPF,KAAA,CAACP,IAAI;MAACY,KAAK,EAAEC,MAAM,CAACG,YAAa;MAAAD,QAAA,gBAC/BV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACI,UAAW;QAAAF,QAAA,EAAC;MAAI,CAAM,CAAC,eAC3CV,IAAA,CAACJ,IAAI;QAACW,KAAK,EAAEC,MAAM,CAACM,SAAU;QAAAJ,QAAA,EAAEL;MAAQ,CAAO,CAAC;IAAA,CAC5C,CAAC,eAEPH,KAAA,CAACP,IA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AE;IACVgC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS;IAChBC,YAAY,EAAE;EAChB,CAAC;EACDlC,UAAU,EAAE;IACV+B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACDhC,SAAS,EAAE;IACT8B,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,SAAS,CAAC;EACnB,CAAC;EACD/B,QAAQ,EAAE;IACRY,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDL,SAAS,EAAE;IACTqB,QAAQ,EAAE,EAAE;IACZI,gBAAgB,EAAE,CAAC;IACnBH,UAAU,EAAE;EACd,CAAC;EACDrB,WAAW,EAAE;IACXsB,KAAK,EAAE,SAAS;IAAE;IAClBG,eAAe,EAAE,oBAAoB;IACrCC,gBAAgB,EAAE;MAAEZ,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCY,gBAAgB,EAAE;EACpB,CAAC;EACD1B,aAAa,EAAE;IACbqB,KAAK,EAAE,SAAS;IAAE;IAClBG,eAAe,EAAE,0BAA0B;IAC3CC,gBAAgB,EAAE;MAAEZ,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACzCY,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, Dimensions, StyleSheet } from 'react-native';
5
+ import { Canvas as SkiaCanvas, Path, Skia } from '@shopify/react-native-skia';
6
+ import { COLORS } from "../FruitSlicerService.js";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ const {
9
+ width,
10
+ height
11
+ } = Dimensions.get('window');
12
+ export const SliceTrail = ({
13
+ path,
14
+ isVisible
15
+ }) => {
16
+ if (!isVisible || path.length < 2) return null;
17
+ const skiaPath = Skia.Path.Make();
18
+ if (path.length > 0) {
19
+ const firstPoint = path[0];
20
+ if (!firstPoint) return null;
21
+ skiaPath.moveTo(firstPoint.x, firstPoint.y);
22
+ for (let i = 1; i < path.length; i++) {
23
+ const point = path[i];
24
+ if (point) skiaPath.lineTo(point.x, point.y);
25
+ }
26
+ }
27
+ return /*#__PURE__*/_jsx(View, {
28
+ style: [styles.absoluteContainer, {
29
+ width,
30
+ height
31
+ }],
32
+ children: /*#__PURE__*/_jsx(SkiaCanvas, {
33
+ style: {
34
+ width,
35
+ height
36
+ },
37
+ children: /*#__PURE__*/_jsx(Path, {
38
+ path: skiaPath,
39
+ color: COLORS.SLICE_TRAIL,
40
+ style: "stroke",
41
+ strokeWidth: 8,
42
+ strokeCap: "round",
43
+ strokeJoin: "round"
44
+ })
45
+ })
46
+ });
47
+ };
48
+ const styles = StyleSheet.create({
49
+ absoluteContainer: {
50
+ position: 'absolute',
51
+ top: 0,
52
+ left: 0,
53
+ right: 0,
54
+ bottom: 0,
55
+ pointerEvents: 'none'
56
+ }
57
+ });
58
+ //# sourceMappingURL=SliceTrail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","Dimensions","StyleSheet","Canvas","SkiaCanvas","Path","Skia","COLORS","jsx","_jsx","width","height","get","SliceTrail","path","isVisible","length","skiaPath","Make","firstPoint","moveTo","x","y","i","point","lineTo","style","styles","absoluteContainer","children","color","SLICE_TRAIL","strokeWidth","strokeCap","strokeJoin","create","position","top","left","right","bottom","pointerEvents"],"sourceRoot":"../../../../../src","sources":["games/fruit-slicer/components/SliceTrail.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC3D,SAASC,MAAM,IAAIC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,4BAA4B;AAC7E,SAASC,MAAM,QAAQ,0BAAuB;AAAC,SAAAC,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QAACC,UAAU,EAAC;MAAO,CAAE;IAAC,CAC7G;EAAC,CACT,CAAC;AAEX,CAAC;AAED,MAAMP,MAAM,GAAGzB,UAAU,CAACiC,MAAM,CAAC;EAC/BP,iBAAiB,EAAE;IACjBQ,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ export { ScoreBoard } from "./ScoreBoard.js";
4
+ export { FruitComponent } from "./FruitComponent.js";
5
+ export { SliceTrail } from "./SliceTrail.js";
6
+ export { ParticleSystem } from "./ParticleSystem.js";
7
+ export { GameArea } from "./GameArea.js";
8
+ export { GameControls } from "./GameControls.js";
9
+ export { GameOverModal } from "./GameOverModal.js";
10
+ export { GameBackground } from "./GameBackground.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ScoreBoard","FruitComponent","SliceTrail","ParticleSystem","GameArea","GameControls","GameOverModal","GameBackground"],"sourceRoot":"../../../../../src","sources":["games/fruit-slicer/components/index.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,iBAAc;AACzC,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,UAAU,QAAQ,iBAAc;AACzC,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,QAAQ,QAAQ,eAAY;AACrC,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,aAAa,QAAQ,oBAAiB;AAC/C,SAASC,cAAc,QAAQ,qBAAkB","ignoreList":[]}
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+
3
+ import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react';
4
+ import { View, StyleSheet, Modal } from 'react-native';
5
+ import { GestureHandlerRootView } from 'react-native-gesture-handler';
6
+ import * as Speech from 'expo-speech';
7
+ import * as Haptics from 'expo-haptics';
8
+ import { MazeRunnerService } from "./MazeRunnerService.js";
9
+ // Define game-specific types and constants locally
10
+
11
+ const DEFAULT_MAZE_RUNNER_SETTINGS = {
12
+ difficulty: 'medium',
13
+ gameDuration: 120,
14
+ soundEnabled: true,
15
+ hapticEnabled: true,
16
+ gridSize: 10,
17
+ showHints: false
18
+ };
19
+ const DIFFICULTY_CONFIG = {
20
+ easy: {
21
+ gridSize: 8,
22
+ timeBonus: 1.5,
23
+ scoreMultiplier: 1.0,
24
+ hintAvailable: true,
25
+ gameDuration: 60
26
+ },
27
+ medium: {
28
+ gridSize: 10,
29
+ timeBonus: 1.2,
30
+ scoreMultiplier: 1.2,
31
+ hintAvailable: false,
32
+ gameDuration: 120
33
+ },
34
+ hard: {
35
+ gridSize: 12,
36
+ timeBonus: 1.0,
37
+ scoreMultiplier: 1.5,
38
+ hintAvailable: false,
39
+ gameDuration: 180
40
+ }
41
+ };
42
+ import { GameBackground, ScoreBoard, GameControls, EnhancedGameArea, GameOverModal } from "./components/index.js";
43
+ import { GameSettings } from "../../shared/settings/GameSettings.js";
44
+ import { createGameSettingsStore } from "../../shared/settings/SettingsService.js";
45
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
46
+ export const MazeRunner = ({
47
+ settings: externalSettings,
48
+ onSettingsChange,
49
+ showSettingsModal = false,
50
+ onToggleSettingsModal
51
+ }) => {
52
+ // Create unified game settings store
53
+ const settingsStore = useMemo(() => {
54
+ const defaultSettings = {
55
+ ...DEFAULT_MAZE_RUNNER_SETTINGS,
56
+ ...externalSettings
57
+ };
58
+
59
+ // Wrapper function to handle the callback type mismatch
60
+ const handleSettingsChange = onSettingsChange ? newSettings => {
61
+ const mazeRunnerSettings = {
62
+ ...DEFAULT_MAZE_RUNNER_SETTINGS,
63
+ ...externalSettings,
64
+ difficulty: newSettings.difficulty,
65
+ soundEnabled: newSettings.soundEnabled,
66
+ hapticEnabled: newSettings.hapticEnabled,
67
+ gameDuration: newSettings.gameDuration
68
+ };
69
+ onSettingsChange(mazeRunnerSettings);
70
+ } : undefined;
71
+ return createGameSettingsStore(defaultSettings, handleSettingsChange);
72
+ }, [externalSettings, onSettingsChange]);
73
+
74
+ // Game service
75
+ const [gameService] = useState(() => {
76
+ const currentSettings = {
77
+ ...DEFAULT_MAZE_RUNNER_SETTINGS,
78
+ ...externalSettings
79
+ };
80
+ return new MazeRunnerService(currentSettings.gridSize, 350,
81
+ // gameAreaWidth
82
+ 500 // gameAreaHeight
83
+ );
84
+ });
85
+
86
+ // Game state
87
+ const [gameState, setGameState] = useState(gameService.getGameState());
88
+ const [showGameOverModal, setShowGameOverModal] = useState(false);
89
+ const [walls, setWalls] = useState(() => gameService.getWalls());
90
+ const completionHandledRef = useRef(false);
91
+
92
+ // Settings
93
+ const settings = settingsStore();
94
+
95
+ // Memoize game config (this doesn't change)
96
+ const gameConfig = useMemo(() => gameService.getGameConfig(), [gameService]);
97
+
98
+ // Generate new maze on component mount
99
+ useEffect(() => {
100
+ gameService.resetGame(); // Generate fresh maze on launch
101
+ }, [gameService]);
102
+
103
+ // Update game service when settings change
104
+ useEffect(() => {
105
+ const gridSize = DIFFICULTY_CONFIG[settings.difficulty].gridSize;
106
+ const gameDuration = settings.gameDuration;
107
+ gameService.updateSettings(gridSize, gameDuration);
108
+ }, [settings.difficulty, settings.gameDuration, gameService]);
109
+
110
+ // Set up game state change callback
111
+ useEffect(() => {
112
+ const handleStateChange = newState => {
113
+ setGameState(prevState => {
114
+ // Handle game completion (only once per level)
115
+ if (newState.isCompleted && !completionHandledRef.current) {
116
+ completionHandledRef.current = true;
117
+ handleGameCompleted();
118
+ // Show game over modal immediately when maze is completed
119
+ setTimeout(() => {
120
+ setShowGameOverModal(true);
121
+ }, 500); // Short delay to let completion animation/feedback finish
122
+ }
123
+
124
+ // Handle game over (if you want to show modal after certain time)
125
+ if (!newState.isPlaying && prevState.isPlaying && !newState.isCompleted) {
126
+ setTimeout(() => {
127
+ setShowGameOverModal(true);
128
+ }, 1000);
129
+ }
130
+ return newState;
131
+ });
132
+
133
+ // Update walls whenever game state changes (maze might have been regenerated)
134
+ setWalls(gameService.getWalls());
135
+ };
136
+ gameService.setGameStateChangeCallback(handleStateChange);
137
+ return () => {
138
+ gameService.cleanup();
139
+ };
140
+ }, []); // Empty dependency array to prevent re-runs
141
+
142
+ const handleGameCompleted = useCallback(() => {
143
+ if (settings.soundEnabled) {
144
+ Speech.speak('Congratulations! Maze completed!', {
145
+ language: 'en',
146
+ pitch: 1.2,
147
+ rate: 0.8
148
+ });
149
+ }
150
+ if (settings.hapticEnabled) {
151
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
152
+ }
153
+ }, [settings.soundEnabled, settings.hapticEnabled]);
154
+ const handleStartGame = useCallback(() => {
155
+ completionHandledRef.current = false; // Reset completion flag
156
+ gameService.startGame();
157
+ setShowGameOverModal(false);
158
+ if (settings.soundEnabled) {
159
+ Speech.speak('Maze started! Navigate to the exit!', {
160
+ language: 'en',
161
+ pitch: 1.0,
162
+ rate: 0.9
163
+ });
164
+ }
165
+ if (settings.hapticEnabled) {
166
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium);
167
+ }
168
+ }, [gameService, settings.soundEnabled, settings.hapticEnabled]);
169
+ const handleStopGame = useCallback(() => {
170
+ gameService.stopGame();
171
+ if (settings.soundEnabled) {
172
+ Speech.speak('Game stopped', {
173
+ language: 'en',
174
+ pitch: 1.0,
175
+ rate: 1.0
176
+ });
177
+ }
178
+ }, [gameService, settings.soundEnabled]);
179
+ const handleBallPositionChange = useCallback(position => {
180
+ return gameService.updateBallPosition(position);
181
+ }, [gameService]);
182
+ const handlePlayAgain = useCallback(() => {
183
+ completionHandledRef.current = false; // Reset completion flag
184
+ setShowGameOverModal(false);
185
+ gameService.resetGame(); // Reset without auto-starting
186
+ }, [gameService]);
187
+ const handleCloseGameOverModal = useCallback(() => {
188
+ setShowGameOverModal(false);
189
+ }, []);
190
+ return /*#__PURE__*/_jsx(GestureHandlerRootView, {
191
+ style: styles.container,
192
+ children: /*#__PURE__*/_jsxs(View, {
193
+ style: styles.container,
194
+ children: [/*#__PURE__*/_jsxs(GameBackground, {
195
+ children: [/*#__PURE__*/_jsx(ScoreBoard, {
196
+ gameState: gameState
197
+ }), /*#__PURE__*/_jsx(View, {
198
+ style: styles.gameAreaContainer,
199
+ children: /*#__PURE__*/_jsx(EnhancedGameArea, {
200
+ gameState: gameState,
201
+ gameConfig: gameConfig,
202
+ walls: walls,
203
+ onBallPositionChange: handleBallPositionChange,
204
+ hapticEnabled: settings.hapticEnabled
205
+ })
206
+ }), /*#__PURE__*/_jsx(GameControls, {
207
+ gameState: gameState,
208
+ onStartGame: handleStartGame,
209
+ onStopGame: handleStopGame
210
+ })]
211
+ }), /*#__PURE__*/_jsx(GameOverModal, {
212
+ visible: showGameOverModal,
213
+ gameState: gameState,
214
+ onPlayAgain: handlePlayAgain,
215
+ onClose: handleCloseGameOverModal
216
+ }), /*#__PURE__*/_jsx(Modal, {
217
+ visible: showSettingsModal,
218
+ animationType: "slide",
219
+ presentationStyle: "pageSheet",
220
+ onRequestClose: onToggleSettingsModal,
221
+ children: /*#__PURE__*/_jsx(GameSettings, {
222
+ gameId: "maze-runner",
223
+ onClose: onToggleSettingsModal || (() => {}),
224
+ settingsStore: settingsStore()
225
+ })
226
+ })]
227
+ })
228
+ });
229
+ };
230
+ const styles = StyleSheet.create({
231
+ container: {
232
+ flex: 1
233
+ },
234
+ gameAreaContainer: {
235
+ flex: 1,
236
+ justifyContent: 'center',
237
+ alignItems: 'center',
238
+ paddingHorizontal: 10,
239
+ paddingVertical: 5
240
+ }
241
+ });
242
+ //# sourceMappingURL=MazeRunner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","useEffect","useCallback","useRef","useMemo","View","StyleSheet","Modal","GestureHandlerRootView","Speech","Haptics","MazeRunnerService","DEFAULT_MAZE_RUNNER_SETTINGS","difficulty","gameDuration","soundEnabled","hapticEnabled","gridSize","showHints","DIFFICULTY_CONFIG","easy","timeBonus","scoreMultiplier","hintAvailable","medium","hard","GameBackground","ScoreBoard","GameControls","EnhancedGameArea","GameOverModal","GameSettings","createGameSettingsStore","jsx","_jsx","jsxs","_jsxs","MazeRunner","settings","externalSettings","onSettingsChange","showSettingsModal","onToggleSettingsModal","settingsStore","defaultSettings","handleSettingsChange","newSettings","mazeRunnerSettings","undefined","gameService","currentSettings","gameState","setGameState","getGameState","showGameOverModal","setShowGameOverModal","walls","setWalls","getWalls","completionHandledRef","gameConfig","getGameConfig","resetGame","updateSettings","handleStateChange","newState","prevState","isCompleted","current","handleGameCompleted","setTimeout","isPlaying","setGameStateChangeCallback","cleanup","speak","language","pitch","rate","notificationAsync","NotificationFeedbackType","Success","handleStartGame","startGame","impactAsync","ImpactFeedbackStyle","Medium","handleStopGame","stopGame","handleBallPositionChange","position","updateBallPosition","handlePlayAgain","handleCloseGameOverModal","style","styles","container","children","gameAreaContainer","onBallPositionChange","onStartGame","onStopGame","visible","onPlayAgain","onClose","animationType","presentationStyle","onRequestClose","gameId","create","flex","justifyContent","alignItems","paddingHorizontal","paddingVertical"],"sourceRoot":"../../../../src","sources":["games/maze-runner/MazeRunner.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAChF,SAASC,IAAI,EAAEC,UAAU,EAAEC,KAAK,QAAQ,cAAc;AACtD,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,OAAO,KAAKC,MAAM,MAAM,aAAa;AACrC,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,iBAAiB,QAAuC,wBAAqB;AACtF;;AAUA,MAAMC,4BAAgD,GAAG;EACvDC,UAAU,EAAE,QAAQ;EACpBC,YAAY,EAAE,GAAG;EACjBC,YAAY,EAAE,IAAI;EAClBC,aAAa,EAAE,IAAI;EACnBC,QAAQ,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