react-native-games 1.1.0 → 1.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 (419) hide show
  1. package/README.md +101 -30
  2. package/lib/module/games/balloon-blaster/BalloonBlaster.js +1 -167
  3. package/lib/module/games/balloon-blaster/BalloonBlaster.js.map +1 -1
  4. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js +1 -182
  5. package/lib/module/games/balloon-blaster/BalloonBlasterConstants.js.map +1 -1
  6. package/lib/module/games/balloon-blaster/BalloonBlasterService.js +1 -318
  7. package/lib/module/games/balloon-blaster/BalloonBlasterStore.js +1 -183
  8. package/lib/module/games/balloon-blaster/components/BalloonComponent.js +1 -237
  9. package/lib/module/games/balloon-blaster/components/GameArea.js +1 -156
  10. package/lib/module/games/balloon-blaster/components/GameBackground.js +1 -476
  11. package/lib/module/games/balloon-blaster/components/ScoreBoard.js +1 -112
  12. package/lib/module/games/balloon-blaster/components/ScoreBoard.js.map +1 -1
  13. package/lib/module/games/balloon-blaster/components/index.js +1 -7
  14. package/lib/module/games/bike-racing/BikeRacing.js +1 -0
  15. package/lib/module/games/bike-racing/BikeRacing.js.map +1 -0
  16. package/lib/module/games/bike-racing/BikeRacingConstants.js +1 -0
  17. package/lib/module/games/bike-racing/BikeRacingConstants.js.map +1 -0
  18. package/lib/module/games/bike-racing/BikeRacingService.js +1 -0
  19. package/lib/module/games/bike-racing/BikeRacingService.js.map +1 -0
  20. package/lib/module/games/bike-racing/BikeRacingStore.js +1 -0
  21. package/lib/module/games/bike-racing/BikeRacingStore.js.map +1 -0
  22. package/lib/module/games/bike-racing/components/BikeComponent.js +1 -0
  23. package/lib/module/games/bike-racing/components/BikeComponent.js.map +1 -0
  24. package/lib/module/games/bike-racing/components/GameBackground.js +1 -0
  25. package/lib/module/games/bike-racing/components/GameBackground.js.map +1 -0
  26. package/lib/module/games/bike-racing/components/ScoreBoard.js +1 -0
  27. package/lib/module/games/bike-racing/components/ScoreBoard.js.map +1 -0
  28. package/lib/module/games/bike-racing/components/index.js +1 -0
  29. package/lib/module/games/bike-racing/components/index.js.map +1 -0
  30. package/lib/module/games/bike-racing/index.js +1 -0
  31. package/lib/module/games/bike-racing/index.js.map +1 -0
  32. package/lib/module/games/block-blast/BlockBlast.js +1 -0
  33. package/lib/module/games/block-blast/BlockBlast.js.map +1 -0
  34. package/lib/module/games/block-blast/BlockBlastConstants.js +1 -0
  35. package/lib/module/games/block-blast/BlockBlastConstants.js.map +1 -0
  36. package/lib/module/games/block-blast/BlockBlastService.js +1 -0
  37. package/lib/module/games/block-blast/BlockBlastService.js.map +1 -0
  38. package/lib/module/games/block-blast/BlockBlastStore.js +1 -0
  39. package/lib/module/games/block-blast/BlockBlastStore.js.map +1 -0
  40. package/lib/module/games/block-blast/components/BlockPieceComponent.js +1 -0
  41. package/lib/module/games/block-blast/components/BlockPieceComponent.js.map +1 -0
  42. package/lib/module/games/block-blast/components/GameArea.js +1 -0
  43. package/lib/module/games/block-blast/components/GameArea.js.map +1 -0
  44. package/lib/module/games/block-blast/components/GameBackground.js +1 -0
  45. package/lib/module/games/block-blast/components/GameBackground.js.map +1 -0
  46. package/lib/module/games/block-blast/components/GridComponent.js +1 -0
  47. package/lib/module/games/block-blast/components/GridComponent.js.map +1 -0
  48. package/lib/module/games/block-blast/components/ScoreBoard.js +1 -0
  49. package/lib/module/games/block-blast/components/ScoreBoard.js.map +1 -0
  50. package/lib/module/games/block-blast/components/index.js +1 -0
  51. package/lib/module/games/block-blast/components/index.js.map +1 -0
  52. package/lib/module/games/block-blast/index.js +1 -0
  53. package/lib/module/games/block-blast/index.js.map +1 -0
  54. package/lib/module/games/bubble-shooter/BubbleShooter.js +1 -0
  55. package/lib/module/games/bubble-shooter/BubbleShooter.js.map +1 -0
  56. package/lib/module/games/bubble-shooter/BubbleShooterConstants.js +1 -0
  57. package/lib/module/games/bubble-shooter/BubbleShooterConstants.js.map +1 -0
  58. package/lib/module/games/bubble-shooter/BubbleShooterService.js +1 -0
  59. package/lib/module/games/bubble-shooter/BubbleShooterService.js.map +1 -0
  60. package/lib/module/games/bubble-shooter/BubbleShooterStore.js +1 -0
  61. package/lib/module/games/bubble-shooter/BubbleShooterStore.js.map +1 -0
  62. package/lib/module/games/bubble-shooter/components/GameArea.js +1 -0
  63. package/lib/module/games/bubble-shooter/components/GameArea.js.map +1 -0
  64. package/lib/module/games/bubble-shooter/components/GameBackground.js +1 -0
  65. package/lib/module/games/bubble-shooter/components/GameBackground.js.map +1 -0
  66. package/lib/module/games/bubble-shooter/components/ScoreBoard.js +1 -0
  67. package/lib/module/games/bubble-shooter/components/ScoreBoard.js.map +1 -0
  68. package/lib/module/games/bubble-shooter/components/index.js +1 -0
  69. package/lib/module/games/bubble-shooter/components/index.js.map +1 -0
  70. package/lib/module/games/bubble-shooter/index.js +1 -0
  71. package/lib/module/games/bubble-shooter/index.js.map +1 -0
  72. package/lib/module/games/candy-crush/CandyCrush.js +1 -131
  73. package/lib/module/games/candy-crush/CandyCrush.js.map +1 -1
  74. package/lib/module/games/candy-crush/CandyCrushConstants.js +1 -125
  75. package/lib/module/games/candy-crush/CandyCrushConstants.js.map +1 -1
  76. package/lib/module/games/candy-crush/CandyCrushService.js +1 -370
  77. package/lib/module/games/candy-crush/CandyCrushStore.js +1 -303
  78. package/lib/module/games/candy-crush/components/CandyItem.js +1 -191
  79. package/lib/module/games/candy-crush/components/GameBackground.js +1 -85
  80. package/lib/module/games/candy-crush/components/GameGrid.js +1 -314
  81. package/lib/module/games/candy-crush/components/ScoreBoard.js +1 -79
  82. package/lib/module/games/candy-crush/components/index.js +1 -7
  83. package/lib/module/games/candy-crush/index.js +1 -6
  84. package/lib/module/games/car-racing/CarRacing.js +1 -0
  85. package/lib/module/games/car-racing/CarRacing.js.map +1 -0
  86. package/lib/module/games/car-racing/CarRacingConstants.js +1 -0
  87. package/lib/module/games/car-racing/CarRacingConstants.js.map +1 -0
  88. package/lib/module/games/car-racing/CarRacingService.js +1 -0
  89. package/lib/module/games/car-racing/CarRacingService.js.map +1 -0
  90. package/lib/module/games/car-racing/CarRacingStore.js +1 -0
  91. package/lib/module/games/car-racing/CarRacingStore.js.map +1 -0
  92. package/lib/module/games/car-racing/components/CarComponent.js +1 -0
  93. package/lib/module/games/car-racing/components/CarComponent.js.map +1 -0
  94. package/lib/module/games/car-racing/components/GameBackground.js +1 -0
  95. package/lib/module/games/car-racing/components/GameBackground.js.map +1 -0
  96. package/lib/module/games/car-racing/components/ScoreBoard.js +1 -0
  97. package/lib/module/games/car-racing/components/ScoreBoard.js.map +1 -0
  98. package/lib/module/games/car-racing/components/index.js +1 -0
  99. package/lib/module/games/car-racing/components/index.js.map +1 -0
  100. package/lib/module/games/colors-sort/ColorsSort.js +1 -143
  101. package/lib/module/games/colors-sort/ColorsSort.js.map +1 -1
  102. package/lib/module/games/colors-sort/ColorsSortConstants.js +1 -72
  103. package/lib/module/games/colors-sort/ColorsSortConstants.js.map +1 -1
  104. package/lib/module/games/colors-sort/ColorsSortService.js +1 -255
  105. package/lib/module/games/colors-sort/ColorsSortStore.js +1 -257
  106. package/lib/module/games/colors-sort/ColorsSortStore.js.map +1 -1
  107. package/lib/module/games/colors-sort/components/ColorContainer.js +1 -140
  108. package/lib/module/games/colors-sort/components/GameBackground.js +1 -135
  109. package/lib/module/games/colors-sort/components/ScoreBoard.js +1 -70
  110. package/lib/module/games/colors-sort/components/index.js +1 -6
  111. package/lib/module/games/dino-jump/DinoJump.js +1 -209
  112. package/lib/module/games/dino-jump/DinoJump.js.map +1 -1
  113. package/lib/module/games/dino-jump/DinoJumpConstants.js +1 -189
  114. package/lib/module/games/dino-jump/DinoJumpConstants.js.map +1 -1
  115. package/lib/module/games/dino-jump/DinoJumpService.js +1 -270
  116. package/lib/module/games/dino-jump/DinoJumpStore.js +1 -381
  117. package/lib/module/games/dino-jump/components/DinoSprite.js +1 -418
  118. package/lib/module/games/dino-jump/components/DinoSprite.js.map +1 -1
  119. package/lib/module/games/dino-jump/components/GameArea.js +1 -68
  120. package/lib/module/games/dino-jump/components/GameBackground.js +1 -444
  121. package/lib/module/games/dino-jump/components/ObstacleSprite.js +1 -306
  122. package/lib/module/games/dino-jump/components/ScoreBoard.js +1 -105
  123. package/lib/module/games/dino-jump/components/ScoreBoard.js.map +1 -1
  124. package/lib/module/games/dino-jump/components/StarSprite.js +1 -45
  125. package/lib/module/games/dino-jump/components/index.js +1 -9
  126. package/lib/module/games/flappy-bird/FlappyBird.js +1 -126
  127. package/lib/module/games/flappy-bird/FlappyBird.js.map +1 -1
  128. package/lib/module/games/flappy-bird/FlappyBirdConstants.js +1 -90
  129. package/lib/module/games/flappy-bird/FlappyBirdConstants.js.map +1 -1
  130. package/lib/module/games/flappy-bird/FlappyBirdStore.js +1 -300
  131. package/lib/module/games/flappy-bird/components/Bird.js +1 -87
  132. package/lib/module/games/flappy-bird/components/GameArea.js +1 -87
  133. package/lib/module/games/flappy-bird/components/GameBackground.js +1 -79
  134. package/lib/module/games/flappy-bird/components/Pipes.js +1 -172
  135. package/lib/module/games/flappy-bird/components/ScoreBoard.js +1 -73
  136. package/lib/module/games/flappy-bird/components/index.js +1 -8
  137. package/lib/module/games/fruit-merger/FruitMerger.js +1 -120
  138. package/lib/module/games/fruit-merger/FruitMerger.js.map +1 -1
  139. package/lib/module/games/fruit-merger/FruitMergerConstants.js +1 -119
  140. package/lib/module/games/fruit-merger/FruitMergerConstants.js.map +1 -1
  141. package/lib/module/games/fruit-merger/FruitMergerService.js +1 -13
  142. package/lib/module/games/fruit-merger/FruitMergerStore.js +1 -315
  143. package/lib/module/games/fruit-merger/components/FruitItem.js +1 -102
  144. package/lib/module/games/fruit-merger/components/GameArea.js +1 -103
  145. package/lib/module/games/fruit-merger/components/GameBackground.js +1 -498
  146. package/lib/module/games/fruit-merger/components/ScoreBoard.js +1 -58
  147. package/lib/module/games/fruit-merger/components/index.js +1 -7
  148. package/lib/module/games/fruit-ninja/FruitNinja.js +1 -134
  149. package/lib/module/games/fruit-ninja/FruitNinja.js.map +1 -1
  150. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js +1 -148
  151. package/lib/module/games/fruit-ninja/FruitNinjaConstants.js.map +1 -1
  152. package/lib/module/games/fruit-ninja/FruitNinjaService.js +1 -311
  153. package/lib/module/games/fruit-ninja/FruitNinjaStore.js +1 -191
  154. package/lib/module/games/fruit-ninja/FruitNinjaStore.js.map +1 -1
  155. package/lib/module/games/fruit-ninja/components/FruitComponent.js +1 -99
  156. package/lib/module/games/fruit-ninja/components/GameArea.js +1 -215
  157. package/lib/module/games/fruit-ninja/components/GameBackground.js +1 -1267
  158. package/lib/module/games/fruit-ninja/components/ScoreBoard.js +1 -92
  159. package/lib/module/games/fruit-ninja/components/ScoreBoard.js.map +1 -1
  160. package/lib/module/games/fruit-ninja/components/index.js +1 -7
  161. package/lib/module/games/game-2048/Game2048.js +1 -149
  162. package/lib/module/games/game-2048/Game2048.js.map +1 -1
  163. package/lib/module/games/game-2048/Game2048Constants.js +1 -263
  164. package/lib/module/games/game-2048/Game2048Constants.js.map +1 -1
  165. package/lib/module/games/game-2048/Game2048Service.js +1 -457
  166. package/lib/module/games/game-2048/Game2048Store.js +1 -236
  167. package/lib/module/games/game-2048/components/GameBackground.js +1 -247
  168. package/lib/module/games/game-2048/components/GameGrid.js +1 -139
  169. package/lib/module/games/game-2048/components/GameTile.js +1 -72
  170. package/lib/module/games/game-2048/components/ScoreBoard.js +1 -52
  171. package/lib/module/games/game-2048/components/index.js +1 -7
  172. package/lib/module/games/maze-runner/MazeRunner.js +1 -267
  173. package/lib/module/games/maze-runner/MazeRunner.js.map +1 -1
  174. package/lib/module/games/maze-runner/MazeRunnerConstants.js +1 -100
  175. package/lib/module/games/maze-runner/MazeRunnerConstants.js.map +1 -1
  176. package/lib/module/games/maze-runner/MazeRunnerService.js +1 -586
  177. package/lib/module/games/maze-runner/components/EnhancedBallComponent.js +1 -150
  178. package/lib/module/games/maze-runner/components/EnhancedGameArea.js +1 -370
  179. package/lib/module/games/maze-runner/components/GameBackground.js +1 -175
  180. package/lib/module/games/maze-runner/components/ScoreBoard.js +1 -61
  181. package/lib/module/games/maze-runner/components/SkiaPipeComponent.js +1 -209
  182. package/lib/module/games/maze-runner/components/StaticGameBackground.js +1 -169
  183. package/lib/module/games/maze-runner/components/WallComponent.js +1 -91
  184. package/lib/module/games/maze-runner/components/index.js +1 -8
  185. package/lib/module/games/perfect-circle/PerfectCircle.js +1 -0
  186. package/lib/module/games/perfect-circle/PerfectCircle.js.map +1 -0
  187. package/lib/module/games/perfect-circle/PerfectCircleConstants.js +1 -0
  188. package/lib/module/games/perfect-circle/PerfectCircleConstants.js.map +1 -0
  189. package/lib/module/games/perfect-circle/PerfectCircleService.js +1 -0
  190. package/lib/module/games/perfect-circle/PerfectCircleService.js.map +1 -0
  191. package/lib/module/games/perfect-circle/PerfectCircleStore.js +1 -0
  192. package/lib/module/games/perfect-circle/PerfectCircleStore.js.map +1 -0
  193. package/lib/module/games/perfect-circle/components/DrawingCanvas.js +1 -0
  194. package/lib/module/games/perfect-circle/components/DrawingCanvas.js.map +1 -0
  195. package/lib/module/games/perfect-circle/components/GameBackground.js +1 -0
  196. package/lib/module/games/perfect-circle/components/GameBackground.js.map +1 -0
  197. package/lib/module/games/perfect-circle/components/ScoreBoard.js +1 -0
  198. package/lib/module/games/perfect-circle/components/ScoreBoard.js.map +1 -0
  199. package/lib/module/games/perfect-circle/index.js +1 -0
  200. package/lib/module/games/perfect-circle/index.js.map +1 -0
  201. package/lib/module/games/popit-fidget/PopitFidget.js +1 -285
  202. package/lib/module/games/popit-fidget/PopitFidget.js.map +1 -1
  203. package/lib/module/games/popit-fidget/PopitFidgetConstants.js +1 -113
  204. package/lib/module/games/popit-fidget/PopitFidgetConstants.js.map +1 -1
  205. package/lib/module/games/popit-fidget/PopitFidgetService.js +1 -132
  206. package/lib/module/games/popit-fidget/PopitFidgetStore.js +1 -125
  207. package/lib/module/games/popit-fidget/components/BubbleComponent.js +1 -198
  208. package/lib/module/games/popit-fidget/components/FidgetGrid.js +1 -165
  209. package/lib/module/games/popit-fidget/components/GameBackground.js +1 -177
  210. package/lib/module/games/popit-fidget/components/ScoreBoard.js +1 -61
  211. package/lib/module/games/popit-fidget/components/index.js +1 -7
  212. package/lib/module/games/sliding-numbers/SlidingNumbers.js +1 -159
  213. package/lib/module/games/sliding-numbers/SlidingNumbers.js.map +1 -1
  214. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js +1 -207
  215. package/lib/module/games/sliding-numbers/SlidingNumbersConstants.js.map +1 -1
  216. package/lib/module/games/sliding-numbers/SlidingNumbersService.js +1 -248
  217. package/lib/module/games/sliding-numbers/SlidingNumbersStore.js +1 -274
  218. package/lib/module/games/sliding-numbers/components/GameBackground.js +1 -259
  219. package/lib/module/games/sliding-numbers/components/NumbersGrid.js +1 -174
  220. package/lib/module/games/sliding-numbers/components/NumbersTile.js +1 -116
  221. package/lib/module/games/sliding-numbers/components/ScoreBoard.js +1 -64
  222. package/lib/module/games/sliding-numbers/components/index.js +1 -7
  223. package/lib/module/games/snake/Snake.js +1 -189
  224. package/lib/module/games/snake/Snake.js.map +1 -1
  225. package/lib/module/games/snake/SnakeConstants.js +1 -138
  226. package/lib/module/games/snake/SnakeConstants.js.map +1 -1
  227. package/lib/module/games/snake/SnakeService.js +1 -148
  228. package/lib/module/games/snake/SnakeStore.js +1 -182
  229. package/lib/module/games/snake/SnakeStore.js.map +1 -1
  230. package/lib/module/games/snake/components/GameBackground.js +1 -221
  231. package/lib/module/games/snake/components/GameGrid.js +1 -153
  232. package/lib/module/games/snake/components/ScoreBoard.js +1 -51
  233. package/lib/module/games/snake/components/ScoreBoard.js.map +1 -1
  234. package/lib/module/games/snake/components/index.js +1 -6
  235. package/lib/module/games/snake/index.js +1 -6
  236. package/lib/module/games/space-fighter/SpaceFighter.js +1 -165
  237. package/lib/module/games/space-fighter/SpaceFighter.js.map +1 -1
  238. package/lib/module/games/space-fighter/SpaceFighterConstants.js +1 -108
  239. package/lib/module/games/space-fighter/SpaceFighterConstants.js.map +1 -1
  240. package/lib/module/games/space-fighter/SpaceFighterService.js +1 -326
  241. package/lib/module/games/space-fighter/SpaceFighterStore.js +1 -209
  242. package/lib/module/games/space-fighter/components/AsteroidComponent.js +1 -113
  243. package/lib/module/games/space-fighter/components/GameArea.js +1 -289
  244. package/lib/module/games/space-fighter/components/GameBackground.js +1 -239
  245. package/lib/module/games/space-fighter/components/ScoreBoard.js +1 -136
  246. package/lib/module/games/space-fighter/components/Spacecraft3D.js +1 -202
  247. package/lib/module/games/space-fighter/components/SpacecraftPath.js +1 -52
  248. package/lib/module/games/space-fighter/components/index.js +1 -9
  249. package/lib/module/games/whack-a-mole/WhackAMole.js +1 -270
  250. package/lib/module/games/whack-a-mole/WhackAMole.js.map +1 -1
  251. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js +1 -115
  252. package/lib/module/games/whack-a-mole/WhackAMoleConstants.js.map +1 -1
  253. package/lib/module/games/whack-a-mole/WhackAMoleService.js +1 -120
  254. package/lib/module/games/whack-a-mole/WhackAMoleStore.js +1 -172
  255. package/lib/module/games/whack-a-mole/components/GameBackground.js +1 -477
  256. package/lib/module/games/whack-a-mole/components/GameGrid.js +1 -97
  257. package/lib/module/games/whack-a-mole/components/GameHole.js +1 -196
  258. package/lib/module/games/whack-a-mole/components/MoleCharacter.js +1 -241
  259. package/lib/module/games/whack-a-mole/components/ScoreBoard.js +1 -67
  260. package/lib/module/games/whack-a-mole/components/ScoreBoard.js.map +1 -1
  261. package/lib/module/games/whack-a-mole/components/index.js +1 -8
  262. package/lib/module/helpers/AnimationFrame.js +1 -120
  263. package/lib/module/helpers/AnimationTracker.js +1 -89
  264. package/lib/module/helpers/ErrorHandler.js +1 -269
  265. package/lib/module/helpers/GameControlButton.js +1 -219
  266. package/lib/module/helpers/GameOverModal.js +1 -144
  267. package/lib/module/helpers/GameOverModal.js.map +1 -1
  268. package/lib/module/helpers/GameSettingsModal.js +1 -287
  269. package/lib/module/helpers/GameSettingsModal.js.map +1 -1
  270. package/lib/module/helpers/ParticleBlast.js +1 -134
  271. package/lib/module/helpers/ScoreBoardContainer.js +1 -34
  272. package/lib/module/helpers/ScoreBoardContainer.js.map +1 -1
  273. package/lib/module/helpers/index.js +1 -12
  274. package/lib/module/index.js +1 -22
  275. package/lib/module/index.js.map +1 -1
  276. package/lib/module/services/GamesConstants.js +1 -178
  277. package/lib/module/services/GamesConstants.js.map +1 -1
  278. package/lib/module/services/GamesService.js +1 -112
  279. package/lib/module/services/GamesService.js.map +1 -1
  280. package/lib/module/services/HapticsService.js +1 -77
  281. package/lib/module/services/ScoringService.js +1 -0
  282. package/lib/module/services/ScoringService.js.map +1 -0
  283. package/lib/module/services/SoundsService.js +1 -302
  284. package/lib/module/services/SoundsService.js.map +1 -1
  285. package/lib/module/services/UtilsService.js +1 -32
  286. package/lib/module/services/UtilsService.js.map +1 -1
  287. package/lib/typescript/src/games/balloon-blaster/BalloonBlaster.d.ts.map +1 -1
  288. package/lib/typescript/src/games/balloon-blaster/BalloonBlasterConstants.d.ts +1 -1
  289. package/lib/typescript/src/games/balloon-blaster/components/ScoreBoard.d.ts.map +1 -1
  290. package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts +4 -0
  291. package/lib/typescript/src/games/bike-racing/BikeRacing.d.ts.map +1 -0
  292. package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts +76 -0
  293. package/lib/typescript/src/games/bike-racing/BikeRacingConstants.d.ts.map +1 -0
  294. package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts +22 -0
  295. package/lib/typescript/src/games/bike-racing/BikeRacingService.d.ts.map +1 -0
  296. package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts +72 -0
  297. package/lib/typescript/src/games/bike-racing/BikeRacingStore.d.ts.map +1 -0
  298. package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts +12 -0
  299. package/lib/typescript/src/games/bike-racing/components/BikeComponent.d.ts.map +1 -0
  300. package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts +9 -0
  301. package/lib/typescript/src/games/bike-racing/components/GameBackground.d.ts.map +1 -0
  302. package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts +7 -0
  303. package/lib/typescript/src/games/bike-racing/components/ScoreBoard.d.ts.map +1 -0
  304. package/lib/typescript/src/games/bike-racing/components/index.d.ts +4 -0
  305. package/lib/typescript/src/games/bike-racing/components/index.d.ts.map +1 -0
  306. package/lib/typescript/src/games/bike-racing/index.d.ts +5 -0
  307. package/lib/typescript/src/games/bike-racing/index.d.ts.map +1 -0
  308. package/lib/typescript/src/games/block-blast/BlockBlast.d.ts +4 -0
  309. package/lib/typescript/src/games/block-blast/BlockBlast.d.ts.map +1 -0
  310. package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts +82 -0
  311. package/lib/typescript/src/games/block-blast/BlockBlastConstants.d.ts.map +1 -0
  312. package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts +17 -0
  313. package/lib/typescript/src/games/block-blast/BlockBlastService.d.ts.map +1 -0
  314. package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts +62 -0
  315. package/lib/typescript/src/games/block-blast/BlockBlastStore.d.ts.map +1 -0
  316. package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts +14 -0
  317. package/lib/typescript/src/games/block-blast/components/BlockPieceComponent.d.ts.map +1 -0
  318. package/lib/typescript/src/games/block-blast/components/GameArea.d.ts +12 -0
  319. package/lib/typescript/src/games/block-blast/components/GameArea.d.ts.map +1 -0
  320. package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts +7 -0
  321. package/lib/typescript/src/games/block-blast/components/GameBackground.d.ts.map +1 -0
  322. package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts +17 -0
  323. package/lib/typescript/src/games/block-blast/components/GridComponent.d.ts.map +1 -0
  324. package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts +7 -0
  325. package/lib/typescript/src/games/block-blast/components/ScoreBoard.d.ts.map +1 -0
  326. package/lib/typescript/src/games/block-blast/components/index.d.ts +6 -0
  327. package/lib/typescript/src/games/block-blast/components/index.d.ts.map +1 -0
  328. package/lib/typescript/src/games/block-blast/index.d.ts +5 -0
  329. package/lib/typescript/src/games/block-blast/index.d.ts.map +1 -0
  330. package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts +4 -0
  331. package/lib/typescript/src/games/bubble-shooter/BubbleShooter.d.ts.map +1 -0
  332. package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts +61 -0
  333. package/lib/typescript/src/games/bubble-shooter/BubbleShooterConstants.d.ts.map +1 -0
  334. package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts +26 -0
  335. package/lib/typescript/src/games/bubble-shooter/BubbleShooterService.d.ts.map +1 -0
  336. package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts +62 -0
  337. package/lib/typescript/src/games/bubble-shooter/BubbleShooterStore.d.ts.map +1 -0
  338. package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts +9 -0
  339. package/lib/typescript/src/games/bubble-shooter/components/GameArea.d.ts.map +1 -0
  340. package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts +8 -0
  341. package/lib/typescript/src/games/bubble-shooter/components/GameBackground.d.ts.map +1 -0
  342. package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts +7 -0
  343. package/lib/typescript/src/games/bubble-shooter/components/ScoreBoard.d.ts.map +1 -0
  344. package/lib/typescript/src/games/bubble-shooter/components/index.d.ts +4 -0
  345. package/lib/typescript/src/games/bubble-shooter/components/index.d.ts.map +1 -0
  346. package/lib/typescript/src/games/bubble-shooter/index.d.ts +3 -0
  347. package/lib/typescript/src/games/bubble-shooter/index.d.ts.map +1 -0
  348. package/lib/typescript/src/games/candy-crush/CandyCrush.d.ts.map +1 -1
  349. package/lib/typescript/src/games/candy-crush/CandyCrushConstants.d.ts +7 -7
  350. package/lib/typescript/src/games/car-racing/CarRacing.d.ts +4 -0
  351. package/lib/typescript/src/games/car-racing/CarRacing.d.ts.map +1 -0
  352. package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts +76 -0
  353. package/lib/typescript/src/games/car-racing/CarRacingConstants.d.ts.map +1 -0
  354. package/lib/typescript/src/games/car-racing/CarRacingService.d.ts +22 -0
  355. package/lib/typescript/src/games/car-racing/CarRacingService.d.ts.map +1 -0
  356. package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts +72 -0
  357. package/lib/typescript/src/games/car-racing/CarRacingStore.d.ts.map +1 -0
  358. package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts +13 -0
  359. package/lib/typescript/src/games/car-racing/components/CarComponent.d.ts.map +1 -0
  360. package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts +9 -0
  361. package/lib/typescript/src/games/car-racing/components/GameBackground.d.ts.map +1 -0
  362. package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts +7 -0
  363. package/lib/typescript/src/games/car-racing/components/ScoreBoard.d.ts.map +1 -0
  364. package/lib/typescript/src/games/car-racing/components/index.d.ts +4 -0
  365. package/lib/typescript/src/games/car-racing/components/index.d.ts.map +1 -0
  366. package/lib/typescript/src/games/colors-sort/ColorsSort.d.ts.map +1 -1
  367. package/lib/typescript/src/games/colors-sort/ColorsSortStore.d.ts.map +1 -1
  368. package/lib/typescript/src/games/dino-jump/DinoJump.d.ts.map +1 -1
  369. package/lib/typescript/src/games/dino-jump/components/DinoSprite.d.ts.map +1 -1
  370. package/lib/typescript/src/games/flappy-bird/FlappyBird.d.ts.map +1 -1
  371. package/lib/typescript/src/games/flappy-bird/FlappyBirdConstants.d.ts.map +1 -1
  372. package/lib/typescript/src/games/fruit-merger/FruitMerger.d.ts.map +1 -1
  373. package/lib/typescript/src/games/fruit-merger/FruitMergerConstants.d.ts.map +1 -1
  374. package/lib/typescript/src/games/fruit-ninja/FruitNinja.d.ts.map +1 -1
  375. package/lib/typescript/src/games/fruit-ninja/components/ScoreBoard.d.ts.map +1 -1
  376. package/lib/typescript/src/games/game-2048/Game2048.d.ts.map +1 -1
  377. package/lib/typescript/src/games/maze-runner/MazeRunner.d.ts.map +1 -1
  378. package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts +4 -0
  379. package/lib/typescript/src/games/perfect-circle/PerfectCircle.d.ts.map +1 -0
  380. package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts +81 -0
  381. package/lib/typescript/src/games/perfect-circle/PerfectCircleConstants.d.ts.map +1 -0
  382. package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts +14 -0
  383. package/lib/typescript/src/games/perfect-circle/PerfectCircleService.d.ts.map +1 -0
  384. package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts +40 -0
  385. package/lib/typescript/src/games/perfect-circle/PerfectCircleStore.d.ts.map +1 -0
  386. package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts +9 -0
  387. package/lib/typescript/src/games/perfect-circle/components/DrawingCanvas.d.ts.map +1 -0
  388. package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts +8 -0
  389. package/lib/typescript/src/games/perfect-circle/components/GameBackground.d.ts.map +1 -0
  390. package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts +7 -0
  391. package/lib/typescript/src/games/perfect-circle/components/ScoreBoard.d.ts.map +1 -0
  392. package/lib/typescript/src/games/perfect-circle/index.d.ts +3 -0
  393. package/lib/typescript/src/games/perfect-circle/index.d.ts.map +1 -0
  394. package/lib/typescript/src/games/popit-fidget/PopitFidget.d.ts.map +1 -1
  395. package/lib/typescript/src/games/sliding-numbers/SlidingNumbers.d.ts.map +1 -1
  396. package/lib/typescript/src/games/snake/Snake.d.ts.map +1 -1
  397. package/lib/typescript/src/games/snake/SnakeStore.d.ts +4 -0
  398. package/lib/typescript/src/games/snake/SnakeStore.d.ts.map +1 -1
  399. package/lib/typescript/src/games/snake/components/ScoreBoard.d.ts.map +1 -1
  400. package/lib/typescript/src/games/space-fighter/SpaceFighter.d.ts.map +1 -1
  401. package/lib/typescript/src/games/whack-a-mole/WhackAMole.d.ts.map +1 -1
  402. package/lib/typescript/src/games/whack-a-mole/WhackAMoleConstants.d.ts +1 -1
  403. package/lib/typescript/src/games/whack-a-mole/components/ScoreBoard.d.ts.map +1 -1
  404. package/lib/typescript/src/helpers/GameOverModal.d.ts +3 -0
  405. package/lib/typescript/src/helpers/GameOverModal.d.ts.map +1 -1
  406. package/lib/typescript/src/helpers/ScoreBoardContainer.d.ts.map +1 -1
  407. package/lib/typescript/src/index.d.ts +6 -1
  408. package/lib/typescript/src/index.d.ts.map +1 -1
  409. package/lib/typescript/src/services/GamesConstants.d.ts +57 -7
  410. package/lib/typescript/src/services/GamesConstants.d.ts.map +1 -1
  411. package/lib/typescript/src/services/GamesService.d.ts +2 -1
  412. package/lib/typescript/src/services/GamesService.d.ts.map +1 -1
  413. package/lib/typescript/src/services/ScoringService.d.ts +2 -0
  414. package/lib/typescript/src/services/ScoringService.d.ts.map +1 -0
  415. package/lib/typescript/src/services/SoundsService.d.ts +88 -0
  416. package/lib/typescript/src/services/SoundsService.d.ts.map +1 -1
  417. package/lib/typescript/src/services/UtilsService.d.ts +12 -1
  418. package/lib/typescript/src/services/UtilsService.d.ts.map +1 -1
  419. package/package.json +2 -2
@@ -1,306 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { View, StyleSheet } from 'react-native';
5
- import { useObstacles } from "../DinoJumpStore.js";
6
- import { DINO_JUMP_COLORS } from "../DinoJumpConstants.js";
7
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
- const SingleObstacle = /*#__PURE__*/React.memo(({
9
- obstacle
10
- }) => {
11
- // Safety check
12
- if (!obstacle || typeof obstacle.x !== 'number' || typeof obstacle.y !== 'number') {
13
- return null;
14
- }
15
-
16
- // Memoize render functions to avoid recreating on every render
17
- const renderCactusSmall = React.useMemo(() => /*#__PURE__*/_jsxs(View, {
18
- style: [styles.obstacleContainer, {
19
- left: obstacle.x,
20
- top: obstacle.y,
21
- width: obstacle.width,
22
- height: obstacle.height
23
- }],
24
- children: [/*#__PURE__*/_jsx(View, {
25
- style: [styles.cactusBody, {
26
- width: obstacle.width,
27
- height: obstacle.height,
28
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_PRIMARY
29
- }]
30
- }), /*#__PURE__*/_jsx(View, {
31
- style: [styles.cactusSpike, {
32
- left: 2,
33
- top: 6,
34
- width: 3,
35
- height: 3
36
- }]
37
- }), /*#__PURE__*/_jsx(View, {
38
- style: [styles.cactusSpike, {
39
- right: 2,
40
- top: 10,
41
- width: 3,
42
- height: 3
43
- }]
44
- }), /*#__PURE__*/_jsx(View, {
45
- style: [styles.cactusSpike, {
46
- left: obstacle.width / 2 - 1,
47
- top: 15,
48
- width: 3,
49
- height: 3
50
- }]
51
- }), /*#__PURE__*/_jsx(View, {
52
- style: [styles.cactusPlantedBase, {
53
- left: obstacle.width / 4,
54
- bottom: -6,
55
- width: obstacle.width / 2,
56
- height: 8,
57
- backgroundColor: '#654321',
58
- // Brown dirt color
59
- borderRadius: 4
60
- }]
61
- }), /*#__PURE__*/_jsx(View, {
62
- style: [styles.cactusRoot, {
63
- left: obstacle.width / 3,
64
- bottom: -4,
65
- width: obstacle.width / 3,
66
- height: 4,
67
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_PRIMARY
68
- }]
69
- })]
70
- }), [obstacle.x, obstacle.y, obstacle.width, obstacle.height]);
71
- const renderCactusLarge = React.useMemo(() => /*#__PURE__*/_jsxs(View, {
72
- style: [styles.obstacleContainer, {
73
- left: obstacle.x,
74
- top: obstacle.y,
75
- width: obstacle.width,
76
- height: obstacle.height
77
- }],
78
- children: [/*#__PURE__*/_jsx(View, {
79
- style: [styles.cactusBody, {
80
- width: obstacle.width,
81
- height: obstacle.height,
82
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_PRIMARY
83
- }]
84
- }), /*#__PURE__*/_jsx(View, {
85
- style: [styles.cactusArm, {
86
- left: -6,
87
- top: 15,
88
- width: 8,
89
- height: 15,
90
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_SECONDARY
91
- }]
92
- }), /*#__PURE__*/_jsx(View, {
93
- style: [styles.cactusArm, {
94
- right: -2,
95
- top: 10,
96
- width: 8,
97
- height: 20,
98
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_SECONDARY
99
- }]
100
- }), Array.from({
101
- length: 6
102
- }, (_, i) => /*#__PURE__*/_jsx(View, {
103
- style: [styles.cactusSpike, {
104
- left: 2 + i % 3 * 7,
105
- top: 8 + Math.floor(i / 3) * 15
106
- }]
107
- }, i)), /*#__PURE__*/_jsx(View, {
108
- style: [styles.cactusPlantedBase, {
109
- left: obstacle.width / 4,
110
- bottom: -8,
111
- width: obstacle.width / 2,
112
- height: 10,
113
- backgroundColor: '#654321',
114
- // Brown dirt color
115
- borderRadius: 5
116
- }]
117
- }), /*#__PURE__*/_jsx(View, {
118
- style: [styles.cactusRoot, {
119
- left: obstacle.width / 3,
120
- bottom: -5,
121
- width: obstacle.width / 3,
122
- height: 5,
123
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_PRIMARY
124
- }]
125
- })]
126
- }), [obstacle.x, obstacle.y, obstacle.width, obstacle.height]);
127
- const renderBird = React.useMemo(() => /*#__PURE__*/_jsxs(View, {
128
- style: [styles.obstacleContainer, {
129
- left: obstacle.x,
130
- top: obstacle.y,
131
- width: obstacle.width,
132
- height: obstacle.height
133
- }],
134
- children: [/*#__PURE__*/_jsx(View, {
135
- style: [styles.birdBody, {
136
- left: 10,
137
- top: 15,
138
- width: 20,
139
- height: 10
140
- }]
141
- }), /*#__PURE__*/_jsx(View, {
142
- style: [styles.birdHead, {
143
- left: 29,
144
- top: 12
145
- }]
146
- }), /*#__PURE__*/_jsx(View, {
147
- style: [styles.birdBeak, {
148
- left: 40,
149
- top: 17
150
- }]
151
- }), /*#__PURE__*/_jsx(View, {
152
- style: [styles.birdWing, {
153
- left: 5,
154
- top: 10,
155
- width: 15,
156
- height: 6
157
- }]
158
- }), /*#__PURE__*/_jsx(View, {
159
- style: [styles.birdWing, {
160
- left: 15,
161
- top: 8,
162
- width: 15,
163
- height: 6
164
- }]
165
- }), /*#__PURE__*/_jsx(View, {
166
- style: [styles.birdTail, {
167
- left: 0,
168
- top: 18
169
- }]
170
- })]
171
- }), [obstacle.x, obstacle.y, obstacle.width, obstacle.height]);
172
- switch (obstacle.type) {
173
- case 'cactus_small':
174
- return renderCactusSmall;
175
- case 'cactus_large':
176
- return renderCactusLarge;
177
- case 'bird':
178
- return renderBird;
179
- default:
180
- return null;
181
- }
182
- }, (prevProps, nextProps) => {
183
- // Custom comparison: only re-render if obstacle position or type changes
184
- return prevProps.obstacle.x === nextProps.obstacle.x && prevProps.obstacle.y === nextProps.obstacle.y && prevProps.obstacle.type === nextProps.obstacle.type && prevProps.obstacle.id === nextProps.obstacle.id;
185
- });
186
- export const ObstacleSprite = /*#__PURE__*/React.memo(() => {
187
- const obstacles = useObstacles();
188
-
189
- // Memoize visible obstacles to prevent infinite re-renders
190
- const visibleObstacles = React.useMemo(() => {
191
- if (!Array.isArray(obstacles) || obstacles.length === 0) {
192
- return [];
193
- }
194
-
195
- // Limit obstacles to prevent layout issues and only show visible ones
196
- return obstacles.filter(obstacle => obstacle && obstacle.x > -100 && obstacle.x < 500).slice(0, 5);
197
- }, [obstacles]);
198
-
199
- // Early return if no visible obstacles
200
- if (visibleObstacles.length === 0) {
201
- return null;
202
- }
203
- return /*#__PURE__*/_jsx(_Fragment, {
204
- children: visibleObstacles.map(obstacle => /*#__PURE__*/_jsx(SingleObstacle, {
205
- obstacle: obstacle
206
- }, obstacle.id))
207
- });
208
- });
209
- const styles = StyleSheet.create({
210
- obstacleContainer: {
211
- position: 'absolute',
212
- // Enhanced shadow for better depth
213
- shadowColor: '#000',
214
- shadowOffset: {
215
- width: 0,
216
- height: 2
217
- },
218
- shadowOpacity: 0.25,
219
- shadowRadius: 3,
220
- elevation: 4
221
- },
222
- cactusBody: {
223
- borderRadius: 6,
224
- borderWidth: 1,
225
- borderColor: DINO_JUMP_COLORS.OBSTACLE_OUTLINE
226
- // Subtle gradient effect with border
227
- },
228
- cactusArm: {
229
- position: 'absolute',
230
- borderRadius: 4,
231
- borderWidth: 1,
232
- borderColor: DINO_JUMP_COLORS.OBSTACLE_OUTLINE
233
- },
234
- cactusSpike: {
235
- position: 'absolute',
236
- width: 2,
237
- height: 2,
238
- borderRadius: 1,
239
- backgroundColor: DINO_JUMP_COLORS.OBSTACLE_OUTLINE
240
- },
241
- cactusBase: {
242
- position: 'absolute',
243
- borderRadius: 2,
244
- borderWidth: 1,
245
- borderColor: DINO_JUMP_COLORS.OBSTACLE_OUTLINE
246
- },
247
- cactusPlantedBase: {
248
- position: 'absolute',
249
- borderWidth: 1,
250
- borderColor: '#4a2c1a',
251
- shadowColor: '#000',
252
- shadowOffset: {
253
- width: 0,
254
- height: 1
255
- },
256
- shadowOpacity: 0.3,
257
- shadowRadius: 2,
258
- elevation: 2
259
- },
260
- cactusRoot: {
261
- position: 'absolute',
262
- borderRadius: 2
263
- },
264
- birdBody: {
265
- position: 'absolute',
266
- backgroundColor: '#8B4513',
267
- borderRadius: 5,
268
- borderWidth: 1,
269
- borderColor: '#654321'
270
- },
271
- birdHead: {
272
- position: 'absolute',
273
- width: 12,
274
- height: 12,
275
- backgroundColor: '#8B4513',
276
- borderRadius: 6,
277
- borderWidth: 1,
278
- borderColor: '#654321'
279
- },
280
- birdBeak: {
281
- position: 'absolute',
282
- width: 4,
283
- height: 2,
284
- backgroundColor: '#FFD700',
285
- borderRadius: 1
286
- },
287
- birdWing: {
288
- position: 'absolute',
289
- backgroundColor: '#A0522D',
290
- borderRadius: 3,
291
- borderWidth: 1,
292
- borderColor: '#654321'
293
- },
294
- birdTail: {
295
- position: 'absolute',
296
- width: 12,
297
- height: 4,
298
- backgroundColor: '#8B4513',
299
- borderRadius: 2,
300
- borderWidth: 1,
301
- borderColor: '#654321'
302
- }
303
- });
304
- SingleObstacle.displayName = 'SingleObstacle';
305
- ObstacleSprite.displayName = 'ObstacleSprite';
306
- //# sourceMappingURL=ObstacleSprite.js.map
1
+ "use strict";import React from 'react';import{View,StyleSheet}from 'react-native';import{useObstacles}from "../DinoJumpStore.js";import{DINO_JUMP_COLORS}from "../DinoJumpConstants.js";import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from "react/jsx-runtime";const SingleObstacle = React.memo(({obstacle})=>{if(!obstacle || typeof obstacle.x !== 'number' || typeof obstacle.y !== 'number'){return null;}const renderCactusSmall = React.useMemo(()=> _jsxs(View,{style:[styles.obstacleContainer,{left:obstacle.x,top:obstacle.y,width:obstacle.width,height:obstacle.height}],children:[_jsx(View,{style:[styles.cactusBody,{width:obstacle.width,height:obstacle.height,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_PRIMARY}]}),_jsx(View,{style:[styles.cactusSpike,{left:2,top:6,width:3,height:3}]}),_jsx(View,{style:[styles.cactusSpike,{right:2,top:10,width:3,height:3}]}),_jsx(View,{style:[styles.cactusSpike,{left:obstacle.width / 2 - 1,top:15,width:3,height:3}]}),_jsx(View,{style:[styles.cactusPlantedBase,{left:obstacle.width / 4,bottom:-6,width:obstacle.width / 2,height:8,backgroundColor:'#654321',borderRadius:4}]}),_jsx(View,{style:[styles.cactusRoot,{left:obstacle.width / 3,bottom:-4,width:obstacle.width / 3,height:4,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_PRIMARY}]})]}),[obstacle.x,obstacle.y,obstacle.width,obstacle.height]);const renderCactusLarge = React.useMemo(()=> _jsxs(View,{style:[styles.obstacleContainer,{left:obstacle.x,top:obstacle.y,width:obstacle.width,height:obstacle.height}],children:[_jsx(View,{style:[styles.cactusBody,{width:obstacle.width,height:obstacle.height,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_PRIMARY}]}),_jsx(View,{style:[styles.cactusArm,{left:-6,top:15,width:8,height:15,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_SECONDARY}]}),_jsx(View,{style:[styles.cactusArm,{right:-2,top:10,width:8,height:20,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_SECONDARY}]}),Array.from({length:6},(_,i)=> _jsx(View,{style:[styles.cactusSpike,{left:2 + i % 3 * 7,top:8 + Math.floor(i / 3)* 15}]},i)),_jsx(View,{style:[styles.cactusPlantedBase,{left:obstacle.width / 4,bottom:-8,width:obstacle.width / 2,height:10,backgroundColor:'#654321',borderRadius:5}]}),_jsx(View,{style:[styles.cactusRoot,{left:obstacle.width / 3,bottom:-5,width:obstacle.width / 3,height:5,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_PRIMARY}]})]}),[obstacle.x,obstacle.y,obstacle.width,obstacle.height]);const renderBird = React.useMemo(()=> _jsxs(View,{style:[styles.obstacleContainer,{left:obstacle.x,top:obstacle.y,width:obstacle.width,height:obstacle.height}],children:[_jsx(View,{style:[styles.birdBody,{left:10,top:15,width:20,height:10}]}),_jsx(View,{style:[styles.birdHead,{left:29,top:12}]}),_jsx(View,{style:[styles.birdBeak,{left:40,top:17}]}),_jsx(View,{style:[styles.birdWing,{left:5,top:10,width:15,height:6}]}),_jsx(View,{style:[styles.birdWing,{left:15,top:8,width:15,height:6}]}),_jsx(View,{style:[styles.birdTail,{left:0,top:18}]})]}),[obstacle.x,obstacle.y,obstacle.width,obstacle.height]);switch(obstacle.type){case 'cactus_small':return renderCactusSmall;case 'cactus_large':return renderCactusLarge;case 'bird':return renderBird;default:return null;}},(prevProps,nextProps)=>{return prevProps.obstacle.x === nextProps.obstacle.x && prevProps.obstacle.y === nextProps.obstacle.y && prevProps.obstacle.type === nextProps.obstacle.type && prevProps.obstacle.id === nextProps.obstacle.id;});export const ObstacleSprite = React.memo(()=>{const obstacles = useObstacles();const visibleObstacles = React.useMemo(()=>{if(!Array.isArray(obstacles)|| obstacles.length === 0){return [];}return obstacles.filter(obstacle => obstacle && obstacle.x > -100 && obstacle.x < 500).slice(0,5);},[obstacles]);if(visibleObstacles.length === 0){return null;}return _jsx(_Fragment,{children:visibleObstacles.map(obstacle => _jsx(SingleObstacle,{obstacle:obstacle},obstacle.id))});});const styles = StyleSheet.create({obstacleContainer:{position:'absolute',shadowColor:'#000',shadowOffset:{width:0,height:2},shadowOpacity:0.25,shadowRadius:3,elevation:4},cactusBody:{borderRadius:6,borderWidth:1,borderColor:DINO_JUMP_COLORS.OBSTACLE_OUTLINE},cactusArm:{position:'absolute',borderRadius:4,borderWidth:1,borderColor:DINO_JUMP_COLORS.OBSTACLE_OUTLINE},cactusSpike:{position:'absolute',width:2,height:2,borderRadius:1,backgroundColor:DINO_JUMP_COLORS.OBSTACLE_OUTLINE},cactusBase:{position:'absolute',borderRadius:2,borderWidth:1,borderColor:DINO_JUMP_COLORS.OBSTACLE_OUTLINE},cactusPlantedBase:{position:'absolute',borderWidth:1,borderColor:'#4a2c1a',shadowColor:'#000',shadowOffset:{width:0,height:1},shadowOpacity:0.3,shadowRadius:2,elevation:2},cactusRoot:{position:'absolute',borderRadius:2},birdBody:{position:'absolute',backgroundColor:'#8B4513',borderRadius:5,borderWidth:1,borderColor:'#654321'},birdHead:{position:'absolute',width:12,height:12,backgroundColor:'#8B4513',borderRadius:6,borderWidth:1,borderColor:'#654321'},birdBeak:{position:'absolute',width:4,height:2,backgroundColor:'#FFD700',borderRadius:1},birdWing:{position:'absolute',backgroundColor:'#A0522D',borderRadius:3,borderWidth:1,borderColor:'#654321'},birdTail:{position:'absolute',width:12,height:4,backgroundColor:'#8B4513',borderRadius:2,borderWidth:1,borderColor:'#654321'}});SingleObstacle.displayName = 'SingleObstacle';ObstacleSprite.displayName = 'ObstacleSprite';
@@ -1,105 +1 @@
1
- "use strict";
2
-
3
- import React, { useMemo } from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
5
- import { useScore, useTimeLeft, useLives } from "../DinoJumpStore.js";
6
- import { DinoJumpService } from "../DinoJumpService.js";
7
- import { ScoreBoardContainer } from "../../../helpers/index.js";
8
- import { DINO_JUMP_COLORS } from "../DinoJumpConstants.js";
9
-
10
- // Memoize gameService outside component to avoid recreation
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- const gameService = new DinoJumpService();
13
- export const ScoreBoard = /*#__PURE__*/React.memo(({
14
- offset = 0
15
- }) => {
16
- const score = useScore();
17
- const timeLeft = useTimeLeft();
18
- const lives = useLives();
19
- const formattedTime = useMemo(() => gameService.formatTime(timeLeft), [timeLeft]);
20
-
21
- // Generate hearts display: red for remaining lives, black for lost lives
22
- const heartsDisplay = useMemo(() => {
23
- const maxLives = 3; // Max lives increased to 5 (can collect stars for extra lives)
24
- const currentLives = Math.max(0, Math.min(lives, maxLives)); // Clamp between 0 and maxLives
25
- const lostLives = Math.max(0, maxLives - currentLives); // Ensure non-negative
26
-
27
- const redHearts = '❤️'.repeat(currentLives); // Remaining lives
28
- const blackHearts = '🖤'.repeat(lostLives); // Lost lives
29
- return redHearts + blackHearts;
30
- }, [lives]);
31
- return /*#__PURE__*/_jsx(ScoreBoardContainer, {
32
- offset: offset,
33
- backgroundColor: "rgba(255, 99, 71, 0.4)",
34
- borderColor: "rgba(255, 99, 71, 0.4)",
35
- children: /*#__PURE__*/_jsxs(View, {
36
- style: styles.scoreBoard,
37
- children: [/*#__PURE__*/_jsxs(View, {
38
- style: styles.scoreSection,
39
- children: [/*#__PURE__*/_jsx(Text, {
40
- style: styles.scoreLabel,
41
- children: "Score"
42
- }), /*#__PURE__*/_jsx(Text, {
43
- style: styles.scoreValue,
44
- children: score.toLocaleString()
45
- })]
46
- }), /*#__PURE__*/_jsxs(View, {
47
- style: styles.scoreSection,
48
- children: [/*#__PURE__*/_jsx(Text, {
49
- style: styles.scoreLabel,
50
- children: "Time"
51
- }), /*#__PURE__*/_jsx(Text, {
52
- style: [styles.timeValue, {
53
- color: timeLeft < 60 ? '#ef4444' : DINO_JUMP_COLORS.SCORE_TEXT
54
- }],
55
- children: formattedTime
56
- })]
57
- }), /*#__PURE__*/_jsxs(View, {
58
- style: styles.scoreSection,
59
- children: [/*#__PURE__*/_jsx(Text, {
60
- style: styles.scoreLabel,
61
- children: "Lives"
62
- }), /*#__PURE__*/_jsx(Text, {
63
- style: styles.livesValue,
64
- numberOfLines: 1,
65
- children: heartsDisplay
66
- })]
67
- })]
68
- })
69
- });
70
- });
71
- const styles = StyleSheet.create({
72
- scoreBoard: {
73
- flexDirection: 'row',
74
- justifyContent: 'space-between',
75
- alignItems: 'center'
76
- },
77
- scoreSection: {
78
- alignItems: 'center',
79
- flex: 1
80
- },
81
- scoreLabel: {
82
- fontSize: 18,
83
- fontWeight: 'bold',
84
- color: '#ffffff',
85
- // White label
86
- marginBottom: 4,
87
- letterSpacing: 0.5
88
- },
89
- scoreValue: {
90
- fontSize: 30,
91
- fontWeight: 'bold',
92
- color: '#ffffff' // White for score
93
- },
94
- timeValue: {
95
- fontSize: 30,
96
- fontWeight: 'bold'
97
- // Color is set dynamically in the component
98
- },
99
- livesValue: {
100
- fontSize: 20,
101
- fontWeight: 'bold'
102
- }
103
- });
104
- ScoreBoard.displayName = 'ScoreBoard';
105
- //# sourceMappingURL=ScoreBoard.js.map
1
+ "use strict";import React,{useMemo}from 'react';import{View,Text,StyleSheet}from 'react-native';import{useScore,useTimeLeft,useLives}from "../DinoJumpStore.js";import{DinoJumpService}from "../DinoJumpService.js";import{ScoreBoardContainer}from "../../../helpers/index.js";import{DINO_JUMP_COLORS}from "../DinoJumpConstants.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const gameService = new DinoJumpService();export const ScoreBoard = React.memo(({offset = 0})=>{const score = useScore();const timeLeft = useTimeLeft();const lives = useLives();const formattedTime = useMemo(()=> gameService.formatTime(timeLeft),[timeLeft]);const heartsDisplay = useMemo(()=>{const maxLives = 3;const currentLives = Math.max(0,Math.min(lives,maxLives));const lostLives = Math.max(0,maxLives - currentLives);const redHearts = '❤️'.repeat(currentLives);const blackHearts = '🖤'.repeat(lostLives);return redHearts + blackHearts;},[lives]);return _jsx(ScoreBoardContainer,{offset:offset,backgroundColor:"rgba(255,99,71,0.4)",borderColor:"rgba(255,99,71,0.4)",children:_jsxs(View,{style:styles.scoreBoard,children:[_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Score"}),_jsx(Text,{style:styles.scoreValue,children:score.toLocaleString()})]}),_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Time"}),_jsx(Text,{style:[styles.timeValue,{color:timeLeft < 60 ? '#ef4444':DINO_JUMP_COLORS.SCORE_TEXT}],children:formattedTime})]}),_jsxs(View,{style:styles.scoreSection,children:[_jsx(Text,{style:styles.scoreLabel,children:"Lives"}),_jsx(Text,{style:styles.livesValue,numberOfLines:1,children:heartsDisplay})]})]})});});const styles = StyleSheet.create({scoreBoard:{flexDirection:'row',justifyContent:'space-between',alignItems:'center'},scoreSection:{alignItems:'center',flex:1},scoreLabel:{fontSize:16,fontWeight:'bold',color:'#ffffff',marginBottom:4,letterSpacing:0.5},scoreValue:{fontSize:25,fontWeight:'bold',color:'#ffffff'},timeValue:{fontSize:25,fontWeight:'bold',color:'#ffffff'},livesValue:{fontSize:25,fontWeight:'bold'}});ScoreBoard.displayName = 'ScoreBoard';
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","View","Text","StyleSheet","useScore","useTimeLeft","useLives","DinoJumpService","ScoreBoardContainer","DINO_JUMP_COLORS","jsx","_jsx","jsxs","_jsxs","gameService","ScoreBoard","memo","offset","score","timeLeft","lives","formattedTime","formatTime","heartsDisplay","maxLives","currentLives","Math","max","min","lostLives","redHearts","repeat","blackHearts","backgroundColor","borderColor","children","style","styles","scoreBoard","scoreSection","scoreLabel","scoreValue","toLocaleString","timeValue","color","SCORE_TEXT","livesValue","numberOfLines","create","flexDirection","justifyContent","alignItems","flex","fontSize","fontWeight","marginBottom","letterSpacing","displayName"],"sourceRoot":"../../../../../src","sources":["games/dino-jump/components/ScoreBoard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,IAAI,EAAEC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACrD,SAASC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,qBAAkB;AAClE,SAASC,eAAe,QAAQ,uBAAoB;AACpD,SAASC,mBAAmB,QAAQ,2BAAkB;AACtD,SAASC,gBAAgB,QAAQ,yBAAsB;;AAEvD;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AACA,MAAMC,WAAW,GAAG,IAAIP,eAAe,CAAC,CAAC;AAMzC,OAAO,MAAMQ,UAAqC,gBAAGhB,KAAK,CAACiB,IAAI,CAAC,CAAC;EAAEC,MAAM,GAAG;AAAE,CAAC,KAAK;EAClF,MAAMC,KAAK,GAAGd,QAAQ,CAAC,CAAC;EACxB,MAAMe,QAAQ,GAAGd,WAAW,CAAC,CAAC;EAC9B,MAAMe,KAAK,GAAGd,QAAQ,CAAC,CAAC;EAExB,MAAMe,aAAa,GAAGrB,OAAO,CAAC,MAAMc,WAAW,CAACQ,UAAU,CAACH,QAAQ,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;;EAEjF;EACA,MAAMI,aAAa,GAAGvB,OAAO,CAAC,MAAM;IAClC,MAAMwB,QAAQ,GAAG,CAAC,CAAC,CAAC;IACpB,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,GAAG,CAACR,KAAK,EAAEI,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAMK,SAAS,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,QAAQ,GAAGC,YAAY,CAAC,CAAC,CAAC;;IAExD,MAAMK,SAAS,GAAG,IAAI,CAACC,MAAM,CAACN,YAAY,CAAC,CAAC,CAAC;IAC7C,MAAMO,WAAW,GAAG,IAAI,CAACD,MAAM,CAACF,SAAS,CAAC,CAAC,CAAC;IAC5C,OAAOC,SAAS,GAAGE,WAAW;EAChC,CAAC,EAAE,CAACZ,KAAK,CAAC,CAAC;EAEX,oBACET,IAAA,CAACH,mBAAmB;IAClBS,MAAM,EAAEA,MAAO;IACfgB,eAAe,EAAC,wBAAwB;IACxCC,WAAW,EAAC,wBAAwB;IAAAC,QAAA,eAEpCtB,KAAA,CAACZ,IAAI;MAACmC,KAAK,EAAEC,MAAM,CAACC,UAAW;MAAAH,QAAA,gBAC/BtB,KAAA,CAACZ,IAAI;QAACmC,KAAK,EAAEC,MAAM,CAACE,YAAa;QAAAJ,QAAA,gBAC/BxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAEC,MAAM,CAACG,UAAW;UAAAL,QAAA,EAAC;QAAK,CAAM,CAAC,eAC5CxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAEC,MAAM,CAACI,UAAW;UAAAN,QAAA,EAAEjB,KAAK,CAACwB,cAAc,CAAC;QAAC,CAAO,CAAC;MAAA,CAC3D,CAAC,eAEP7B,KAAA,CAACZ,IAAI;QAACmC,KAAK,EAAEC,MAAM,CAACE,YAAa;QAAAJ,QAAA,gBAC/BxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAEC,MAAM,CAACG,UAAW;UAAAL,QAAA,EAAC;QAAI,CAAM,CAAC,eAC3CxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAE,CAACC,MAAM,CAACM,SAAS,EAAE;YAAEC,KAAK,EAAEzB,QAAQ,GAAG,EAAE,GAAG,SAAS,GAAGV,gBAAgB,CAACoC;UAAW,CAAC,CAAE;UAAAV,QAAA,EACjGd;QAAa,CACV,CAAC;MAAA,CACH,CAAC,eAEPR,KAAA,CAACZ,IAAI;QAACmC,KAAK,EAAEC,MAAM,CAACE,YAAa;QAAAJ,QAAA,gBAC/BxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAEC,MAAM,CAACG,UAAW;UAAAL,QAAA,EAAC;QAAK,CAAM,CAAC,eAC5CxB,IAAA,CAACT,IAAI;UAACkC,KAAK,EAAEC,MAAM,CAACS,UAAW;UAACC,aAAa,EAAE,CAAE;UAAAZ,QAAA,EAAEZ;QAAa,CAAO,CAAC;MAAA,CACpE,CAAC;IAAA,CACH;EAAC,CACc,CAAC;AAE1B,CAAC,CAAC;AAEF,MAAMc,MAAM,GAAGlC,UAAU,CAAC6C,MAAM,CAAC;EAC/BV,UAAU,EAAE;IACVW,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE;EACd,CAAC;EACDZ,YAAY,EAAE;IACZY,UAAU,EAAE,QAAQ;IACpBC,IAAI,EAAE;EACR,CAAC;EACDZ,UAAU,EAAE;IACVa,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBV,KAAK,EAAE,SAAS;IAAE;IAClBW,YAAY,EAAE,CAAC;IACfC,aAAa,EAAE;EACjB,CAAC;EACDf,UAAU,EAAE;IACVY,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBV,KAAK,EAAE,SAAS,CAAE;EACpB,CAAC;EACDD,SAAS,EAAE;IACTU,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;IACZ;EACF,CAAC;EACDR,UAAU,EAAE;IACVO,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEFvC,UAAU,CAAC0C,WAAW,GAAG,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","View","Text","StyleSheet","useScore","useTimeLeft","useLives","DinoJumpService","ScoreBoardContainer","DINO_JUMP_COLORS","jsx","_jsx","jsxs","_jsxs","gameService","ScoreBoard","memo","offset","score","timeLeft","lives","formattedTime","formatTime","heartsDisplay","maxLives","currentLives","Math","max","min","lostLives","redHearts","repeat","blackHearts","backgroundColor","borderColor","children","style","styles","scoreBoard","scoreSection","scoreLabel","scoreValue","toLocaleString","timeValue","color","SCORE_TEXT","livesValue","numberOfLines","create","flexDirection","justifyContent","alignItems","flex","fontSize","fontWeight","marginBottom","letterSpacing","displayName"],"sourceRoot":"../../../../../src","sources":["games/dino-jump/components/ScoreBoard.tsx"],"mappings":"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","ignoreList":[]}
@@ -1,45 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import { View, Text, StyleSheet } from 'react-native';
5
- import { useStars } from "../DinoJumpStore.js";
6
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
7
- // Memoized single star component
8
- const SingleStar = /*#__PURE__*/React.memo(({
9
- star
10
- }) => /*#__PURE__*/_jsx(View, {
11
- style: [styles.starContainer, {
12
- left: star.x,
13
- top: star.y,
14
- width: star.width,
15
- height: star.height
16
- }],
17
- children: /*#__PURE__*/_jsx(Text, {
18
- style: styles.mushroom,
19
- children: "\uD83C\uDF44"
20
- })
21
- }), (prev, next) => prev.star.id === next.star.id && prev.star.x === next.star.x);
22
- export const StarSprite = /*#__PURE__*/React.memo(() => {
23
- const stars = useStars();
24
- if (!stars || stars.length === 0) {
25
- return null;
26
- }
27
- return /*#__PURE__*/_jsx(_Fragment, {
28
- children: stars.map(star => /*#__PURE__*/_jsx(SingleStar, {
29
- star: star
30
- }, star.id))
31
- });
32
- });
33
- const styles = StyleSheet.create({
34
- starContainer: {
35
- position: 'absolute',
36
- justifyContent: 'center',
37
- alignItems: 'center'
38
- },
39
- mushroom: {
40
- fontSize: 40,
41
- lineHeight: 40
42
- }
43
- });
44
- StarSprite.displayName = 'StarSprite';
45
- //# sourceMappingURL=StarSprite.js.map
1
+ "use strict";import React from 'react';import{View,Text,StyleSheet}from 'react-native';import{useStars}from "../DinoJumpStore.js";import{jsx as _jsx,Fragment as _Fragment}from "react/jsx-runtime";const SingleStar = React.memo(({star})=> _jsx(View,{style:[styles.starContainer,{left:star.x,top:star.y,width:star.width,height:star.height}],children:_jsx(Text,{style:styles.mushroom,children:"\uD83C\uDF44"})}),(prev,next)=> prev.star.id === next.star.id && prev.star.x === next.star.x);export const StarSprite = React.memo(()=>{const stars = useStars();if(!stars || stars.length === 0){return null;}return _jsx(_Fragment,{children:stars.map(star => _jsx(SingleStar,{star:star},star.id))});});const styles = StyleSheet.create({starContainer:{position:'absolute',justifyContent:'center',alignItems:'center'},mushroom:{fontSize:40,lineHeight:40}});StarSprite.displayName = 'StarSprite';
@@ -1,9 +1 @@
1
- "use strict";
2
-
3
- export { GameBackground } from "./GameBackground.js";
4
- export { GameArea } from "./GameArea.js";
5
- export { DinoSprite } from "./DinoSprite.js";
6
- export { ObstacleSprite } from "./ObstacleSprite.js";
7
- export { StarSprite } from "./StarSprite.js";
8
- export { ScoreBoard } from "./ScoreBoard.js";
9
- //# sourceMappingURL=index.js.map
1
+ "use strict";export{GameBackground}from "./GameBackground.js";export{GameArea}from "./GameArea.js";export{DinoSprite}from "./DinoSprite.js";export{ObstacleSprite}from "./ObstacleSprite.js";export{StarSprite}from "./StarSprite.js";export{ScoreBoard}from "./ScoreBoard.js";
@@ -1,126 +1 @@
1
- "use strict";
2
-
3
- import React, { useEffect, useCallback, useMemo, useRef } from 'react';
4
- import { View, StyleSheet } from 'react-native';
5
- import { GestureHandlerRootView } from 'react-native-gesture-handler';
6
- import { useFlappyBirdStore } from "./FlappyBirdStore.js";
7
- import { ScoreBoard, GameArea, GameBackground } from "./components/index.js";
8
- import { GameControlButton, GameOverModal } from "../../helpers/index.js";
9
- import { GameSettingsModal } from "../../helpers/index.js";
10
- import { FLAPPY_BIRD_COLORS } from "./FlappyBirdConstants.js";
11
- import { GAME_IDS, DEFAULT_GAME_SETTINGS } from "../../services/UtilsService.js";
12
- import { playSound, GAME_SOUNDS } from "../../services/SoundsService.js";
13
- import { playHaptic, HapticType } from "../../services/HapticsService.js";
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const formatTime = seconds => {
16
- const mins = Math.floor(seconds / 60);
17
- const secs = seconds % 60;
18
- return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
19
- };
20
- export const FlappyBird = /*#__PURE__*/React.memo(({
21
- settings = DEFAULT_GAME_SETTINGS,
22
- onSettingsChange
23
- }) => {
24
- // Only subscribe to non-animation state (CRITICAL: prevents 60fps re-renders)
25
- const isPlaying = useFlappyBirdStore(state => state.isPlaying);
26
- const isGameOver = useFlappyBirdStore(state => state.isGameOver);
27
- const survivalTime = useFlappyBirdStore(state => state.survivalTime);
28
- const initializeGame = useFlappyBirdStore(state => state.initializeGame);
29
- const startGame = useFlappyBirdStore(state => state.startGame);
30
- const stopGame = useFlappyBirdStore(state => state.stopGame);
31
- const resetGame = useFlappyBirdStore(state => state.resetGame);
32
- useEffect(() => {
33
- initializeGame();
34
- return () => {
35
- stopGame();
36
- };
37
- }, [initializeGame, stopGame]);
38
- const prevGameOverRef = useRef(false);
39
- useEffect(() => {
40
- if (isGameOver && !prevGameOverRef.current) {
41
- playSound(GAME_SOUNDS.FLAPPY_BIRD.HIT, settings.enableSounds);
42
- playHaptic(HapticType.HEAVY, settings.enableHaptics);
43
- }
44
- prevGameOverRef.current = isGameOver;
45
- }, [isGameOver, settings.enableSounds, settings.enableHaptics]);
46
- const handleStartGame = useCallback(() => {
47
- initializeGame();
48
- startGame(settings);
49
- playSound(GAME_SOUNDS.FLAPPY_BIRD.START, settings.enableSounds);
50
- playHaptic(HapticType.MEDIUM, settings.enableHaptics);
51
- }, [initializeGame, startGame, settings]);
52
- const handleStopGame = useCallback(() => {
53
- stopGame();
54
- }, [stopGame]);
55
- const handleResetGame = useCallback(() => {
56
- resetGame();
57
- initializeGame();
58
- }, [resetGame, initializeGame]);
59
-
60
- // Memoize modal props to prevent unnecessary re-renders
61
- const gameOverModalProps = useMemo(() => ({
62
- isVisible: isGameOver,
63
- score: survivalTime,
64
- onPlayAgain: handleResetGame,
65
- buttonText: "Fly Again!",
66
- primaryColor: FLAPPY_BIRD_COLORS.GAME_OVER_BG,
67
- borderColor: FLAPPY_BIRD_COLORS.BUTTON_PRIMARY,
68
- buttonColor: FLAPPY_BIRD_COLORS.BUTTON_PRIMARY,
69
- buttonBorderColor: FLAPPY_BIRD_COLORS.BUTTON_SECONDARY,
70
- scoreLabel: "Survival Time",
71
- scoreFormatter: formatTime
72
- }), [isGameOver, survivalTime, handleResetGame]);
73
- const gameSettingsModalProps = useMemo(() => ({
74
- gameId: GAME_IDS.FLAPPY_BIRD,
75
- settings,
76
- onSettingsChange
77
- }), [settings, onSettingsChange]);
78
-
79
- // Get offset from settings
80
- const offset = settings?.offset ?? 0;
81
-
82
- // Memoize GameControlButton props to prevent re-renders (CRITICAL)
83
- const gameControlButtonProps = useMemo(() => ({
84
- isPlaying,
85
- gameOver: isGameOver,
86
- onStartGame: handleStartGame,
87
- onStopGame: handleStopGame,
88
- startButtonText: "START FLYING",
89
- stopButtonText: "STOP GAME",
90
- startButtonSubtext: "Tap to flap!",
91
- startButtonColor: FLAPPY_BIRD_COLORS.BUTTON_PRIMARY,
92
- startButtonBorderColor: FLAPPY_BIRD_COLORS.BUTTON_SECONDARY
93
- }), [isPlaying, isGameOver, handleStartGame, handleStopGame]);
94
- return /*#__PURE__*/_jsx(View, {
95
- style: styles.root,
96
- children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
97
- children: /*#__PURE__*/_jsx(GameBackground, {
98
- offset: offset,
99
- children: /*#__PURE__*/_jsxs(View, {
100
- style: styles.container,
101
- children: [/*#__PURE__*/_jsx(GameArea, {
102
- settings: settings
103
- }), /*#__PURE__*/_jsx(ScoreBoard, {
104
- offset: offset
105
- }), /*#__PURE__*/_jsx(GameControlButton, {
106
- ...gameControlButtonProps
107
- }), /*#__PURE__*/_jsx(GameOverModal, {
108
- ...gameOverModalProps
109
- }), /*#__PURE__*/_jsx(GameSettingsModal, {
110
- ...gameSettingsModalProps
111
- })]
112
- })
113
- })
114
- })
115
- });
116
- });
117
- const styles = StyleSheet.create({
118
- root: {
119
- flex: 1
120
- },
121
- container: {
122
- flex: 1
123
- }
124
- });
125
- FlappyBird.displayName = 'FlappyBird';
126
- //# sourceMappingURL=FlappyBird.js.map
1
+ "use strict";import React,{useEffect,useCallback,useMemo,useRef}from 'react';import{View,StyleSheet}from 'react-native';import{GestureHandlerRootView}from 'react-native-gesture-handler';import{useFlappyBirdStore}from "./FlappyBirdStore.js";import{ScoreBoard,GameArea,GameBackground}from "./components/index.js";import{GameControlButton,GameOverModal}from "../../helpers/index.js";import{GameSettingsModal}from "../../helpers/index.js";import{FLAPPY_BIRD_COLORS}from "./FlappyBirdConstants.js";import{GAME_IDS,DEFAULT_GAME_SETTINGS}from "../../services/UtilsService.js";import{playSound,GAME_SOUNDS}from "../../services/SoundsService.js";import{playHaptic,HapticType}from "../../services/HapticsService.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const formatTime = seconds =>{const mins = Math.floor(seconds / 60);const secs = seconds % 60;return `${mins.toString().padStart(2,'0')}:${secs.toString().padStart(2,'0')}`;};export const FlappyBird = React.memo(({settings = DEFAULT_GAME_SETTINGS,onSettingsChange,onEndGame})=>{const isPlaying = useFlappyBirdStore(state => state.isPlaying);const isGameOver = useFlappyBirdStore(state => state.isGameOver);const survivalTime = useFlappyBirdStore(state => state.survivalTime);const gameReportedRef = useRef(false);const reportGameEnd = useCallback(status =>{if(onEndGame && !gameReportedRef.current){onEndGame({status,score:survivalTime.toString()});gameReportedRef.current = true;}},[onEndGame,survivalTime]);const initializeGame = useFlappyBirdStore(state => state.initializeGame);const startGame = useFlappyBirdStore(state => state.startGame);const stopGame = useFlappyBirdStore(state => state.stopGame);const resetGame = useFlappyBirdStore(state => state.resetGame);useEffect(()=>{initializeGame();return()=>{stopGame();};},[initializeGame,stopGame]);const prevGameOverRef = useRef(false);useEffect(()=>{if(isGameOver && !prevGameOverRef.current){playSound(GAME_SOUNDS.FLAPPY_BIRD.HIT,settings.enableSounds);playHaptic(HapticType.HEAVY,settings.enableHaptics);reportGameEnd('lose');}prevGameOverRef.current = isGameOver;if(!isGameOver){gameReportedRef.current = false;}},[isGameOver,settings.enableSounds,settings.enableHaptics,reportGameEnd]);const handleStartGame = useCallback(()=>{gameReportedRef.current = false;initializeGame();startGame(settings);playSound(GAME_SOUNDS.FLAPPY_BIRD.START,settings.enableSounds);playHaptic(HapticType.MEDIUM,settings.enableHaptics);},[initializeGame,startGame,settings]);const handleStopGame = useCallback(()=>{reportGameEnd('cancel');stopGame();},[stopGame,reportGameEnd]);const handleResetGame = useCallback(()=>{resetGame();initializeGame();},[resetGame,initializeGame]);const gameOverModalProps = useMemo(()=>({isVisible:isGameOver,score:survivalTime,onPlayAgain:handleResetGame,buttonText:"Fly Again!",primaryColor:"rgba(92,184,92,0.5)",borderColor:"rgba(92,184,92,0.5)",buttonColor:"#ffffff",buttonBorderColor:"#ffffff",buttonTextColor:"#5CB85C",scoreLabel:"Survival Time",scoreFormatter:formatTime}),[isGameOver,survivalTime,handleResetGame]);const gameSettingsModalProps = useMemo(()=>({gameId:GAME_IDS.FLAPPY_BIRD,settings,onSettingsChange}),[settings,onSettingsChange]);const offset = settings?.offset ?? 0;const gameControlButtonProps = useMemo(()=>({isPlaying,gameOver:isGameOver,onStartGame:handleStartGame,onStopGame:handleStopGame,startButtonText:"START FLYING",stopButtonText:"STOP GAME",startButtonSubtext:"Tap to flap!",startButtonColor:FLAPPY_BIRD_COLORS.BUTTON_PRIMARY,startButtonBorderColor:FLAPPY_BIRD_COLORS.BUTTON_SECONDARY}),[isPlaying,isGameOver,handleStartGame,handleStopGame]);return _jsx(View,{style:styles.root,children:_jsx(GestureHandlerRootView,{children:_jsx(GameBackground,{offset:offset,children:_jsxs(View,{style:styles.container,children:[_jsx(GameArea,{settings:settings}),_jsx(ScoreBoard,{offset:offset}),_jsx(GameControlButton,{...gameControlButtonProps}),_jsx(GameOverModal,{...gameOverModalProps}),_jsx(GameSettingsModal,{...gameSettingsModalProps})]})})})});});const styles = StyleSheet.create({root:{flex:1},container:{flex:1}});FlappyBird.displayName = 'FlappyBird';