react-native-games 0.6.0 → 0.8.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 (344) hide show
  1. package/README.md +148 -23
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +5 -8
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/candy-crush/CandyCrush.js +121 -0
  5. package/lib/module/games/candy-crush/CandyCrush.js.map +1 -0
  6. package/lib/module/games/candy-crush/CandyCrushConstants.js +125 -0
  7. package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -0
  8. package/lib/module/games/candy-crush/CandyCrushService.js +370 -0
  9. package/lib/module/games/candy-crush/CandyCrushService.js.map +1 -0
  10. package/lib/module/games/candy-crush/CandyCrushStore.js +305 -0
  11. package/lib/module/games/candy-crush/CandyCrushStore.js.map +1 -0
  12. package/lib/module/games/candy-crush/components/CandyItem.js +191 -0
  13. package/lib/module/games/candy-crush/components/CandyItem.js.map +1 -0
  14. package/lib/module/games/candy-crush/components/GameBackground.js +85 -0
  15. package/lib/module/games/candy-crush/components/GameBackground.js.map +1 -0
  16. package/lib/module/games/candy-crush/components/GameGrid.js +314 -0
  17. package/lib/module/games/candy-crush/components/GameGrid.js.map +1 -0
  18. package/lib/module/games/candy-crush/components/ScoreBoard.js +112 -0
  19. package/lib/module/games/candy-crush/components/ScoreBoard.js.map +1 -0
  20. package/lib/module/games/candy-crush/components/index.js +7 -0
  21. package/lib/module/games/candy-crush/components/index.js.map +1 -0
  22. package/lib/module/games/candy-crush/index.js +6 -0
  23. package/lib/module/games/candy-crush/index.js.map +1 -0
  24. package/lib/module/games/color-sort/ColorSort.js +130 -0
  25. package/lib/module/games/color-sort/ColorSort.js.map +1 -0
  26. package/lib/module/games/color-sort/ColorSortConstants.js +68 -0
  27. package/lib/module/games/color-sort/ColorSortConstants.js.map +1 -0
  28. package/lib/module/games/color-sort/ColorSortService.js +255 -0
  29. package/lib/module/games/color-sort/ColorSortService.js.map +1 -0
  30. package/lib/module/games/color-sort/ColorSortStore.js +258 -0
  31. package/lib/module/games/color-sort/ColorSortStore.js.map +1 -0
  32. package/lib/module/games/color-sort/components/ColorContainer.js +140 -0
  33. package/lib/module/games/color-sort/components/ColorContainer.js.map +1 -0
  34. package/lib/module/games/color-sort/components/GameBackground.js +135 -0
  35. package/lib/module/games/color-sort/components/GameBackground.js.map +1 -0
  36. package/lib/module/games/color-sort/components/ScoreBoard.js +78 -0
  37. package/lib/module/games/color-sort/components/ScoreBoard.js.map +1 -0
  38. package/lib/module/games/color-sort/components/index.js +6 -0
  39. package/lib/module/games/color-sort/components/index.js.map +1 -0
  40. package/lib/module/games/dino-jump/DinoJump.js +209 -0
  41. package/lib/module/games/dino-jump/DinoJump.js.map +1 -0
  42. package/lib/module/games/dino-jump/DinoJumpConstants.js +179 -0
  43. package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -0
  44. package/lib/module/games/dino-jump/DinoJumpService.js +268 -0
  45. package/lib/module/games/dino-jump/DinoJumpService.js.map +1 -0
  46. package/lib/module/games/dino-jump/DinoJumpStore.js +387 -0
  47. package/lib/module/games/dino-jump/DinoJumpStore.js.map +1 -0
  48. package/lib/module/games/dino-jump/components/DinoSprite.js +409 -0
  49. package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -0
  50. package/lib/module/games/dino-jump/components/GameArea.js +68 -0
  51. package/lib/module/games/dino-jump/components/GameArea.js.map +1 -0
  52. package/lib/module/games/dino-jump/components/GameBackground.js +421 -0
  53. package/lib/module/games/dino-jump/components/GameBackground.js.map +1 -0
  54. package/lib/module/games/dino-jump/components/ObstacleSprite.js +306 -0
  55. package/lib/module/games/dino-jump/components/ObstacleSprite.js.map +1 -0
  56. package/lib/module/games/dino-jump/components/ScoreBoard.js +107 -0
  57. package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -0
  58. package/lib/module/games/dino-jump/components/StarSprite.js +45 -0
  59. package/lib/module/games/dino-jump/components/StarSprite.js.map +1 -0
  60. package/lib/module/games/dino-jump/components/index.js +9 -0
  61. package/lib/module/games/dino-jump/components/index.js.map +1 -0
  62. package/lib/module/games/flappy-bird/FlappyBird.js +131 -0
  63. package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -0
  64. package/lib/module/games/flappy-bird/FlappyBirdConstants.js +90 -0
  65. package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -0
  66. package/lib/module/games/flappy-bird/FlappyBirdStore.js +276 -0
  67. package/lib/module/games/flappy-bird/FlappyBirdStore.js.map +1 -0
  68. package/lib/module/games/flappy-bird/components/Bird.js +87 -0
  69. package/lib/module/games/flappy-bird/components/Bird.js.map +1 -0
  70. package/lib/module/games/flappy-bird/components/GameArea.js +86 -0
  71. package/lib/module/games/flappy-bird/components/GameArea.js.map +1 -0
  72. package/lib/module/games/flappy-bird/components/GameBackground.js +112 -0
  73. package/lib/module/games/flappy-bird/components/GameBackground.js.map +1 -0
  74. package/lib/module/games/flappy-bird/components/Pipes.js +175 -0
  75. package/lib/module/games/flappy-bird/components/Pipes.js.map +1 -0
  76. package/lib/module/games/flappy-bird/components/ScoreBoard.js +72 -0
  77. package/lib/module/games/flappy-bird/components/ScoreBoard.js.map +1 -0
  78. package/lib/module/games/flappy-bird/components/index.js +8 -0
  79. package/lib/module/games/flappy-bird/components/index.js.map +1 -0
  80. package/lib/module/games/fruit-merger/FruitMerger.js +112 -0
  81. package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -0
  82. package/lib/module/games/fruit-merger/FruitMergerConstants.js +119 -0
  83. package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -0
  84. package/lib/module/games/fruit-merger/FruitMergerService.js +13 -0
  85. package/lib/module/games/fruit-merger/FruitMergerService.js.map +1 -0
  86. package/lib/module/games/fruit-merger/FruitMergerStore.js +318 -0
  87. package/lib/module/games/fruit-merger/FruitMergerStore.js.map +1 -0
  88. package/lib/module/games/fruit-merger/components/FruitItem.js +102 -0
  89. package/lib/module/games/fruit-merger/components/FruitItem.js.map +1 -0
  90. package/lib/module/games/fruit-merger/components/GameArea.js +123 -0
  91. package/lib/module/games/fruit-merger/components/GameArea.js.map +1 -0
  92. package/lib/module/games/fruit-merger/components/GameBackground.js +477 -0
  93. package/lib/module/games/fruit-merger/components/GameBackground.js.map +1 -0
  94. package/lib/module/games/fruit-merger/components/ScoreBoard.js +66 -0
  95. package/lib/module/games/fruit-merger/components/ScoreBoard.js.map +1 -0
  96. package/lib/module/games/fruit-merger/components/index.js +7 -0
  97. package/lib/module/games/fruit-merger/components/index.js.map +1 -0
  98. package/lib/module/games/fruit-ninja/FruitNinja.js +6 -9
  99. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  100. package/lib/module/games/game-2048/Game2048.js +120 -0
  101. package/lib/module/games/game-2048/Game2048.js.map +1 -0
  102. package/lib/module/games/game-2048/Game2048Constants.js +263 -0
  103. package/lib/module/games/game-2048/Game2048Constants.js.map +1 -0
  104. package/lib/module/games/game-2048/Game2048Service.js +457 -0
  105. package/lib/module/games/game-2048/Game2048Service.js.map +1 -0
  106. package/lib/module/games/game-2048/Game2048Store.js +238 -0
  107. package/lib/module/games/game-2048/Game2048Store.js.map +1 -0
  108. package/lib/module/games/game-2048/components/GameBackground.js +247 -0
  109. package/lib/module/games/game-2048/components/GameBackground.js.map +1 -0
  110. package/lib/module/games/game-2048/components/GameGrid.js +139 -0
  111. package/lib/module/games/game-2048/components/GameGrid.js.map +1 -0
  112. package/lib/module/games/game-2048/components/GameTile.js +72 -0
  113. package/lib/module/games/game-2048/components/GameTile.js.map +1 -0
  114. package/lib/module/games/game-2048/components/ScoreBoard.js +70 -0
  115. package/lib/module/games/game-2048/components/ScoreBoard.js.map +1 -0
  116. package/lib/module/games/game-2048/components/index.js +7 -0
  117. package/lib/module/games/game-2048/components/index.js.map +1 -0
  118. package/lib/module/games/maze-runner/MazeRunner.js +33 -31
  119. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  120. package/lib/module/games/popit-fidget/PopitFidget.js +34 -32
  121. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  122. package/lib/module/games/sliding-numbers/SlidingNumbers.js +161 -0
  123. package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -0
  124. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +207 -0
  125. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -0
  126. package/lib/module/games/sliding-numbers/SlidingNumbersService.js +248 -0
  127. package/lib/module/games/sliding-numbers/SlidingNumbersService.js.map +1 -0
  128. package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +275 -0
  129. package/lib/module/games/sliding-numbers/SlidingNumbersStore.js.map +1 -0
  130. package/lib/module/games/sliding-numbers/components/GameBackground.js +259 -0
  131. package/lib/module/games/sliding-numbers/components/GameBackground.js.map +1 -0
  132. package/lib/module/games/sliding-numbers/components/NumbersGrid.js +174 -0
  133. package/lib/module/games/sliding-numbers/components/NumbersGrid.js.map +1 -0
  134. package/lib/module/games/sliding-numbers/components/NumbersTile.js +116 -0
  135. package/lib/module/games/sliding-numbers/components/NumbersTile.js.map +1 -0
  136. package/lib/module/games/sliding-numbers/components/ScoreBoard.js +66 -0
  137. package/lib/module/games/sliding-numbers/components/ScoreBoard.js.map +1 -0
  138. package/lib/module/games/sliding-numbers/components/index.js +7 -0
  139. package/lib/module/games/sliding-numbers/components/index.js.map +1 -0
  140. package/lib/module/games/snake/Snake.js +192 -0
  141. package/lib/module/games/snake/Snake.js.map +1 -0
  142. package/lib/module/games/snake/SnakeConstants.js +138 -0
  143. package/lib/module/games/snake/SnakeConstants.js.map +1 -0
  144. package/lib/module/games/snake/SnakeService.js +148 -0
  145. package/lib/module/games/snake/SnakeService.js.map +1 -0
  146. package/lib/module/games/snake/SnakeStore.js +184 -0
  147. package/lib/module/games/snake/SnakeStore.js.map +1 -0
  148. package/lib/module/games/snake/components/GameBackground.js +221 -0
  149. package/lib/module/games/snake/components/GameBackground.js.map +1 -0
  150. package/lib/module/games/snake/components/GameGrid.js +153 -0
  151. package/lib/module/games/snake/components/GameGrid.js.map +1 -0
  152. package/lib/module/games/snake/components/ScoreBoard.js +57 -0
  153. package/lib/module/games/snake/components/ScoreBoard.js.map +1 -0
  154. package/lib/module/games/snake/components/index.js +6 -0
  155. package/lib/module/games/snake/components/index.js.map +1 -0
  156. package/lib/module/games/snake/index.js +6 -0
  157. package/lib/module/games/snake/index.js.map +1 -0
  158. package/lib/module/games/space-fighter/SpaceFighter.js +7 -10
  159. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  160. package/lib/module/games/whack-a-mole/WhackAMole.js +6 -6
  161. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  162. package/lib/module/games/whack-a-mole/components/GameBackground.js +7 -8
  163. package/lib/module/games/whack-a-mole/components/GameBackground.js.map +1 -1
  164. package/lib/module/index.js +8 -0
  165. package/lib/module/index.js.map +1 -1
  166. package/lib/module/services/GamesConstants.js +58 -2
  167. package/lib/module/services/GamesConstants.js.map +1 -1
  168. package/lib/module/services/GamesService.js +40 -0
  169. package/lib/module/services/GamesService.js.map +1 -1
  170. package/lib/module/services/SoundsService.js +132 -1
  171. package/lib/module/services/SoundsService.js.map +1 -1
  172. package/lib/module/shared/helpers/GameOverModal.js +6 -3
  173. package/lib/module/shared/helpers/GameOverModal.js.map +1 -1
  174. package/lib/module/shared/helpers/GameSettingsModal.js +3 -3
  175. package/lib/module/shared/helpers/GameSettingsModal.js.map +1 -1
  176. package/lib/module/shared/helpers/ParticleBlast.js +3 -2
  177. package/lib/module/shared/helpers/ParticleBlast.js.map +1 -1
  178. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  179. package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts +4 -0
  180. package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts.map +1 -0
  181. package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +104 -0
  182. package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts.map +1 -0
  183. package/lib/typescript/src/games/candy-crush/CandyCrushService.d.ts +40 -0
  184. package/lib/typescript/src/games/candy-crush/CandyCrushService.d.ts.map +1 -0
  185. package/lib/typescript/src/games/candy-crush/CandyCrushStore.d.ts +48 -0
  186. package/lib/typescript/src/games/candy-crush/CandyCrushStore.d.ts.map +1 -0
  187. package/lib/typescript/src/games/candy-crush/components/CandyItem.d.ts +13 -0
  188. package/lib/typescript/src/games/candy-crush/components/CandyItem.d.ts.map +1 -0
  189. package/lib/typescript/src/games/candy-crush/components/GameBackground.d.ts +5 -0
  190. package/lib/typescript/src/games/candy-crush/components/GameBackground.d.ts.map +1 -0
  191. package/lib/typescript/src/games/candy-crush/components/GameGrid.d.ts +3 -0
  192. package/lib/typescript/src/games/candy-crush/components/GameGrid.d.ts.map +1 -0
  193. package/lib/typescript/src/games/candy-crush/components/ScoreBoard.d.ts +3 -0
  194. package/lib/typescript/src/games/candy-crush/components/ScoreBoard.d.ts.map +1 -0
  195. package/lib/typescript/src/games/candy-crush/components/index.d.ts +5 -0
  196. package/lib/typescript/src/games/candy-crush/components/index.d.ts.map +1 -0
  197. package/lib/typescript/src/games/candy-crush/index.d.ts +4 -0
  198. package/lib/typescript/src/games/candy-crush/index.d.ts.map +1 -0
  199. package/lib/typescript/src/games/color-sort/ColorSort.d.ts +4 -0
  200. package/lib/typescript/src/games/color-sort/ColorSort.d.ts.map +1 -0
  201. package/lib/typescript/src/games/color-sort/ColorSortConstants.d.ts +52 -0
  202. package/lib/typescript/src/games/color-sort/ColorSortConstants.d.ts.map +1 -0
  203. package/lib/typescript/src/games/color-sort/ColorSortService.d.ts +66 -0
  204. package/lib/typescript/src/games/color-sort/ColorSortService.d.ts.map +1 -0
  205. package/lib/typescript/src/games/color-sort/ColorSortStore.d.ts +48 -0
  206. package/lib/typescript/src/games/color-sort/ColorSortStore.d.ts.map +1 -0
  207. package/lib/typescript/src/games/color-sort/components/ColorContainer.d.ts +11 -0
  208. package/lib/typescript/src/games/color-sort/components/ColorContainer.d.ts.map +1 -0
  209. package/lib/typescript/src/games/color-sort/components/GameBackground.d.ts +7 -0
  210. package/lib/typescript/src/games/color-sort/components/GameBackground.d.ts.map +1 -0
  211. package/lib/typescript/src/games/color-sort/components/ScoreBoard.d.ts +3 -0
  212. package/lib/typescript/src/games/color-sort/components/ScoreBoard.d.ts.map +1 -0
  213. package/lib/typescript/src/games/color-sort/components/index.d.ts +4 -0
  214. package/lib/typescript/src/games/color-sort/components/index.d.ts.map +1 -0
  215. package/lib/typescript/src/games/dino-jump/DinoJump.d.ts +4 -0
  216. package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -0
  217. package/lib/typescript/src/games/dino-jump/DinoJumpConstants.d.ts +95 -0
  218. package/lib/typescript/src/games/dino-jump/DinoJumpConstants.d.ts.map +1 -0
  219. package/lib/typescript/src/games/dino-jump/DinoJumpService.d.ts +40 -0
  220. package/lib/typescript/src/games/dino-jump/DinoJumpService.d.ts.map +1 -0
  221. package/lib/typescript/src/games/dino-jump/DinoJumpStore.d.ts +103 -0
  222. package/lib/typescript/src/games/dino-jump/DinoJumpStore.d.ts.map +1 -0
  223. package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts +3 -0
  224. package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -0
  225. package/lib/typescript/src/games/dino-jump/components/GameArea.d.ts +8 -0
  226. package/lib/typescript/src/games/dino-jump/components/GameArea.d.ts.map +1 -0
  227. package/lib/typescript/src/games/dino-jump/components/GameBackground.d.ts +7 -0
  228. package/lib/typescript/src/games/dino-jump/components/GameBackground.d.ts.map +1 -0
  229. package/lib/typescript/src/games/dino-jump/components/ObstacleSprite.d.ts +3 -0
  230. package/lib/typescript/src/games/dino-jump/components/ObstacleSprite.d.ts.map +1 -0
  231. package/lib/typescript/src/games/dino-jump/components/ScoreBoard.d.ts +3 -0
  232. package/lib/typescript/src/games/dino-jump/components/ScoreBoard.d.ts.map +1 -0
  233. package/lib/typescript/src/games/dino-jump/components/StarSprite.d.ts +3 -0
  234. package/lib/typescript/src/games/dino-jump/components/StarSprite.d.ts.map +1 -0
  235. package/lib/typescript/src/games/dino-jump/components/index.d.ts +7 -0
  236. package/lib/typescript/src/games/dino-jump/components/index.d.ts.map +1 -0
  237. package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts +4 -0
  238. package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -0
  239. package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts +83 -0
  240. package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -0
  241. package/lib/typescript/src/games/flappy-bird/FlappyBirdStore.d.ts +53 -0
  242. package/lib/typescript/src/games/flappy-bird/FlappyBirdStore.d.ts.map +1 -0
  243. package/lib/typescript/src/games/flappy-bird/components/Bird.d.ts +8 -0
  244. package/lib/typescript/src/games/flappy-bird/components/Bird.d.ts.map +1 -0
  245. package/lib/typescript/src/games/flappy-bird/components/GameArea.d.ts +8 -0
  246. package/lib/typescript/src/games/flappy-bird/components/GameArea.d.ts.map +1 -0
  247. package/lib/typescript/src/games/flappy-bird/components/GameBackground.d.ts +7 -0
  248. package/lib/typescript/src/games/flappy-bird/components/GameBackground.d.ts.map +1 -0
  249. package/lib/typescript/src/games/flappy-bird/components/Pipes.d.ts +8 -0
  250. package/lib/typescript/src/games/flappy-bird/components/Pipes.d.ts.map +1 -0
  251. package/lib/typescript/src/games/flappy-bird/components/ScoreBoard.d.ts +3 -0
  252. package/lib/typescript/src/games/flappy-bird/components/ScoreBoard.d.ts.map +1 -0
  253. package/lib/typescript/src/games/flappy-bird/components/index.d.ts +6 -0
  254. package/lib/typescript/src/games/flappy-bird/components/index.d.ts.map +1 -0
  255. package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts +4 -0
  256. package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -0
  257. package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts +115 -0
  258. package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -0
  259. package/lib/typescript/src/games/fruit-merger/FruitMergerService.d.ts +5 -0
  260. package/lib/typescript/src/games/fruit-merger/FruitMergerService.d.ts.map +1 -0
  261. package/lib/typescript/src/games/fruit-merger/FruitMergerStore.d.ts +43 -0
  262. package/lib/typescript/src/games/fruit-merger/FruitMergerStore.d.ts.map +1 -0
  263. package/lib/typescript/src/games/fruit-merger/components/FruitItem.d.ts +10 -0
  264. package/lib/typescript/src/games/fruit-merger/components/FruitItem.d.ts.map +1 -0
  265. package/lib/typescript/src/games/fruit-merger/components/GameArea.d.ts +8 -0
  266. package/lib/typescript/src/games/fruit-merger/components/GameArea.d.ts.map +1 -0
  267. package/lib/typescript/src/games/fruit-merger/components/GameBackground.d.ts +7 -0
  268. package/lib/typescript/src/games/fruit-merger/components/GameBackground.d.ts.map +1 -0
  269. package/lib/typescript/src/games/fruit-merger/components/ScoreBoard.d.ts +3 -0
  270. package/lib/typescript/src/games/fruit-merger/components/ScoreBoard.d.ts.map +1 -0
  271. package/lib/typescript/src/games/fruit-merger/components/index.d.ts +5 -0
  272. package/lib/typescript/src/games/fruit-merger/components/index.d.ts.map +1 -0
  273. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  274. package/lib/typescript/src/games/game-2048/Game2048.d.ts +4 -0
  275. package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -0
  276. package/lib/typescript/src/games/game-2048/Game2048Constants.d.ts +163 -0
  277. package/lib/typescript/src/games/game-2048/Game2048Constants.d.ts.map +1 -0
  278. package/lib/typescript/src/games/game-2048/Game2048Service.d.ts +113 -0
  279. package/lib/typescript/src/games/game-2048/Game2048Service.d.ts.map +1 -0
  280. package/lib/typescript/src/games/game-2048/Game2048Store.d.ts +48 -0
  281. package/lib/typescript/src/games/game-2048/Game2048Store.d.ts.map +1 -0
  282. package/lib/typescript/src/games/game-2048/components/GameBackground.d.ts +7 -0
  283. package/lib/typescript/src/games/game-2048/components/GameBackground.d.ts.map +1 -0
  284. package/lib/typescript/src/games/game-2048/components/GameGrid.d.ts +7 -0
  285. package/lib/typescript/src/games/game-2048/components/GameGrid.d.ts.map +1 -0
  286. package/lib/typescript/src/games/game-2048/components/GameTile.d.ts +13 -0
  287. package/lib/typescript/src/games/game-2048/components/GameTile.d.ts.map +1 -0
  288. package/lib/typescript/src/games/game-2048/components/ScoreBoard.d.ts +3 -0
  289. package/lib/typescript/src/games/game-2048/components/ScoreBoard.d.ts.map +1 -0
  290. package/lib/typescript/src/games/game-2048/components/index.d.ts +5 -0
  291. package/lib/typescript/src/games/game-2048/components/index.d.ts.map +1 -0
  292. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  293. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  294. package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts +4 -0
  295. package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -0
  296. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersConstants.d.ts +108 -0
  297. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersConstants.d.ts.map +1 -0
  298. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersService.d.ts +34 -0
  299. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersService.d.ts.map +1 -0
  300. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersStore.d.ts +56 -0
  301. package/lib/typescript/src/games/sliding-numbers/SlidingNumbersStore.d.ts.map +1 -0
  302. package/lib/typescript/src/games/sliding-numbers/components/GameBackground.d.ts +7 -0
  303. package/lib/typescript/src/games/sliding-numbers/components/GameBackground.d.ts.map +1 -0
  304. package/lib/typescript/src/games/sliding-numbers/components/NumbersGrid.d.ts +7 -0
  305. package/lib/typescript/src/games/sliding-numbers/components/NumbersGrid.d.ts.map +1 -0
  306. package/lib/typescript/src/games/sliding-numbers/components/NumbersTile.d.ts +11 -0
  307. package/lib/typescript/src/games/sliding-numbers/components/NumbersTile.d.ts.map +1 -0
  308. package/lib/typescript/src/games/sliding-numbers/components/ScoreBoard.d.ts +3 -0
  309. package/lib/typescript/src/games/sliding-numbers/components/ScoreBoard.d.ts.map +1 -0
  310. package/lib/typescript/src/games/sliding-numbers/components/index.d.ts +5 -0
  311. package/lib/typescript/src/games/sliding-numbers/components/index.d.ts.map +1 -0
  312. package/lib/typescript/src/games/snake/Snake.d.ts +4 -0
  313. package/lib/typescript/src/games/snake/Snake.d.ts.map +1 -0
  314. package/lib/typescript/src/games/snake/SnakeConstants.d.ts +93 -0
  315. package/lib/typescript/src/games/snake/SnakeConstants.d.ts.map +1 -0
  316. package/lib/typescript/src/games/snake/SnakeService.d.ts +30 -0
  317. package/lib/typescript/src/games/snake/SnakeService.d.ts.map +1 -0
  318. package/lib/typescript/src/games/snake/SnakeStore.d.ts +43 -0
  319. package/lib/typescript/src/games/snake/SnakeStore.d.ts.map +1 -0
  320. package/lib/typescript/src/games/snake/components/GameBackground.d.ts +5 -0
  321. package/lib/typescript/src/games/snake/components/GameBackground.d.ts.map +1 -0
  322. package/lib/typescript/src/games/snake/components/GameGrid.d.ts +3 -0
  323. package/lib/typescript/src/games/snake/components/GameGrid.d.ts.map +1 -0
  324. package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts +3 -0
  325. package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts.map +1 -0
  326. package/lib/typescript/src/games/snake/components/index.d.ts +4 -0
  327. package/lib/typescript/src/games/snake/components/index.d.ts.map +1 -0
  328. package/lib/typescript/src/games/snake/index.d.ts +4 -0
  329. package/lib/typescript/src/games/snake/index.d.ts.map +1 -0
  330. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  331. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  332. package/lib/typescript/src/games/whack-a-mole/components/GameBackground.d.ts.map +1 -1
  333. package/lib/typescript/src/index.d.ts +8 -0
  334. package/lib/typescript/src/index.d.ts.map +1 -1
  335. package/lib/typescript/src/services/GamesConstants.d.ts +156 -0
  336. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  337. package/lib/typescript/src/services/GamesService.d.ts +10 -2
  338. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  339. package/lib/typescript/src/services/SoundsService.d.ts +103 -0
  340. package/lib/typescript/src/services/SoundsService.d.ts.map +1 -1
  341. package/lib/typescript/src/shared/helpers/GameOverModal.d.ts +2 -0
  342. package/lib/typescript/src/shared/helpers/GameOverModal.d.ts.map +1 -1
  343. package/lib/typescript/src/shared/helpers/ParticleBlast.d.ts.map +1 -1
  344. package/package.json +1 -1
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { View, StyleSheet } from 'react-native';
5
+ import { GameControlButton, GameOverModal, GameSettingsModal } from "../../shared/helpers/index.js";
6
+ import { GAME_IDS, DEFAULT_GAME_SETTINGS } from "../../services/GamesService.js";
7
+ import { GameBackground, GameGrid, ScoreBoard } from "./components/index.js";
8
+ import { Game2048Service } from "./Game2048Service.js";
9
+ import { playHaptic, HapticType } from "../../services/HapticsService.js";
10
+ import { useGame2048Store, useScore, useIsPlaying, useIsGameOver, useIsWon } from "./Game2048Store.js";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ export const Game2048 = /*#__PURE__*/React.memo(({
13
+ settings,
14
+ onSettingsChange
15
+ }) => {
16
+ // Zustand store selectors for optimal re-renders
17
+ const score = useScore();
18
+ const isPlaying = useIsPlaying();
19
+ const isGameOver = useIsGameOver();
20
+ const isWon = useIsWon();
21
+
22
+ // Store actions
23
+ const {
24
+ startGame,
25
+ resetGame,
26
+ initializeGame,
27
+ updateSettings
28
+ } = useGame2048Store();
29
+
30
+ // Memoize settings for better performance
31
+ const gameSettings = React.useMemo(() => ({
32
+ difficulty: settings?.difficulty || 'easy',
33
+ enableSounds: settings?.enableSounds ?? true,
34
+ enableHaptics: settings?.enableHaptics ?? true
35
+ }), [settings?.difficulty, settings?.enableSounds, settings?.enableHaptics]);
36
+
37
+ // Memoized game initialization
38
+ const initGame = React.useCallback(() => {
39
+ initializeGame(gameSettings.difficulty);
40
+ }, [initializeGame, gameSettings.difficulty]);
41
+
42
+ // Update settings when they change
43
+ React.useEffect(() => {
44
+ updateSettings(gameSettings.enableSounds, gameSettings.enableHaptics);
45
+ }, [updateSettings, gameSettings.enableSounds, gameSettings.enableHaptics]);
46
+
47
+ // Initialize on mount and when difficulty changes
48
+ React.useEffect(() => {
49
+ initGame();
50
+ }, [initGame]);
51
+
52
+ // Cleanup on unmount
53
+ React.useEffect(() => {
54
+ const gameService = new Game2048Service();
55
+ return () => {
56
+ gameService.cleanup();
57
+ };
58
+ }, []);
59
+ return /*#__PURE__*/_jsx(GameBackground, {
60
+ children: /*#__PURE__*/_jsxs(View, {
61
+ style: styles.container,
62
+ children: [/*#__PURE__*/_jsx(ScoreBoard, {}), /*#__PURE__*/_jsx(GameGrid, {
63
+ difficulty: gameSettings.difficulty
64
+ }), /*#__PURE__*/_jsx(View, {
65
+ style: styles.controlsContainer,
66
+ children: /*#__PURE__*/_jsx(GameControlButton, {
67
+ isPlaying: isPlaying,
68
+ gameOver: isGameOver,
69
+ onStartGame: React.useCallback(() => {
70
+ if (!isPlaying) {
71
+ playHaptic(HapticType.SELECTION, gameSettings.enableHaptics);
72
+ startGame();
73
+ }
74
+ }, [isPlaying, gameSettings.enableHaptics, startGame]),
75
+ onStopGame: React.useCallback(() => {
76
+ playHaptic(HapticType.SELECTION, gameSettings.enableHaptics);
77
+ resetGame();
78
+ }, [gameSettings.enableHaptics, resetGame]),
79
+ startButtonText: isPlaying ? 'PLAYING' : 'START GAME',
80
+ stopButtonText: "STOP GAME",
81
+ startButtonSubtext: isPlaying ? 'Swipe to play' : 'Tap to start',
82
+ stopButtonSubtext: "Stop game and reset",
83
+ startButtonColor: isPlaying ? '#27ae60' : '#3498db',
84
+ stopButtonColor: "#e74c3c",
85
+ startButtonBorderColor: "#2980b9",
86
+ stopButtonBorderColor: "#c0392b"
87
+ })
88
+ }), /*#__PURE__*/_jsx(GameOverModal, {
89
+ isVisible: isGameOver || isWon,
90
+ score: score,
91
+ onPlayAgain: resetGame,
92
+ buttonText: isWon ? "Continue Playing!" : "Play Again!",
93
+ primaryColor: isWon ? "rgba(46, 204, 113, 0.95)" : "rgba(231, 76, 60, 0.95)",
94
+ borderColor: isWon ? "rgba(39, 174, 96, 0.9)" : "rgba(192, 57, 43, 0.9)",
95
+ buttonColor: isWon ? "#f39c12" : "#3498db",
96
+ buttonBorderColor: isWon ? "#e67e22" : "#2980b9"
97
+ }), /*#__PURE__*/_jsx(GameSettingsModal, {
98
+ gameId: GAME_IDS.GAME_2048,
99
+ settings: settings || DEFAULT_GAME_SETTINGS,
100
+ onSettingsChange: onSettingsChange
101
+ })]
102
+ })
103
+ });
104
+ });
105
+ const styles = StyleSheet.create({
106
+ container: {
107
+ flex: 1,
108
+ paddingHorizontal: 15,
109
+ paddingTop: 20,
110
+ paddingBottom: 10,
111
+ position: 'relative'
112
+ },
113
+ controlsContainer: {
114
+ marginTop: 25,
115
+ zIndex: 10,
116
+ position: 'relative'
117
+ }
118
+ });
119
+ Game2048.displayName = 'Game2048';
120
+ //# sourceMappingURL=Game2048.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","View","StyleSheet","GameControlButton","GameOverModal","GameSettingsModal","GAME_IDS","DEFAULT_GAME_SETTINGS","GameBackground","GameGrid","ScoreBoard","Game2048Service","playHaptic","HapticType","useGame2048Store","useScore","useIsPlaying","useIsGameOver","useIsWon","jsx","_jsx","jsxs","_jsxs","Game2048","memo","settings","onSettingsChange","score","isPlaying","isGameOver","isWon","startGame","resetGame","initializeGame","updateSettings","gameSettings","useMemo","difficulty","enableSounds","enableHaptics","initGame","useCallback","useEffect","gameService","cleanup","children","style","styles","container","controlsContainer","gameOver","onStartGame","SELECTION","onStopGame","startButtonText","stopButtonText","startButtonSubtext","stopButtonSubtext","startButtonColor","stopButtonColor","startButtonBorderColor","stopButtonBorderColor","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","gameId","GAME_2048","create","flex","paddingHorizontal","paddingTop","paddingBottom","position","marginTop","zIndex","displayName"],"sourceRoot":"../../../../src","sources":["games/game-2048/Game2048.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,iBAAiB,EAAEC,aAAa,EAAEC,iBAAiB,QAAQ,+BAAsB;AAC1F,SAASC,QAAQ,EAAkBC,qBAAqB,QAAQ,gCAA6B;AAC7F,SAASC,cAAc,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,uBAAc;AACnE,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AACtE,SACEC,gBAAgB,EAChBC,QAAQ,EACRC,YAAY,EACZC,aAAa,EACbC,QAAQ,QACH,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzB,OAAO,MAAMC,QAA6B,gBAAGvB,KAAK,CAACwB,IAAI,CAAC,CAAC;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,KAAK;EAC1F;EACA,MAAMC,KAAK,GAAGZ,QAAQ,CAAC,CAAC;EACxB,MAAMa,SAAS,GAAGZ,YAAY,CAAC,CAAC;EAChC,MAAMa,UAAU,GAAGZ,aAAa,CAAC,CAAC;EAClC,MAAMa,KAAK,GAAGZ,QAAQ,CAAC,CAAC;;EAExB;EACA,MAAM;IAAEa,SAAS;IAAEC,SAAS;IAAEC,cAAc;IAAEC;EAAe,CAAC,GAAGpB,gBAAgB,CAAC,CAAC;;EAEnF;EACA,MAAMqB,YAAY,GAAGnC,KAAK,CAACoC,OAAO,CAAC,OAAO;IACxCC,UAAU,EAAEZ,QA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wBAAyB;QACzEqC,WAAW,EAAErC,KAAK,GAAG,SAAS,GAAG,SAAU;QAC3CsC,iBAAiB,EAAEtC,KAAK,GAAG,SAAS,GAAG;MAAU,CAClD,CAAC,eAGFV,IAAA,CAACf,iBAAiB;QAChBgE,MAAM,EAAE/D,QAAQ,CAACgE,SAAU;QAC3B7C,QAAQ,EAAEA,QAAQ,IAAIlB,qBAAsB;QAC5CmB,gBAAgB,EAAEA;MAAiB,CACpC,CAAC;IAAA,CACE;EAAC,CACO,CAAC;AAErB,CAAC,CAAC;AAEF,MAAMqB,MAAM,GAAG7C,UAAU,CAACqE,MAAM,CAAC;EAC/BvB,SAAS,EAAE;IACTwB,IAAI,EAAE,CAAC;IACPC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,EAAE;IACjBC,QAAQ,EAAE;EACZ,CAAC;EACD3B,iBAAiB,EAAE;IACjB4B,SAAS,EAAE,EAAE;IACbC,MAAM,EAAE,EAAE;IACVF,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEFrD,QAAQ,CAACwD,WAAW,GAAG,UAAU","ignoreList":[]}
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+
3
+ export const GAME_2048_COLORS = {
4
+ // Background colors
5
+ BACKGROUND: '#faf8ef',
6
+ GRID_BACKGROUND: '#bbada0',
7
+ // Tile colors based on value
8
+ TILE_COLORS: {
9
+ 2: {
10
+ background: '#eee4da',
11
+ text: '#776e65'
12
+ },
13
+ 4: {
14
+ background: '#ede0c8',
15
+ text: '#776e65'
16
+ },
17
+ 8: {
18
+ background: '#f2b179',
19
+ text: '#f9f6f2'
20
+ },
21
+ 16: {
22
+ background: '#f59563',
23
+ text: '#f9f6f2'
24
+ },
25
+ 32: {
26
+ background: '#f67c5f',
27
+ text: '#f9f6f2'
28
+ },
29
+ 64: {
30
+ background: '#f65e3b',
31
+ text: '#f9f6f2'
32
+ },
33
+ 128: {
34
+ background: '#edcf72',
35
+ text: '#f9f6f2'
36
+ },
37
+ 256: {
38
+ background: '#edcc61',
39
+ text: '#f9f6f2'
40
+ },
41
+ 512: {
42
+ background: '#edc850',
43
+ text: '#f9f6f2'
44
+ },
45
+ 1024: {
46
+ background: '#edc53f',
47
+ text: '#f9f6f2'
48
+ },
49
+ 2048: {
50
+ background: '#edc22e',
51
+ text: '#f9f6f2'
52
+ },
53
+ 4096: {
54
+ background: '#3c3a32',
55
+ text: '#f9f6f2'
56
+ },
57
+ 8192: {
58
+ background: '#3c3a32',
59
+ text: '#f9f6f2'
60
+ }
61
+ },
62
+ // UI colors
63
+ SCOREBOARD_BACKGROUND: 'rgba(187, 173, 160, 0.9)',
64
+ SCOREBOARD_TEXT: '#776e65',
65
+ BUTTON_BACKGROUND: '#8f7a66',
66
+ BUTTON_TEXT: '#f9f6f2',
67
+ BUTTON_BORDER: '#776e65',
68
+ // Game over overlay
69
+ GAME_OVER_OVERLAY: 'rgba(238, 228, 218, 0.95)',
70
+ GAME_WIN_OVERLAY: 'rgba(237, 194, 46, 0.95)'
71
+ };
72
+ export const GAME_2048_SETTINGS = {
73
+ // Grid configuration
74
+ GRID_SIZE: 4,
75
+ TILE_SIZE: 70,
76
+ TILE_MARGIN: 8,
77
+ TILE_BORDER_RADIUS: 6,
78
+ // Animation settings - minimal for stability
79
+ ANIMATION_DURATION: 50,
80
+ MERGE_ANIMATION_DURATION: 30,
81
+ SPAWN_ANIMATION_DURATION: 50,
82
+ // Game mechanics
83
+ INITIAL_TILES: 2,
84
+ NEW_TILE_PROBABILITY_4: 0.1,
85
+ // 10% chance for 4, 90% for 2
86
+
87
+ // Scoring
88
+ SCORE_MULTIPLIER: {
89
+ easy: 1,
90
+ medium: 1.5,
91
+ hard: 2
92
+ },
93
+ // Difficulty settings
94
+ DIFFICULTY_SETTINGS: {
95
+ easy: {
96
+ gridSize: 4,
97
+ targetTile: 1024
98
+ },
99
+ medium: {
100
+ gridSize: 4,
101
+ targetTile: 2048
102
+ },
103
+ hard: {
104
+ gridSize: 4,
105
+ targetTile: 4096
106
+ }
107
+ }
108
+ };
109
+ export const GAME_2048_GESTURES = {
110
+ // Minimum distance for swipe recognition
111
+ MIN_SWIPE_DISTANCE: 50,
112
+ // Maximum time for swipe gesture
113
+ MAX_SWIPE_TIME: 300,
114
+ // Velocity threshold for swipe
115
+ MIN_VELOCITY: 0.5
116
+ };
117
+
118
+ // Frozen objects for better performance and immutability
119
+ export const GAME_2048_SOUNDS = Object.freeze({
120
+ TILE_MOVE: Object.freeze({
121
+ text: 'swipe',
122
+ pitch: 1.2,
123
+ rate: 1.5
124
+ }),
125
+ TILE_MERGE: Object.freeze({
126
+ text: 'merge',
127
+ pitch: 1.5,
128
+ rate: 1.2
129
+ }),
130
+ GAME_WIN: Object.freeze({
131
+ text: 'victory!',
132
+ pitch: 1.8,
133
+ rate: 0.8
134
+ }),
135
+ GAME_OVER: Object.freeze({
136
+ text: 'game over',
137
+ pitch: 0.8,
138
+ rate: 0.9
139
+ }),
140
+ NEW_TILE: Object.freeze({
141
+ text: 'pop',
142
+ pitch: 1.6,
143
+ rate: 1.8
144
+ }),
145
+ INVALID_MOVE: Object.freeze({
146
+ text: 'blocked',
147
+ pitch: 0.6,
148
+ rate: 1.5
149
+ })
150
+ });
151
+
152
+ // Memoized helper function to get tile color for better performance
153
+ const tileColorCache = new Map();
154
+ export const getTileColor = value => {
155
+ if (tileColorCache.has(value)) {
156
+ return tileColorCache.get(value);
157
+ }
158
+ let result;
159
+ if (value === 0) {
160
+ result = {
161
+ background: 'rgba(238, 228, 218, 0.35)',
162
+ text: '#776e65'
163
+ };
164
+ } else {
165
+ const colors = GAME_2048_COLORS.TILE_COLORS;
166
+ result = colors[value] || colors[8192];
167
+ }
168
+ tileColorCache.set(value, result);
169
+ return result;
170
+ };
171
+
172
+ // Helper function to format large numbers
173
+ export const formatScore = score => {
174
+ if (score >= 1000000) {
175
+ return `${(score / 1000000).toFixed(1)}M`;
176
+ } else if (score >= 1000) {
177
+ return `${(score / 1000).toFixed(1)}K`;
178
+ }
179
+ return score.toString();
180
+ };
181
+
182
+ // Helper function to get grid dimensions based on difficulty
183
+ // 2048-themed vibrant colors for background elements
184
+ export const BACKGROUND_TILE_COLORS = ['#E91E63',
185
+ // Vibrant pink (2)
186
+ '#F44336',
187
+ // Bright red (4)
188
+ '#FF5722',
189
+ // Deep orange (8)
190
+ '#FF9800',
191
+ // Orange (16)
192
+ '#FFC107',
193
+ // Amber/yellow (32)
194
+ '#CDDC39',
195
+ // Lime (64)
196
+ '#4CAF50',
197
+ // Green (128)
198
+ '#009688',
199
+ // Teal (256)
200
+ '#00BCD4',
201
+ // Cyan (512)
202
+ '#2196F3',
203
+ // Blue (1024)
204
+ '#3F51B5',
205
+ // Indigo (2048)
206
+ '#9C27B0' // Purple (4096+)
207
+ ];
208
+
209
+ // Game configuration constants
210
+ export const GAME_CONFIG = {
211
+ GRID_SIZE: 4,
212
+ INITIAL_TILES: 2,
213
+ NEW_TILE_PROBABILITY_4: 0.1,
214
+ // 10% chance for 4, 90% for 2
215
+ TILE_SIZE: 70,
216
+ TILE_MARGIN: 8,
217
+ ANIMATION_CONFIG: {
218
+ TENSION: 200,
219
+ FRICTION: 10
220
+ }
221
+ };
222
+
223
+ // 2048 Game Theme - Matches the colorful tile design
224
+ export const GAME_2048_THEME = {
225
+ backgroundColor: '#667eea',
226
+ // Purple gradient background
227
+ headerBackgroundColor: 'rgba(255, 255, 255, 0.4)',
228
+ // Semi-transparent white header
229
+ headerTextColor: '#2c3e50',
230
+ sectionBackgroundColor: 'rgba(52, 152, 219, 0.4)',
231
+ // Blue sections to match difficulty box
232
+ sectionTitleColor: '#ffffff',
233
+ buttonSelectedColor: '#3498db',
234
+ // Match game button colors
235
+ buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
236
+ buttonSelectedTextColor: '#ffffff',
237
+ buttonUnselectedTextColor: '#2c3e50',
238
+ switchTrackColorFalse: 'rgba(52, 152, 219, 0.5)',
239
+ switchTrackColorTrue: '#3498db',
240
+ switchThumbColor: '#ffffff',
241
+ infoTextColor: '#2c3e50'
242
+ };
243
+
244
+ // 2048 Difficulty Descriptions
245
+ export const GAME_2048_DIFFICULTY_DESCRIPTIONS = {
246
+ easy: 'Reach 1024 tile on 4x4 grid',
247
+ medium: 'Reach 2048 tile on 4x4 grid',
248
+ hard: 'Reach 4096 tile on 4x4 grid'
249
+ };
250
+ export const getGridDimensions = difficulty => {
251
+ const settings = GAME_2048_SETTINGS.DIFFICULTY_SETTINGS[difficulty];
252
+ const gridSize = settings.gridSize;
253
+ const tileSize = GAME_2048_SETTINGS.TILE_SIZE;
254
+ const margin = GAME_2048_SETTINGS.TILE_MARGIN;
255
+ const totalSize = tileSize * gridSize + margin * (gridSize + 1);
256
+ return {
257
+ gridSize,
258
+ tileSize,
259
+ margin,
260
+ totalSize
261
+ };
262
+ };
263
+ //# sourceMappingURL=Game2048Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GAME_2048_COLORS","BACKGROUND","GRID_BACKGROUND","TILE_COLORS","background","text","SCOREBOARD_BACKGROUND","SCOREBOARD_TEXT","BUTTON_BACKGROUND","BUTTON_TEXT","BUTTON_BORDER","GAME_OVER_OVERLAY","GAME_WIN_OVERLAY","GAME_2048_SETTINGS","GRID_SIZE","TILE_SIZE","TILE_MARGIN","TILE_BORDER_RADIUS","ANIMATION_DURATION","MERGE_ANIMATION_DURATION","SPAWN_ANIMATION_DURATION","INITIAL_TILES","NEW_TILE_PROBABILITY_4","SCORE_MULTIPLIER","easy","medium","hard","DIFFICULTY_SETTINGS","gridSize","targetTile","GAME_2048_GESTURES","MIN_SWIPE_DISTANCE","MAX_SWIPE_TIME","MIN_VELOCITY","GAME_2048_SOUNDS","Object","freeze","TILE_MOVE","pitch","rate","TILE_MERGE","GAME_WIN","GAME_OVER","NEW_TILE","INVALID_MOVE","tileColorCache","Map","getTileColor","value","has","get","result","colors","set","formatScore","score","toFixed","toString","BACKGROUND_TILE_COLORS","GAME_CONFIG","ANIMATION_CONFIG","TENSION","FRICTION","GAME_2048_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","GAME_2048_DIFFICULTY_DESCRIPTIONS","getGridDimensions","difficulty","settings","tileSize","margin","totalSize"],"sourceRoot":"../../../../src","sources":["games/game-2048/Game2048Constants.ts"],"mappings":";;AAEA,OAAO,MAAMA,gBAAgB,GAAG;EAC9B;EACAC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAE1B;EACAC,WAAW,EAAE;IACX,CAAC,EAAE;MAAEC,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC7C,CAAC,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC7C,CAAC,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC7C,EAAE,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC9C,EAAE,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC9C,EAAE,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC9C,GAAG,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC/C,GAAG,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC/C,GAAG,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAC/C,IAAI,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,EAAE;IAAU,CAAC;IAChD,IAAI,EAAE;MAAED,UAAU,EAAE,SAAS;MAAEC,IAAI,E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