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 +1 @@
1
- {"version":3,"names":["React","useEffect","useCallback","useMemo","useRef","View","StyleSheet","GestureHandlerRootView","useFlappyBirdStore","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","GameSettingsModal","FLAPPY_BIRD_COLORS","GAME_IDS","DEFAULT_GAME_SETTINGS","playSound","GAME_SOUNDS","playHaptic","HapticType","jsx","_jsx","jsxs","_jsxs","formatTime","seconds","mins","Math","floor","secs","toString","padStart","FlappyBird","memo","settings","onSettingsChange","isPlaying","state","isGameOver","survivalTime","initializeGame","startGame","stopGame","resetGame","prevGameOverRef","current","FLAPPY_BIRD","HIT","enableSounds","HEAVY","enableHaptics","handleStartGame","START","MEDIUM","handleStopGame","handleResetGame","gameOverModalProps","isVisible","score","onPlayAgain","buttonText","primaryColor","GAME_OVER_BG","borderColor","BUTTON_PRIMARY","buttonColor","buttonBorderColor","BUTTON_SECONDARY","scoreLabel","scoreFormatter","gameSettingsModalProps","gameId","offset","gameControlButtonProps","gameOver","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","startButtonColor","startButtonBorderColor","style","styles","root","children","container","create","flex","displayName"],"sourceRoot":"../../../../src","sources":["games/flappy-bird/FlappyBird.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAASC,kBAAkB,QAAQ,sBAAmB;AACtD,SAASC,UAAU,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,uBAAc;AACnE,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,wBAAe;AAChE,SAASC,iBAAiB,QAAQ,wBAAe;AACjD,SAASC,kBAAkB,QAAQ,0BAAuB;AAC1D,SAASC,QAAQ,EAAkBC,qBAAqB,QAAQ,gCAA6B;AAC7F,SAASC,SAAS,EAAEC,WAAW,QAAQ,iCAA8B;AACrE,SAASC,UAAU,EAAEC,UAAU,QAAQ,kCAA+B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvE,MAAMC,UAAU,GAAIC,OAAe,IAAa;EAC9C,MAAMC,IAAI,GAAGC,IAAI,CAACC,KAAK,CAACH,OAAO,GAAG,EAAE,CAAC;EACrC,MAAMI,IAAI,GAAGJ,OAAO,GAAG,EAAE;EACzB,OAAO,GAAGC,IAAI,CAACI,QAAQ,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAIF,IAAI,CAACC,QAAQ,CAAC,CAAC,C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AAK0D;UAAsB,CAAG,CAAC;QAAA,CAC7C;MAAC,CACO;IAAC,CACO;EAAC,CACrB,CAAC;AAEX,CAAC,CAAC;AAEF,MAAMa,MAAM,GAAG/E,UAAU,CAACmF,MAAM,CAAC;EAC/BH,IAAI,EAAE;IACJI,IAAI,EAAE;EACR,CAAC;EACDF,SAAS,EAAE;IACTE,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEFxD,UAAU,CAACyD,WAAW,GAAG,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useCallback","useMemo","useRef","View","StyleSheet","GestureHandlerRootView","useFlappyBirdStore","ScoreBoard","GameArea","GameBackground","GameControlButton","GameOverModal","GameSettingsModal","FLAPPY_BIRD_COLORS","GAME_IDS","DEFAULT_GAME_SETTINGS","playSound","GAME_SOUNDS","playHaptic","HapticType","jsx","_jsx","jsxs","_jsxs","formatTime","seconds","mins","Math","floor","secs","toString","padStart","FlappyBird","memo","settings","onSettingsChange","onEndGame","isPlaying","state","isGameOver","survivalTime","gameReportedRef","reportGameEnd","status","current","score","initializeGame","startGame","stopGame","resetGame","prevGameOverRef","FLAPPY_BIRD","HIT","enableSounds","HEAVY","enableHaptics","handleStartGame","START","MEDIUM","handleStopGame","handleResetGame","gameOverModalProps","isVisible","onPlayAgain","buttonText","primaryColor","borderColor","buttonColor","buttonBorderColor","buttonTextColor","scoreLabel","scoreFormatter","gameSettingsModalProps","gameId","offset","gameControlButtonProps","gameOver","onStartGame","onStopGame","startButtonText","stopButtonText","startButtonSubtext","startButtonColor","BUTTON_PRIMARY","startButtonBorderColor","BUTTON_SECONDARY","style","styles","root","children","container","create","flex","displayName"],"sourceRoot":"../../../../src","sources":["games/flappy-bird/FlappyBird.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,sBAAsB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aAAa;YAAA,GAAKkD;UAAkB,CAAG,CAAC,eAEzCxC,IAAA,CAACT,iBAAiB;YAAA,GAAK4D;UAAsB,CAAG,CAAC;QAAA,CAC7C;MAAC,CACO;IAAC,CACO;EAAC,CACrB,CAAC;AAEX,CAAC,CAAC;AAEF,MAAMe,MAAM,GAAGnF,UAAU,CAACuF,MAAM,CAAC;EAC/BH,IAAI,EAAE;IACJI,IAAI,EAAE;EACR,CAAC;EACDF,SAAS,EAAE;IACTE,IAAI,EAAE;EACR;AACF,CAAC,CAAC;AAEF5D,UAAU,CAAC6D,WAAW,GAAG,YAAY","ignoreList":[]}
@@ -1,90 +1 @@
1
- "use strict";
2
-
3
- import { Dimensions } from 'react-native';
4
- const {
5
- width,
6
- height
7
- } = Dimensions.get('window');
8
- export const FLAPPY_BIRD_GAME_CONFIG = {
9
- BIRD_SIZE: 40,
10
- BIRD_START_X: width * 0.2,
11
- BIRD_START_Y: height * 0.4,
12
- GRAVITY: 0.25,
13
- JUMP_VELOCITY: -6.5,
14
- MAX_FALL_SPEED: 7,
15
- VELOCITY_DAMPING: 0.98,
16
- PIPE_WIDTH: 60,
17
- PIPE_GAP: 200,
18
- PIPE_SPEED_EASY: 1.5,
19
- PIPE_SPEED_MEDIUM: 2.5,
20
- PIPE_SPEED_HARD: 3.5,
21
- PIPE_SPAWN_INTERVAL: 2800,
22
- MIN_PIPE_HEIGHT: 100,
23
- MAX_PIPE_HEIGHT: height * 0.6,
24
- GROUND_HEIGHT: 80,
25
- GAME_WIDTH: width,
26
- GAME_HEIGHT: height
27
- };
28
- export const FLAPPY_BIRD_COLORS = {
29
- SKY_START: '#87CEEB',
30
- SKY_END: '#E0F6FF',
31
- GROUND: '#DEB887',
32
- GROUND_DARK: '#8B7355',
33
- PIPE_GREEN: '#5CB85C',
34
- PIPE_DARK: '#4A934A',
35
- BIRD_YELLOW: '#FFD700',
36
- BIRD_ORANGE: '#FF8C00',
37
- SCORE_TEXT: '#FFFFFF',
38
- BUTTON_PRIMARY: '#5CB85C',
39
- BUTTON_SECONDARY: '#4A934A',
40
- GAME_OVER_BG: 'rgba(74, 147, 74, 0.95)',
41
- SCORE_BACKGROUND: 'rgba(92, 184, 92, 0.4)',
42
- SCORE_BORDER: 'rgba(92, 184, 92, 0.8)'
43
- };
44
- export const FLAPPY_BIRD_THEME = {
45
- backgroundColor: '#87CEEB',
46
- headerBackgroundColor: '#5CB85C',
47
- headerTextColor: '#FFFFFF',
48
- sectionBackgroundColor: 'rgba(255, 255, 255, 0.95)',
49
- sectionTitleColor: '#2C3E50',
50
- buttonSelectedColor: '#5CB85C',
51
- buttonUnselectedColor: '#E8E8E8',
52
- buttonSelectedTextColor: '#FFFFFF',
53
- buttonUnselectedTextColor: '#7F8C8D',
54
- switchTrackColorFalse: '#D1D5DB',
55
- switchTrackColorTrue: '#5CB85C',
56
- switchThumbColor: '#FFFFFF',
57
- infoTextColor: '#7F8C8D'
58
- };
59
- export const FLAPPY_BIRD_DIFFICULTY_DESCRIPTIONS = {
60
- easy: {
61
- title: 'Easy Mode',
62
- description: 'Perfect for beginners! Slower pipes and more time to react.',
63
- features: ['Slower pipe speed', 'Easier timing', 'Great for learning']
64
- },
65
- medium: {
66
- title: 'Medium Mode',
67
- description: 'Balanced challenge for casual players.',
68
- features: ['Moderate pipe speed', 'Standard difficulty', 'Good practice']
69
- },
70
- hard: {
71
- title: 'Hard Mode',
72
- description: 'Fast-paced action for experienced players!',
73
- features: ['Fast pipe speed', 'Quick reflexes needed', 'Maximum challenge']
74
- }
75
- };
76
- export const DIFFICULTY_CONFIG = {
77
- easy: {
78
- pipeSpeed: FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_EASY,
79
- pipeGap: 250
80
- },
81
- medium: {
82
- pipeSpeed: FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_MEDIUM,
83
- pipeGap: 220
84
- },
85
- hard: {
86
- pipeSpeed: FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_HARD,
87
- pipeGap: 200
88
- }
89
- };
90
- //# sourceMappingURL=FlappyBirdConstants.js.map
1
+ "use strict";import{Dimensions}from 'react-native';const{width,height}= Dimensions.get('window');export const FLAPPY_BIRD_GAME_CONFIG ={BIRD_SIZE:40,BIRD_START_X:width * 0.2,BIRD_START_Y:height * 0.4,GRAVITY:0.25,JUMP_VELOCITY:-4.5,MAX_FALL_SPEED:7,VELOCITY_DAMPING:0.98,PIPE_WIDTH:60,PIPE_GAP:200,PIPE_SPEED_EASY:1.5,PIPE_SPEED_MEDIUM:2.5,PIPE_SPEED_HARD:3.5,PIPE_SPAWN_INTERVAL:2800,MIN_PIPE_HEIGHT:100,MAX_PIPE_HEIGHT:height * 0.6,GROUND_HEIGHT:80,GAME_WIDTH:width,GAME_HEIGHT:height};export const FLAPPY_BIRD_COLORS ={SKY_START:'#87CEEB',SKY_END:'#E0F6FF',GROUND:'#DEB887',GROUND_DARK:'#8B7355',PIPE_GREEN:'#5CB85C',PIPE_DARK:'#4A934A',BIRD_YELLOW:'#FFD700',BIRD_ORANGE:'#FF8C00',SCORE_TEXT:'#FFFFFF',BUTTON_PRIMARY:'#5CB85C',BUTTON_SECONDARY:'#4A934A',GAME_OVER_BG:'rgba(74,147,74,0.95)',SCORE_BACKGROUND:'rgba(92,184,92,0.4)',SCORE_BORDER:'rgba(92,184,92,0.8)'};export const FLAPPY_BIRD_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#5CB85C',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(92,184,92,0.15)',sectionTitleColor:'#5CB85C',buttonSelectedColor:'#5CB85C',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(92,184,92,0.3)',switchTrackColorTrue:'#5CB85C',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const FLAPPY_BIRD_DIFFICULTY_DESCRIPTIONS ={easy:{title:'Easy Mode',description:'Perfect for beginners! Slower pipes and more time to react.',features:['Slower pipe speed','Easier timing','Great for learning']},medium:{title:'Medium Mode',description:'Balanced challenge for casual players.',features:['Moderate pipe speed','Standard difficulty','Good practice']},hard:{title:'Hard Mode',description:'Fast-paced action for experienced players!',features:['Fast pipe speed','Quick reflexes needed','Maximum challenge']}};export const DIFFICULTY_CONFIG ={easy:{pipeSpeed:FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_EASY,pipeGap:250},medium:{pipeSpeed:FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_MEDIUM,pipeGap:220},hard:{pipeSpeed:FLAPPY_BIRD_GAME_CONFIG.PIPE_SPEED_HARD,pipeGap:200}};
@@ -1 +1 @@
1
- {"version":3,"names":["Dimensions","width","height","get","FLAPPY_BIRD_GAME_CONFIG","BIRD_SIZE","BIRD_START_X","BIRD_START_Y","GRAVITY","JUMP_VELOCITY","MAX_FALL_SPEED","VELOCITY_DAMPING","PIPE_WIDTH","PIPE_GAP","PIPE_SPEED_EASY","PIPE_SPEED_MEDIUM","PIPE_SPEED_HARD","PIPE_SPAWN_INTERVAL","MIN_PIPE_HEIGHT","MAX_PIPE_HEIGHT","GROUND_HEIGHT","GAME_WIDTH","GAME_HEIGHT","FLAPPY_BIRD_COLORS","SKY_START","SKY_END","GROUND","GROUND_DARK","PIPE_GREEN","PIPE_DARK","BIRD_YELLOW","BIRD_ORANGE","SCORE_TEXT","BUTTON_PRIMARY","BUTTON_SECONDARY","GAME_OVER_BG","SCORE_BACKGROUND","SCORE_BORDER","FLAPPY_BIRD_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","FLAPPY_BIRD_DIFFICULTY_DESCRIPTIONS","easy","title","description","features","medium","hard","DIFFICULTY_CONFIG","pipeSpeed","pipeGap"],"sour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eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,2BAA2B;EACnDC,iBAAiB,EAAE,SAAS;EAC5BC,mBAAmB,EAAE,SAAS;EAC9BC,qBAAqB,EAAE,SAAS;EAChCC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,SAAS;EACpCC,qBAAqB,EAAE,SAAS;EAChCC,oBAAoB,EAAE,SAAS;EAC/BC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE;AACjB,CAAC;AAED,OAAO,MAAMC,mCAAmC,GAAG;EACjDC,IAAI,EAAE;IACJC,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,6DAA6D;IAC1EC,QAAQ,EAAE,CAAC,mBAAmB,EAAE,eAAe,EAAE,oBAAoB;EACvE,CAAC;EACDC,MAAM,EAAE;IACNH,KAAK,EAAE,aAAa;IACpBC,WAAW,EAAE,wCAAwC;IACrDC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,eAAe;EAC1E,CAAC;EACDE,IAAI,EAAE;IACJJ,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,4CAA4C;IACzDC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,mBAAmB;EAC5E;AACF,CAAC;AAED,OAAO,MAAMG,iBAAiB,GAAG;EAC/BN,IAAI,EAAE;IACJO,SAAS,EAAExD,uBAAuB,CAACU,eAAe;IAClD+C,OAAO,EAAE;EACX,CAAC;EACDJ,MAAM,EAAE;IACNG,SAAS,EAAExD,uBAAuB,CAACW,iBAAiB;IACpD8C,OAAO,EAAE;EACX,CAAC;EACDH,IAAI,EAAE;IACJE,SAAS,EAAExD,uBAAuB,CAACY,eAAe;IAClD6C,OAAO,EAAE;EACX;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["Dimensions","width","height","get","FLAPPY_BIRD_GAME_CONFIG","BIRD_SIZE","BIRD_START_X","BIRD_START_Y","GRAVITY","JUMP_VELOCITY","MAX_FALL_SPEED","VELOCITY_DAMPING","PIPE_WIDTH","PIPE_GAP","PIPE_SPEED_EASY","PIPE_SPEED_MEDIUM","PIPE_SPEED_HARD","PIPE_SPAWN_INTERVAL","MIN_PIPE_HEIGHT","MAX_PIPE_HEIGHT","GROUND_HEIGHT","GAME_WIDTH","GAME_HEIGHT","FLAPPY_BIRD_COLORS","SKY_START","SKY_END","GROUND","GROUND_DARK","PIPE_GREEN","PIPE_DARK","BIRD_YELLOW","BIRD_ORANGE","SCORE_TEXT","BUTTON_PRIMARY","BUTTON_SECONDARY","GAME_OVER_BG","SCORE_BACKGROUND","SCORE_BORDER","FLAPPY_BIRD_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","FLAPPY_BIRD_DIFFICULTY_DESCRIPTIONS","easy","title","description","features","medium","hard","DIFFICULTY_CONFIG","pipeSpeed","pipeGap"],"sourceRoot":"../../../../src","sources":["games/flappy-bird/FlappyBirdConstants.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,MAAM;EAAEC,KAAK;EAAEC;AAAO,CAAC,GAAGF,UAAU,CAACG,GAAG,CAAC,QAAQ,CAAC;AAElD,OAAO,MAAMC,uBAAuB,GAAG;EACrCC,SAAS,EAAE,EAAE;EACbC,YAAY,EAAEL,KAAK,GAAG,GAAG;EACzBM,YAAY,EAAEL,MAAM,GAAG,GAAG;EAC1BM,OAAO,EAAE,IAAI;EACbC,aAAa,EAAE,CAAC,GAAG;EACnBC,cAAc,EAAE,CAAC;EACjBC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE,EAAE;EACdC,QAAQ,EAAE,GAAG;EACbC,eAAe,EAAE,GAAG;EACpBC,iBAAiB,EAAE,GAAG;EACtBC,eAAe,EAAE,GAAG;EACpBC,mBAAmB,EAAE,IAAI;EACz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AAK,EAAE,aAAa;IACpBC,WAAW,EAAE,wCAAwC;IACrDC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,eAAe;EAC1E,CAAC;EACDE,IAAI,EAAE;IACJJ,KAAK,EAAE,WAAW;IAClBC,WAAW,EAAE,4CAA4C;IACzDC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,EAAE,mBAAmB;EAC5E;AACF,CAAC;AAED,OAAO,MAAMG,iBAAiB,GAAG;EAC/BN,IAAI,EAAE;IACJO,SAAS,EAAExD,uBAAuB,CAACU,eAAe;IAClD+C,OAAO,EAAE;EACX,CAAC;EACDJ,MAAM,EAAE;IACNG,SAAS,EAAExD,uBAAuB,CAACW,iBAAiB;IACpD8C,OAAO,EAAE;EACX,CAAC;EACDH,IAAI,EAAE;IACJE,SAAS,EAAExD,uBAAuB,CAACY,eAAe;IAClD6C,OAAO,EAAE;EACX;AACF,CAAC","ignoreList":[]}
@@ -1,300 +1 @@
1
- "use strict";
2
-
3
- import { create } from 'zustand';
4
- import { subscribeWithSelector } from 'zustand/middleware';
5
- import { immerMiddleware } from "../../services/UtilsService.js";
6
- import { FLAPPY_BIRD_GAME_CONFIG, DIFFICULTY_CONFIG } from "./FlappyBirdConstants.js";
7
- const BASE_BRICK_WALL_HEIGHT = 150; // Base wall height (both top and bottom)
8
-
9
- const generateRandomPipeHeight = (offset = 0) => {
10
- const {
11
- MIN_PIPE_HEIGHT,
12
- GAME_HEIGHT
13
- } = FLAPPY_BIRD_GAME_CONFIG;
14
- const topWallHeight = BASE_BRICK_WALL_HEIGHT + offset;
15
- const bottomWallHeight = offset > 0 ? 150 : 250; // Dynamic bottom wall height
16
- // Calculate playable height accounting for increased top wall and dynamic bottom wall
17
- // Bottom wall is at screen bottom, so no GROUND_HEIGHT subtraction needed
18
- const playableHeight = GAME_HEIGHT - topWallHeight - bottomWallHeight;
19
- const minHeight = topWallHeight + MIN_PIPE_HEIGHT;
20
- const maxHeight = topWallHeight + playableHeight * 0.6;
21
- return minHeight + Math.random() * (maxHeight - minHeight);
22
- };
23
- export const useFlappyBirdStore = create()(subscribeWithSelector(immerMiddleware((set, get) => ({
24
- isPlaying: false,
25
- isGameOver: false,
26
- score: 0,
27
- survivalTime: 0,
28
- birdY: FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y,
29
- birdVelocity: 0,
30
- pipes: [],
31
- collisionBlasts: [],
32
- gameLoopInterval: null,
33
- pipeSpawnInterval: null,
34
- timerInterval: null,
35
- initializeGame: () => {
36
- set(state => {
37
- state.isPlaying = false;
38
- state.isGameOver = false;
39
- state.score = 0;
40
- state.survivalTime = 0;
41
- state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;
42
- state.birdVelocity = 0;
43
- state.pipes = [];
44
- state.collisionBlasts = [];
45
- });
46
- },
47
- startGame: settings => {
48
- const state = get();
49
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
50
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
51
- if (state.timerInterval) clearInterval(state.timerInterval);
52
- set(state => {
53
- state.isPlaying = true;
54
- state.isGameOver = false;
55
- state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;
56
- state.birdVelocity = 0;
57
- state.pipes = [];
58
- state.score = 0;
59
- state.survivalTime = 0;
60
- });
61
-
62
- // Start game loop (60fps)
63
- const gameLoop = setInterval(() => {
64
- get().updatePhysics(settings);
65
- }, 1000 / 60);
66
-
67
- // Start pipe spawning
68
- const pipeSpawn = setInterval(() => {
69
- get().spawnPipe(settings);
70
- }, FLAPPY_BIRD_GAME_CONFIG.PIPE_SPAWN_INTERVAL);
71
-
72
- // Start survival timer (1 second intervals)
73
- const timer = setInterval(() => {
74
- set(state => {
75
- state.survivalTime += 1;
76
- });
77
- }, 1000);
78
- set(state => {
79
- state.gameLoopInterval = gameLoop;
80
- state.pipeSpawnInterval = pipeSpawn;
81
- state.timerInterval = timer;
82
- });
83
-
84
- // Spawn first pipe immediately
85
- setTimeout(() => get().spawnPipe(settings), 500);
86
- },
87
- stopGame: () => {
88
- const state = get();
89
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
90
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
91
- if (state.timerInterval) clearInterval(state.timerInterval);
92
-
93
- // Reset the game instead of showing game over modal
94
- state.initializeGame();
95
- },
96
- resetGame: () => {
97
- const state = get();
98
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
99
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
100
- if (state.timerInterval) clearInterval(state.timerInterval);
101
- set(state => {
102
- state.isPlaying = false;
103
- state.isGameOver = false;
104
- state.score = 0;
105
- state.survivalTime = 0;
106
- state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;
107
- state.birdVelocity = 0;
108
- state.pipes = [];
109
- state.collisionBlasts = [];
110
- state.gameLoopInterval = null;
111
- state.pipeSpawnInterval = null;
112
- state.timerInterval = null;
113
- });
114
- },
115
- jump: () => {
116
- const state = get();
117
- if (!state.isPlaying || state.isGameOver) return;
118
- set(state => {
119
- state.birdVelocity = FLAPPY_BIRD_GAME_CONFIG.JUMP_VELOCITY;
120
- });
121
- },
122
- updatePhysics: settings => {
123
- const state = get();
124
- if (!state.isPlaying || state.isGameOver) return;
125
- const config = DIFFICULTY_CONFIG[settings.difficulty];
126
- const {
127
- GAME_HEIGHT,
128
- GRAVITY,
129
- BIRD_SIZE,
130
- MAX_FALL_SPEED,
131
- VELOCITY_DAMPING
132
- } = FLAPPY_BIRD_GAME_CONFIG;
133
- const offset = settings.offset ?? 0;
134
- const topWallHeight = BASE_BRICK_WALL_HEIGHT + offset;
135
- const bottomWallHeight = offset > 0 ? 150 : 250; // Dynamic bottom wall height
136
- const bottomWallTop = GAME_HEIGHT - bottomWallHeight; // Bottom wall at screen bottom
137
-
138
- let topWallCollision = false;
139
- let bottomWallCollision = false;
140
- set(draftState => {
141
- // Update bird physics with damping for smoother movement
142
- draftState.birdVelocity += GRAVITY;
143
- draftState.birdVelocity *= VELOCITY_DAMPING;
144
-
145
- // Cap maximum fall speed for more control
146
- if (draftState.birdVelocity > MAX_FALL_SPEED) {
147
- draftState.birdVelocity = MAX_FALL_SPEED;
148
- }
149
- draftState.birdY += draftState.birdVelocity;
150
-
151
- // Update pipes
152
- for (let i = draftState.pipes.length - 1; i >= 0; i--) {
153
- const pipe = draftState.pipes[i];
154
- if (!pipe) continue;
155
- pipe.x -= config.pipeSpeed;
156
-
157
- // Check if bird passed pipe
158
- if (!pipe.passed && pipe.x + FLAPPY_BIRD_GAME_CONFIG.PIPE_WIDTH < FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X) {
159
- pipe.passed = true;
160
- draftState.score += 1;
161
- }
162
-
163
- // Remove off-screen pipes
164
- if (pipe.x + FLAPPY_BIRD_GAME_CONFIG.PIPE_WIDTH < 0) {
165
- draftState.pipes.splice(i, 1);
166
- }
167
- }
168
-
169
- // Check boundaries - top wall adjusted by offset
170
- // Top brick wall collision (with offset)
171
- if (draftState.birdY < topWallHeight) {
172
- draftState.birdY = topWallHeight;
173
- draftState.birdVelocity = 0;
174
- draftState.isGameOver = true;
175
- draftState.isPlaying = false;
176
- topWallCollision = true;
177
- }
178
-
179
- // Bottom wall collision (150px wall at ground)
180
- if (draftState.birdY + BIRD_SIZE > bottomWallTop) {
181
- draftState.birdY = bottomWallTop - BIRD_SIZE;
182
- draftState.isGameOver = true;
183
- draftState.isPlaying = false;
184
- bottomWallCollision = true;
185
- }
186
- });
187
-
188
- // Add collision blasts after state update
189
- if (topWallCollision) {
190
- const blastX = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X + BIRD_SIZE / 2;
191
- const blastY = topWallHeight + BIRD_SIZE / 2;
192
- get().addCollisionBlast(blastX, blastY);
193
- // Clear intervals but don't reset game (modal will show)
194
- const state = get();
195
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
196
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
197
- if (state.timerInterval) clearInterval(state.timerInterval);
198
- }
199
- if (bottomWallCollision) {
200
- const blastX = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X + BIRD_SIZE / 2;
201
- const blastY = bottomWallTop - BIRD_SIZE / 2;
202
- get().addCollisionBlast(blastX, blastY);
203
- // Clear intervals but don't reset game (modal will show)
204
- const state = get();
205
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
206
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
207
- if (state.timerInterval) clearInterval(state.timerInterval);
208
- }
209
-
210
- // Check collision with pipes
211
- if (get().checkCollision()) {
212
- // Clear intervals but don't reset game (modal will show)
213
- const state = get();
214
- if (state.gameLoopInterval) clearInterval(state.gameLoopInterval);
215
- if (state.pipeSpawnInterval) clearInterval(state.pipeSpawnInterval);
216
- if (state.timerInterval) clearInterval(state.timerInterval);
217
- }
218
- },
219
- spawnPipe: settings => {
220
- const state = get();
221
- if (!state.isPlaying || state.isGameOver) return;
222
- const config = DIFFICULTY_CONFIG[settings.difficulty];
223
- const offset = settings.offset ?? 0;
224
- const topHeight = generateRandomPipeHeight(offset);
225
- const bottomY = topHeight + config.pipeGap;
226
- const pipe = {
227
- id: `pipe-${Date.now()}-${Math.random()}`,
228
- x: FLAPPY_BIRD_GAME_CONFIG.GAME_WIDTH,
229
- topHeight,
230
- bottomY,
231
- passed: false
232
- };
233
- set(state => {
234
- state.pipes.push(pipe);
235
- });
236
- },
237
- checkCollision: () => {
238
- const state = get();
239
- const {
240
- BIRD_START_X,
241
- BIRD_SIZE,
242
- PIPE_WIDTH
243
- } = FLAPPY_BIRD_GAME_CONFIG;
244
- const birdLeft = BIRD_START_X;
245
- const birdRight = BIRD_START_X + BIRD_SIZE;
246
- const birdTop = state.birdY;
247
- const birdBottom = state.birdY + BIRD_SIZE;
248
- const birdCenterX = BIRD_START_X + BIRD_SIZE / 2;
249
- const birdCenterY = state.birdY + BIRD_SIZE / 2;
250
- for (const pipe of state.pipes) {
251
- const pipeLeft = pipe.x;
252
- const pipeRight = pipe.x + PIPE_WIDTH;
253
-
254
- // Check if bird is in pipe's horizontal range
255
- if (birdRight > pipeLeft && birdLeft < pipeRight) {
256
- // Check collision with top pipe
257
- if (birdTop < pipe.topHeight) {
258
- get().addCollisionBlast(birdCenterX, birdCenterY);
259
- set(state => {
260
- state.isGameOver = true;
261
- state.isPlaying = false;
262
- });
263
- return true;
264
- }
265
- // Check collision with bottom pipe
266
- if (birdBottom > pipe.bottomY) {
267
- get().addCollisionBlast(birdCenterX, birdCenterY);
268
- set(state => {
269
- state.isGameOver = true;
270
- state.isPlaying = false;
271
- });
272
- return true;
273
- }
274
- }
275
- }
276
- return false;
277
- },
278
- addCollisionBlast: (x, y) => {
279
- set(state => {
280
- state.collisionBlasts.push({
281
- id: `blast-${Date.now()}-${Math.random()}`,
282
- x,
283
- y
284
- });
285
- });
286
- },
287
- removeCollisionBlast: id => {
288
- set(state => {
289
- state.collisionBlasts = state.collisionBlasts.filter(blast => blast.id !== id);
290
- });
291
- }
292
- }))));
293
- export const useIsPlaying = () => useFlappyBirdStore(state => state.isPlaying);
294
- export const useIsGameOver = () => useFlappyBirdStore(state => state.isGameOver);
295
- export const useScore = () => useFlappyBirdStore(state => state.score);
296
- export const useSurvivalTime = () => useFlappyBirdStore(state => state.survivalTime);
297
- export const useBirdY = () => useFlappyBirdStore(state => state.birdY);
298
- export const usePipes = () => useFlappyBirdStore(state => state.pipes);
299
- export const useCollisionBlasts = () => useFlappyBirdStore(state => state.collisionBlasts);
300
- //# sourceMappingURL=FlappyBirdStore.js.map
1
+ "use strict";import{create}from 'zustand';import{subscribeWithSelector}from 'zustand/middleware';import{immerMiddleware}from "../../services/UtilsService.js";import{FLAPPY_BIRD_GAME_CONFIG,DIFFICULTY_CONFIG}from "./FlappyBirdConstants.js";const BASE_BRICK_WALL_HEIGHT = 150;const generateRandomPipeHeight =(offset = 0)=>{const{MIN_PIPE_HEIGHT,GAME_HEIGHT}= FLAPPY_BIRD_GAME_CONFIG;const topWallHeight = BASE_BRICK_WALL_HEIGHT + offset;const bottomWallHeight = offset > 0 ? 150:250;const playableHeight = GAME_HEIGHT - topWallHeight - bottomWallHeight;const minHeight = topWallHeight + MIN_PIPE_HEIGHT;const maxHeight = topWallHeight + playableHeight * 0.6;return minHeight + Math.random()*(maxHeight - minHeight);};export const useFlappyBirdStore = create()(subscribeWithSelector(immerMiddleware((set,get)=>({isPlaying:false,isGameOver:false,score:0,survivalTime:0,birdY:FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y,birdVelocity:0,pipes:[],collisionBlasts:[],gameLoopInterval:null,pipeSpawnInterval:null,timerInterval:null,initializeGame:()=>{set(state =>{state.isPlaying = false;state.isGameOver = false;state.score = 0;state.survivalTime = 0;state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;state.birdVelocity = 0;state.pipes = [];state.collisionBlasts = [];});},startGame:settings =>{const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);set(state =>{state.isPlaying = true;state.isGameOver = false;state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;state.birdVelocity = 0;state.pipes = [];state.score = 0;state.survivalTime = 0;});const gameLoop = setInterval(()=>{get().updatePhysics(settings);},1000 / 60);const pipeSpawn = setInterval(()=>{get().spawnPipe(settings);},FLAPPY_BIRD_GAME_CONFIG.PIPE_SPAWN_INTERVAL);const timer = setInterval(()=>{set(state =>{state.survivalTime += 1;});},1000);set(state =>{state.gameLoopInterval = gameLoop;state.pipeSpawnInterval = pipeSpawn;state.timerInterval = timer;});setTimeout(()=> get().spawnPipe(settings),500);},stopGame:()=>{const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);state.initializeGame();},resetGame:()=>{const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);set(state =>{state.isPlaying = false;state.isGameOver = false;state.score = 0;state.survivalTime = 0;state.birdY = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_Y;state.birdVelocity = 0;state.pipes = [];state.collisionBlasts = [];state.gameLoopInterval = null;state.pipeSpawnInterval = null;state.timerInterval = null;});},jump:()=>{const state = get();if(!state.isPlaying || state.isGameOver)return;set(state =>{state.birdVelocity = FLAPPY_BIRD_GAME_CONFIG.JUMP_VELOCITY;});},updatePhysics:settings =>{const state = get();if(!state.isPlaying || state.isGameOver)return;const config = DIFFICULTY_CONFIG[settings.difficulty];const{GAME_HEIGHT,GRAVITY,BIRD_SIZE,MAX_FALL_SPEED,VELOCITY_DAMPING}= FLAPPY_BIRD_GAME_CONFIG;const offset = settings.offset ?? 0;const topWallHeight = BASE_BRICK_WALL_HEIGHT + offset;const bottomWallHeight = offset > 0 ? 150:250;const bottomWallTop = GAME_HEIGHT - bottomWallHeight;let topWallCollision = false;let bottomWallCollision = false;set(draftState =>{draftState.birdVelocity += GRAVITY;draftState.birdVelocity *= VELOCITY_DAMPING;if(draftState.birdVelocity > MAX_FALL_SPEED){draftState.birdVelocity = MAX_FALL_SPEED;}draftState.birdY += draftState.birdVelocity;for(let i = draftState.pipes.length - 1;i >= 0;i--){const pipe = draftState.pipes[i];if(!pipe)continue;pipe.x -= config.pipeSpeed;if(!pipe.passed && pipe.x + FLAPPY_BIRD_GAME_CONFIG.PIPE_WIDTH < FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X){pipe.passed = true;draftState.score += 1;}if(pipe.x + FLAPPY_BIRD_GAME_CONFIG.PIPE_WIDTH < 0){draftState.pipes.splice(i,1);}}if(draftState.birdY < topWallHeight){draftState.birdY = topWallHeight;draftState.birdVelocity = 0;draftState.isGameOver = true;draftState.isPlaying = false;topWallCollision = true;}if(draftState.birdY + BIRD_SIZE > bottomWallTop){draftState.birdY = bottomWallTop - BIRD_SIZE;draftState.isGameOver = true;draftState.isPlaying = false;bottomWallCollision = true;}});if(topWallCollision){const blastX = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X + BIRD_SIZE / 2;const blastY = topWallHeight + BIRD_SIZE / 2;get().addCollisionBlast(blastX,blastY);const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);}if(bottomWallCollision){const blastX = FLAPPY_BIRD_GAME_CONFIG.BIRD_START_X + BIRD_SIZE / 2;const blastY = bottomWallTop - BIRD_SIZE / 2;get().addCollisionBlast(blastX,blastY);const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);}if(get().checkCollision()){const state = get();if(state.gameLoopInterval)clearInterval(state.gameLoopInterval);if(state.pipeSpawnInterval)clearInterval(state.pipeSpawnInterval);if(state.timerInterval)clearInterval(state.timerInterval);}},spawnPipe:settings =>{const state = get();if(!state.isPlaying || state.isGameOver)return;const config = DIFFICULTY_CONFIG[settings.difficulty];const offset = settings.offset ?? 0;const topHeight = generateRandomPipeHeight(offset);const bottomY = topHeight + config.pipeGap;const pipe ={id:`pipe-${Date.now()}-${Math.random()}`,x:FLAPPY_BIRD_GAME_CONFIG.GAME_WIDTH,topHeight,bottomY,passed:false};set(state =>{state.pipes.push(pipe);});},checkCollision:()=>{const state = get();const{BIRD_START_X,BIRD_SIZE,PIPE_WIDTH}= FLAPPY_BIRD_GAME_CONFIG;const birdLeft = BIRD_START_X;const birdRight = BIRD_START_X + BIRD_SIZE;const birdTop = state.birdY;const birdBottom = state.birdY + BIRD_SIZE;const birdCenterX = BIRD_START_X + BIRD_SIZE / 2;const birdCenterY = state.birdY + BIRD_SIZE / 2;for(const pipe of state.pipes){const pipeLeft = pipe.x;const pipeRight = pipe.x + PIPE_WIDTH;if(birdRight > pipeLeft && birdLeft < pipeRight){if(birdTop < pipe.topHeight){get().addCollisionBlast(birdCenterX,birdCenterY);set(state =>{state.isGameOver = true;state.isPlaying = false;});return true;}if(birdBottom > pipe.bottomY){get().addCollisionBlast(birdCenterX,birdCenterY);set(state =>{state.isGameOver = true;state.isPlaying = false;});return true;}}}return false;},addCollisionBlast:(x,y)=>{set(state =>{state.collisionBlasts.push({id:`blast-${Date.now()}-${Math.random()}`,x,y});});},removeCollisionBlast:id =>{set(state =>{state.collisionBlasts = state.collisionBlasts.filter(blast => blast.id !== id);});}}))));export const useIsPlaying =()=> useFlappyBirdStore(state => state.isPlaying);export const useIsGameOver =()=> useFlappyBirdStore(state => state.isGameOver);export const useScore =()=> useFlappyBirdStore(state => state.score);export const useSurvivalTime =()=> useFlappyBirdStore(state => state.survivalTime);export const useBirdY =()=> useFlappyBirdStore(state => state.birdY);export const usePipes =()=> useFlappyBirdStore(state => state.pipes);export const useCollisionBlasts =()=> useFlappyBirdStore(state => state.collisionBlasts);
@@ -1,87 +1 @@
1
- "use strict";
2
-
3
- import React from 'react';
4
- import Animated, { useAnimatedStyle, interpolate, Extrapolate } from 'react-native-reanimated';
5
- import { Canvas, Circle, Group } from '@shopify/react-native-skia';
6
- import { FLAPPY_BIRD_GAME_CONFIG, FLAPPY_BIRD_COLORS } from "../FlappyBirdConstants.js";
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
- const {
9
- BIRD_SIZE
10
- } = FLAPPY_BIRD_GAME_CONFIG;
11
-
12
- // Define styles outside component to prevent re-creation
13
- const birdContainerStyle = {
14
- position: 'absolute',
15
- width: BIRD_SIZE,
16
- height: BIRD_SIZE
17
- };
18
- const canvasStyle = {
19
- width: BIRD_SIZE,
20
- height: BIRD_SIZE
21
- };
22
- export const Bird = /*#__PURE__*/React.memo(({
23
- birdY,
24
- velocity
25
- }) => {
26
- const {
27
- BIRD_START_X
28
- } = FLAPPY_BIRD_GAME_CONFIG;
29
-
30
- // Use derived value instead of useEffect (PERFORMANCE OPTIMIZATION)
31
- const animatedStyle = useAnimatedStyle(() => {
32
- 'worklet';
33
-
34
- const targetRotation = interpolate(velocity, [-15, 15], [-30, 90], Extrapolate.CLAMP);
35
- return {
36
- transform: [{
37
- translateX: BIRD_START_X
38
- }, {
39
- translateY: birdY
40
- }, {
41
- rotate: `${targetRotation}deg`
42
- }]
43
- };
44
- }, [birdY, velocity]);
45
- return /*#__PURE__*/_jsx(Animated.View, {
46
- style: [birdContainerStyle, animatedStyle],
47
- children: /*#__PURE__*/_jsx(Canvas, {
48
- style: canvasStyle,
49
- children: /*#__PURE__*/_jsxs(Group, {
50
- children: [/*#__PURE__*/_jsx(Circle, {
51
- cx: BIRD_SIZE / 2,
52
- cy: BIRD_SIZE / 2,
53
- r: BIRD_SIZE / 2,
54
- color: FLAPPY_BIRD_COLORS.BIRD_YELLOW
55
- }), /*#__PURE__*/_jsx(Circle, {
56
- cx: BIRD_SIZE / 2,
57
- cy: BIRD_SIZE / 2 + 5,
58
- r: BIRD_SIZE / 3,
59
- color: FLAPPY_BIRD_COLORS.BIRD_ORANGE
60
- }), /*#__PURE__*/_jsx(Circle, {
61
- cx: BIRD_SIZE / 2 + 8,
62
- cy: BIRD_SIZE / 2 - 5,
63
- r: 4,
64
- color: "#FFFFFF"
65
- }), /*#__PURE__*/_jsx(Circle, {
66
- cx: BIRD_SIZE / 2 + 8,
67
- cy: BIRD_SIZE / 2 - 5,
68
- r: 2,
69
- color: "#000000"
70
- }), /*#__PURE__*/_jsx(Circle, {
71
- cx: BIRD_SIZE / 2 + 15,
72
- cy: BIRD_SIZE / 2,
73
- r: 5,
74
- color: "#FF8C00"
75
- }), /*#__PURE__*/_jsx(Circle, {
76
- cx: BIRD_SIZE / 2 - 5,
77
- cy: BIRD_SIZE / 2 + 5,
78
- r: 10,
79
- color: FLAPPY_BIRD_COLORS.BIRD_ORANGE,
80
- opacity: 0.8
81
- })]
82
- })
83
- })
84
- });
85
- });
86
- Bird.displayName = 'Bird';
87
- //# sourceMappingURL=Bird.js.map
1
+ "use strict";import React from 'react';import Animated,{useAnimatedStyle,interpolate,Extrapolate}from 'react-native-reanimated';import{Canvas,Circle,Group}from '@shopify/react-native-skia';import{FLAPPY_BIRD_GAME_CONFIG,FLAPPY_BIRD_COLORS}from "../FlappyBirdConstants.js";import{jsx as _jsx,jsxs as _jsxs}from "react/jsx-runtime";const{BIRD_SIZE}= FLAPPY_BIRD_GAME_CONFIG;const birdContainerStyle ={position:'absolute',width:BIRD_SIZE,height:BIRD_SIZE};const canvasStyle ={width:BIRD_SIZE,height:BIRD_SIZE};export const Bird = React.memo(({birdY,velocity})=>{const{BIRD_START_X}= FLAPPY_BIRD_GAME_CONFIG;const animatedStyle = useAnimatedStyle(()=>{'worklet';const targetRotation = interpolate(velocity,[-15,15],[-30,90],Extrapolate.CLAMP);return{transform:[{translateX:BIRD_START_X},{translateY:birdY},{rotate:`${targetRotation}deg`}]};},[birdY,velocity]);return _jsx(Animated.View,{style:[birdContainerStyle,animatedStyle],children:_jsx(Canvas,{style:canvasStyle,children:_jsxs(Group,{children:[_jsx(Circle,{cx:BIRD_SIZE / 2,cy:BIRD_SIZE / 2,r:BIRD_SIZE / 2,color:FLAPPY_BIRD_COLORS.BIRD_YELLOW}),_jsx(Circle,{cx:BIRD_SIZE / 2,cy:BIRD_SIZE / 2 + 5,r:BIRD_SIZE / 3,color:FLAPPY_BIRD_COLORS.BIRD_ORANGE}),_jsx(Circle,{cx:BIRD_SIZE / 2 + 8,cy:BIRD_SIZE / 2 - 5,r:4,color:"#FFFFFF"}),_jsx(Circle,{cx:BIRD_SIZE / 2 + 8,cy:BIRD_SIZE / 2 - 5,r:2,color:"#000000"}),_jsx(Circle,{cx:BIRD_SIZE / 2 + 15,cy:BIRD_SIZE / 2,r:5,color:"#FF8C00"}),_jsx(Circle,{cx:BIRD_SIZE / 2 - 5,cy:BIRD_SIZE / 2 + 5,r:10,color:FLAPPY_BIRD_COLORS.BIRD_ORANGE,opacity:0.8})]})})});});Bird.displayName = 'Bird';
@@ -1,87 +1 @@
1
- "use strict";
2
-
3
- import React, { useCallback, useEffect, useRef } from 'react';
4
- import { View, StyleSheet, TouchableOpacity } from 'react-native';
5
- import { GestureHandlerRootView } from 'react-native-gesture-handler';
6
- import { usePipes, useFlappyBirdStore, useCollisionBlasts } from "../FlappyBirdStore.js";
7
- import { Bird } from "./Bird.js";
8
- import { Pipes } from "./Pipes.js";
9
- import { ParticleBlast } from "../../../helpers/index.js";
10
- import { playSound, GAME_SOUNDS } from "../../../services/SoundsService.js";
11
- import { playHaptic, HapticType } from "../../../services/HapticsService.js";
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- // Constant particle colors - defined outside component to prevent re-creation
14
- const PARTICLE_COLORS = ['#FFD700', '#FF8C00', '#FF6B6B', '#FF4757', '#FFA500', '#FF6347'];
15
- export const GameArea = /*#__PURE__*/React.memo(({
16
- settings
17
- }) => {
18
- const birdY = useFlappyBirdStore(state => state.birdY);
19
- const birdVelocity = useFlappyBirdStore(state => state.birdVelocity);
20
- const isPlaying = useFlappyBirdStore(state => state.isPlaying);
21
- const score = useFlappyBirdStore(state => state.score);
22
- const pipes = usePipes();
23
- const collisionBlasts = useCollisionBlasts();
24
-
25
- // Stable references - don't change on re-renders
26
- const jump = useFlappyBirdStore(state => state.jump);
27
- const removeCollisionBlast = useFlappyBirdStore(state => state.removeCollisionBlast);
28
- const prevScoreRef = useRef(0);
29
-
30
- // Play sound when score increases (bird passes through pipe)
31
- useEffect(() => {
32
- if (score > prevScoreRef.current && isPlaying) {
33
- playSound(GAME_SOUNDS.FLAPPY_BIRD.SCORE, settings.enableSounds);
34
- playHaptic(HapticType.LIGHT, settings.enableHaptics);
35
- }
36
- prevScoreRef.current = score;
37
- }, [score, isPlaying, settings.enableSounds, settings.enableHaptics]);
38
- const handleTap = useCallback(() => {
39
- if (!isPlaying) return;
40
- jump();
41
- playSound(GAME_SOUNDS.FLAPPY_BIRD.FLAP, settings.enableSounds);
42
- playHaptic(HapticType.LIGHT, settings.enableHaptics);
43
- }, [isPlaying, jump, settings.enableSounds, settings.enableHaptics]);
44
-
45
- // Memoize particle blast callback to prevent re-creating on every render
46
- const handleBlastComplete = useCallback(id => {
47
- removeCollisionBlast(id);
48
- }, [removeCollisionBlast]);
49
- return /*#__PURE__*/_jsx(View, {
50
- style: styles.container,
51
- children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
52
- children: /*#__PURE__*/_jsx(TouchableOpacity, {
53
- style: styles.container,
54
- activeOpacity: 1,
55
- onPress: handleTap,
56
- children: /*#__PURE__*/_jsxs(View, {
57
- style: styles.gameContainer,
58
- children: [/*#__PURE__*/_jsx(Pipes, {
59
- pipes: pipes,
60
- offset: settings.offset ?? 0
61
- }), /*#__PURE__*/_jsx(Bird, {
62
- birdY: birdY,
63
- velocity: birdVelocity
64
- }), collisionBlasts.map(blast => /*#__PURE__*/_jsx(ParticleBlast, {
65
- x: blast.x,
66
- y: blast.y,
67
- particleCount: 12,
68
- colors: PARTICLE_COLORS,
69
- duration: 800,
70
- onComplete: () => handleBlastComplete(blast.id)
71
- }, blast.id))]
72
- })
73
- })
74
- })
75
- });
76
- });
77
- const styles = StyleSheet.create({
78
- container: {
79
- flex: 1
80
- },
81
- gameContainer: {
82
- flex: 1,
83
- position: 'relative'
84
- }
85
- });
86
- GameArea.displayName = 'GameArea';
87
- //# sourceMappingURL=GameArea.js.map
1
+ "use strict";import React,{useCallback,useEffect,useRef}from 'react';import{View,StyleSheet,TouchableOpacity}from 'react-native';import{GestureHandlerRootView}from 'react-native-gesture-handler';import{usePipes,useFlappyBirdStore,useCollisionBlasts}from "../FlappyBirdStore.js";import{Bird}from "./Bird.js";import{Pipes}from "./Pipes.js";import{ParticleBlast}from "../../../helpers/index.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 PARTICLE_COLORS = ['#FFD700','#FF8C00','#FF6B6B','#FF4757','#FFA500','#FF6347'];export const GameArea = React.memo(({settings})=>{const birdY = useFlappyBirdStore(state => state.birdY);const birdVelocity = useFlappyBirdStore(state => state.birdVelocity);const isPlaying = useFlappyBirdStore(state => state.isPlaying);const score = useFlappyBirdStore(state => state.score);const pipes = usePipes();const collisionBlasts = useCollisionBlasts();const jump = useFlappyBirdStore(state => state.jump);const removeCollisionBlast = useFlappyBirdStore(state => state.removeCollisionBlast);const prevScoreRef = useRef(0);useEffect(()=>{if(score > prevScoreRef.current && isPlaying){playSound(GAME_SOUNDS.FLAPPY_BIRD.SCORE,settings.enableSounds);playHaptic(HapticType.LIGHT,settings.enableHaptics);}prevScoreRef.current = score;},[score,isPlaying,settings.enableSounds,settings.enableHaptics]);const handleTap = useCallback(()=>{if(!isPlaying)return;jump();playSound(GAME_SOUNDS.FLAPPY_BIRD.FLAP,settings.enableSounds);playHaptic(HapticType.LIGHT,settings.enableHaptics);},[isPlaying,jump,settings.enableSounds,settings.enableHaptics]);const handleBlastComplete = useCallback(id =>{removeCollisionBlast(id);},[removeCollisionBlast]);return _jsx(View,{style:styles.container,children:_jsx(GestureHandlerRootView,{children:_jsx(TouchableOpacity,{style:styles.container,activeOpacity:1,onPress:handleTap,children:_jsxs(View,{style:styles.gameContainer,children:[_jsx(Pipes,{pipes:pipes,offset:settings.offset ?? 0}),_jsx(Bird,{birdY:birdY,velocity:birdVelocity}),collisionBlasts.map(blast => _jsx(ParticleBlast,{x:blast.x,y:blast.y,particleCount:12,colors:PARTICLE_COLORS,duration:800,onComplete:()=> handleBlastComplete(blast.id)},blast.id))]})})})});});const styles = StyleSheet.create({container:{flex:1},gameContainer:{flex:1,position:'relative'}});GameArea.displayName = 'GameArea';