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,182 +1 @@
1
- "use strict";
2
-
3
- // Balloon Blaster Game Constants
4
- export const BALLOON_BLASTER_GAME_CONFIG = {
5
- GAME_DURATION: 60,
6
- // seconds
7
- MAX_LIVES: 3,
8
- BALLOON_SPAWN_INTERVAL: 800,
9
- // ms - much faster balloon spawning
10
- BALLOON_RISE_SPEED: 0.08,
11
- // pixels per frame - balloons rise from bottom to top (slightly faster)
12
- GRAVITY: -0.003,
13
- // negative gravity for upward movement (slightly stronger)
14
- INITIAL_VELOCITY_Y: -0.2,
15
- // negative for upward movement (slower rise from bottom)
16
- INITIAL_VELOCITY_X_RANGE: 0.3,
17
- // horizontal velocity range (increased for better spread across screen)
18
- ROTATION_SPEED_RANGE: 0.02,
19
- // realistic balloon rotation speed (reduced from 0.2 for more natural movement)
20
- BALLOON_SIZE: 60,
21
- SLICE_TRAIL_LENGTH: 10,
22
- COMBO_TIMEOUT: 2000,
23
- // ms
24
- PARTICLE_COUNT: 4,
25
- // Reduced from 8 to 4 for better performance
26
- PARTICLE_LIFETIME: 600 // Reduced from 1000ms to 600ms for faster cleanup
27
- };
28
- export const BALLOON_BLASTER_ANIMATION_CONFIG = {
29
- BALLOON_SPRING: {
30
- damping: 30,
31
- stiffness: 50
32
- },
33
- POP_SPRING: {
34
- damping: 20,
35
- stiffness: 300
36
- },
37
- PARTICLE_SPRING: {
38
- damping: 25,
39
- stiffness: 400
40
- },
41
- SLICE_TIMING: {
42
- duration: 200
43
- }
44
- };
45
- export const BALLOON_BLASTER_COLORS = {
46
- BACKGROUND: '#87CEEB',
47
- // Sky blue
48
- SCORE_BOARD: '#4169E1',
49
- SLICE_TRAIL: '#FFD700',
50
- PARTICLE_COLORS: ['#FF6B6B', '#4ECDC4', '#45B7D1', '#96CEB4', '#FFEAA7', '#DDA0DD'],
51
- COMBO_TEXT: '#FF4757',
52
- LIVES_COLOR: '#FF6B6B',
53
- PARTICLE_GLOW: 'rgba(255,255,255,0.9)',
54
- SCORE: '#FFFFFF',
55
- UI: '#FF6347',
56
- BUTTON_ACTIVE: '#FF7F50',
57
- BUTTON_INACTIVE: '#FFA07A',
58
- TEXT_PRIMARY: '#FFFFFF',
59
- TEXT_SECONDARY: '#F0F8FF',
60
- WHITE: '#FFFFFF',
61
- START_BUTTON: '#4CAF50',
62
- GAME_OVER_OVERLAY: 'rgba(0, 0, 0, 0.85)'
63
- };
64
-
65
- // Balloon types and their properties
66
- export const BALLOON_TYPES = [{
67
- emoji: '🎈',
68
- points: 10,
69
- name: 'red balloon',
70
- color: '#FF0040',
71
- gradient: ['#FF0040', '#FF4080']
72
- }, {
73
- emoji: '🎈',
74
- points: 10,
75
- name: 'blue balloon',
76
- color: '#0080FF',
77
- gradient: ['#0080FF', '#40A0FF']
78
- }, {
79
- emoji: '🎈',
80
- points: 15,
81
- name: 'yellow balloon',
82
- color: '#FFD700',
83
- gradient: ['#FFD700', '#FFEB3B']
84
- }, {
85
- emoji: '🎈',
86
- points: 20,
87
- name: 'green balloon',
88
- color: '#00FF80',
89
- gradient: ['#00FF80', '#40FFA0']
90
- }, {
91
- emoji: '🎈',
92
- points: 25,
93
- name: 'purple balloon',
94
- color: '#8000FF',
95
- gradient: ['#8000FF', '#A040FF']
96
- }, {
97
- emoji: '🎈',
98
- points: 15,
99
- name: 'pink balloon',
100
- color: '#FF0080',
101
- gradient: ['#FF0080', '#FF40A0']
102
- }, {
103
- emoji: '🎈',
104
- points: 30,
105
- name: 'orange balloon',
106
- color: '#FF4000',
107
- gradient: ['#FF4000', '#FF8040']
108
- }, {
109
- emoji: '🎈',
110
- points: 25,
111
- name: 'cyan balloon',
112
- color: '#00FFFF',
113
- gradient: ['#00FFFF', '#40FFFF']
114
- }, {
115
- emoji: '🎈',
116
- points: 35,
117
- name: 'magenta balloon',
118
- color: '#FF00FF',
119
- gradient: ['#FF00FF', '#FF40FF']
120
- }, {
121
- emoji: '🎈',
122
- points: 40,
123
- name: 'gold balloon',
124
- color: '#FFB000',
125
- gradient: ['#FFB000', '#FFD700']
126
- }, {
127
- emoji: '🎈',
128
- points: 45,
129
- name: 'rainbow balloon',
130
- color: '#FF0080',
131
- gradient: ['#FF0080', '#8000FF', '#0080FF', '#00FF80']
132
- }, {
133
- emoji: '🎈',
134
- points: 50,
135
- name: 'neon balloon',
136
- color: '#00FF00',
137
- gradient: ['#00FF00', '#FFFF00']
138
- }];
139
- export const BALLOON_SPECIAL_ITEMS = [{
140
- emoji: '💣',
141
- points: -50,
142
- name: 'bomb',
143
- isBomb: true,
144
- color: '#FF4444'
145
- }, {
146
- emoji: '⭐',
147
- points: 50,
148
- name: 'star',
149
- isBonus: true,
150
- color: '#FFD700'
151
- }];
152
-
153
- // Balloon Blaster Game Theme - Matches scoreboard blue
154
- export const BALLOON_BLASTER_THEME = {
155
- backgroundColor: '#87CEEB',
156
- // Sky blue background
157
- headerBackgroundColor: 'rgba(59, 130, 246, 0.9)',
158
- // Blue header to match scoreboard
159
- headerTextColor: '#ffffff',
160
- sectionBackgroundColor: 'rgba(59, 130, 246, 0.4)',
161
- // Match scoreboard transparency
162
- sectionTitleColor: '#ffffff',
163
- // White text on blue sections
164
- buttonSelectedColor: '#3b82f6',
165
- // Match actual start button blue
166
- buttonUnselectedColor: 'rgba(255, 255, 255, 0.3)',
167
- buttonSelectedTextColor: '#ffffff',
168
- buttonUnselectedTextColor: '#1f2937',
169
- switchTrackColorFalse: 'rgba(59, 130, 246, 0.5)',
170
- switchTrackColorTrue: '#3b82f6',
171
- // Match actual start button blue
172
- switchThumbColor: '#ffffff',
173
- infoTextColor: '#1f2937' // Dark text for readability
174
- };
175
-
176
- // Balloon Blaster Difficulty Descriptions
177
- export const BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS = {
178
- easy: 'Balloons spawn slower, more forgiving',
179
- medium: 'Balanced gameplay and balloon speed',
180
- hard: 'Fast balloons, quick reflexes needed!'
181
- };
182
- //# sourceMappingURL=BalloonBlasterConstants.js.map
1
+ "use strict";export const BALLOON_BLASTER_GAME_CONFIG ={GAME_DURATION:120,MAX_LIVES:3,BALLOON_SPAWN_INTERVAL:800,BALLOON_RISE_SPEED:0.08,GRAVITY:-0.003,INITIAL_VELOCITY_Y:-0.2,INITIAL_VELOCITY_X_RANGE:0.3,ROTATION_SPEED_RANGE:0.02,BALLOON_SIZE:60,SLICE_TRAIL_LENGTH:10,COMBO_TIMEOUT:2000,PARTICLE_COUNT:4,PARTICLE_LIFETIME:600};export const BALLOON_BLASTER_ANIMATION_CONFIG ={BALLOON_SPRING:{damping:30,stiffness:50},POP_SPRING:{damping:20,stiffness:300},PARTICLE_SPRING:{damping:25,stiffness:400},SLICE_TIMING:{duration:200}};export const BALLOON_BLASTER_COLORS ={BACKGROUND:'#87CEEB',SCORE_BOARD:'#4169E1',SLICE_TRAIL:'#FFD700',PARTICLE_COLORS:['#FF6B6B','#4ECDC4','#45B7D1','#96CEB4','#FFEAA7','#DDA0DD'],COMBO_TEXT:'#FF4757',LIVES_COLOR:'#FF6B6B',PARTICLE_GLOW:'rgba(255,255,255,0.9)',SCORE:'#FFFFFF',UI:'#FF6347',BUTTON_ACTIVE:'#FF7F50',BUTTON_INACTIVE:'#FFA07A',TEXT_PRIMARY:'#FFFFFF',TEXT_SECONDARY:'#F0F8FF',WHITE:'#FFFFFF',START_BUTTON:'#4CAF50',GAME_OVER_OVERLAY:'rgba(0,0,0,0.85)'};export const BALLOON_TYPES = [{emoji:'🎈',points:10,name:'red balloon',color:'#FF0040',gradient:['#FF0040','#FF4080']},{emoji:'🎈',points:10,name:'blue balloon',color:'#0080FF',gradient:['#0080FF','#40A0FF']},{emoji:'🎈',points:15,name:'yellow balloon',color:'#FFD700',gradient:['#FFD700','#FFEB3B']},{emoji:'🎈',points:20,name:'green balloon',color:'#00FF80',gradient:['#00FF80','#40FFA0']},{emoji:'🎈',points:25,name:'purple balloon',color:'#8000FF',gradient:['#8000FF','#A040FF']},{emoji:'🎈',points:15,name:'pink balloon',color:'#FF0080',gradient:['#FF0080','#FF40A0']},{emoji:'🎈',points:30,name:'orange balloon',color:'#FF4000',gradient:['#FF4000','#FF8040']},{emoji:'🎈',points:25,name:'cyan balloon',color:'#00FFFF',gradient:['#00FFFF','#40FFFF']},{emoji:'🎈',points:35,name:'magenta balloon',color:'#FF00FF',gradient:['#FF00FF','#FF40FF']},{emoji:'🎈',points:40,name:'gold balloon',color:'#FFB000',gradient:['#FFB000','#FFD700']},{emoji:'🎈',points:45,name:'rainbow balloon',color:'#FF0080',gradient:['#FF0080','#8000FF','#0080FF','#00FF80']},{emoji:'🎈',points:50,name:'neon balloon',color:'#00FF00',gradient:['#00FF00','#FFFF00']}];export const BALLOON_SPECIAL_ITEMS = [{emoji:'💣',points:-50,name:'bomb',isBomb:true,color:'#FF4444'},{emoji:'⭐',points:50,name:'star',isBonus:true,color:'#FFD700'}];export const BALLOON_BLASTER_THEME ={backgroundColor:'rgba(0,0,0,0.7)',headerBackgroundColor:'#3b82f6',headerTextColor:'#ffffff',sectionBackgroundColor:'rgba(59,130,246,0.15)',sectionTitleColor:'#3b82f6',buttonSelectedColor:'#3b82f6',buttonUnselectedColor:'rgba(255,255,255,0.2)',buttonSelectedTextColor:'#ffffff',buttonUnselectedTextColor:'rgba(255,255,255,0.7)',switchTrackColorFalse:'rgba(59,130,246,0.3)',switchTrackColorTrue:'#3b82f6',switchThumbColor:'#ffffff',infoTextColor:'rgba(255,255,255,0.9)'};export const BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS ={easy:'Balloons spawn slower,more forgiving',medium:'Balanced gameplay and balloon speed',hard:'Fast balloons,quick reflexes needed!'};
@@ -1 +1 @@
1
- {"version":3,"names":["BALLOON_BLASTER_GAME_CONFIG","GAME_DURATION","MAX_LIVES","BALLOON_SPAWN_INTERVAL","BALLOON_RISE_SPEED","GRAVITY","INITIAL_VELOCITY_Y","INITIAL_VELOCITY_X_RANGE","ROTATION_SPEED_RANGE","BALLOON_SIZE","SLICE_TRAIL_LENGTH","COMBO_TIMEOUT","PARTICLE_COUNT","PARTICLE_LIFETIME","BALLOON_BLASTER_ANIMATION_CONFIG","BALLOON_SPRING","damping","stiffness","POP_SPRING","PARTICLE_SPRING","SLICE_TIMING","duration","BALLOON_BLASTER_COLORS","BACKGROUND","SCORE_BOARD","SLICE_TRAIL","PARTICLE_COLORS","COMBO_TEXT","LIVES_COLOR","PARTICLE_GLOW","SCORE","UI","BUTTON_ACTIVE","BUTTON_INACTIVE","TEXT_PRIMARY","TEXT_SECONDARY","WHITE","START_BUTTON","GAME_OVER_OVERLAY","BALLOON_TYPES","emoji","points","name","color","gradient","BALLOON_SPECIAL_ITEMS","isBomb","isBonus","BALLOON_BLASTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlasterConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,2BAA2B,GAAG;EACzCC,aAAa,EAAE,EAAE;EAAE;EACnBC,SAAS,EAAE,CAAC;EACZC,sBAAsB,EAAE,GAAG;EAAE;EAC7BC,kBAAkB,EAAE,IAAI;EAAE;EAC1BC,OAAO,EAAE,CAAC,KAAK;EAAE;EACjBC,kBAAkB,EAAE,CAAC,GAAG;EAAE;EAC1BC,wBAAwB,EAAE,GAAG;EAAE;EAC/BC,oBAAoB,EAAE,IAAI;EAAE;EAC5BC,YAAY,EAAE,EAAE;EAChBC,kBAAkB,EAAE,EAAE;EACtBC,aAAa,EAAE,IAAI;EAAE;EACrBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG,CAAC;AACzB,CAAU;AAEV,OAAO,MAAMC,gCAAgC,GAAG;EAC9CC,cAAc,EAAE;IACdC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDC,UAAU,EAAE;IACVF,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDE,eAAe,EAAE;IACfH,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDG,YAAY,EAAE;IACZC,QAAQ,EAAE;EACZ;AACF,CAAU;AAEV,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,UAAU,EAAE,SAAS;EAAE;EACvBC,WAAW,EAAE,SAAS;EACtBC,WAAW,EAAE,SAAS;EACtBC,eAAe,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC;EAC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AE;EAAEC,IAAI,EAAE,MAAM;EAAEI,MAAM,EAAE,IAAI;EAAEH,KAAK,EAAE;AAAU,CAAC,EAC1E;EAAEH,KAAK,EAAE,GAAG;EAAEC,MAAM,EAAE,EAAE;EAAEC,IAAI,EAAE,MAAM;EAAEK,OAAO,EAAE,IAAI;EAAEJ,KAAK,EAAE;AAAU,CAAC,CACjE;;AAEV;AACA,OAAO,MAAMK,qBAAwC,GAAG;EACtDC,eAAe,EAAE,SAAS;EAAE;EAC5BC,qBAAqB,EAAE,yBAAyB;EAAE;EAClDC,eAAe,EAAE,SAAS;EAC1BC,sBAAsB,EAAE,yBAAyB;EAAE;EACnDC,iBAAiB,EAAE,SAAS;EAAE;EAC9BC,mBAAmB,EAAE,SAAS;EAAE;EAChCC,qBAAqB,EAAE,0BAA0B;EACjDC,uBAAuB,EAAE,SAAS;EAClCC,yBAAyB,EAAE,SAAS;EACpCC,qBAAqB,EAAE,yBAAyB;EAChDC,oBAAoB,EAAE,SAAS;EAAE;EACjCC,gBAAgB,EAAE,SAAS;EAC3BC,aAAa,EAAE,SAAS,CAAE;AAC5B,CAAC;;AAED;AACA,OAAO,MAAMC,uCAAuC,GAAG;EACrDC,IAAI,EAAE,uCAAuC;EAC7CC,MAAM,EAAE,qCAAqC;EAC7CC,IAAI,EAAE;AACR,CAAU","ignoreList":[]}
1
+ {"version":3,"names":["BALLOON_BLASTER_GAME_CONFIG","GAME_DURATION","MAX_LIVES","BALLOON_SPAWN_INTERVAL","BALLOON_RISE_SPEED","GRAVITY","INITIAL_VELOCITY_Y","INITIAL_VELOCITY_X_RANGE","ROTATION_SPEED_RANGE","BALLOON_SIZE","SLICE_TRAIL_LENGTH","COMBO_TIMEOUT","PARTICLE_COUNT","PARTICLE_LIFETIME","BALLOON_BLASTER_ANIMATION_CONFIG","BALLOON_SPRING","damping","stiffness","POP_SPRING","PARTICLE_SPRING","SLICE_TIMING","duration","BALLOON_BLASTER_COLORS","BACKGROUND","SCORE_BOARD","SLICE_TRAIL","PARTICLE_COLORS","COMBO_TEXT","LIVES_COLOR","PARTICLE_GLOW","SCORE","UI","BUTTON_ACTIVE","BUTTON_INACTIVE","TEXT_PRIMARY","TEXT_SECONDARY","WHITE","START_BUTTON","GAME_OVER_OVERLAY","BALLOON_TYPES","emoji","points","name","color","gradient","BALLOON_SPECIAL_ITEMS","isBomb","isBonus","BALLOON_BLASTER_THEME","backgroundColor","headerBackgroundColor","headerTextColor","sectionBackgroundColor","sectionTitleColor","buttonSelectedColor","buttonUnselectedColor","buttonSelectedTextColor","buttonUnselectedTextColor","switchTrackColorFalse","switchTrackColorTrue","switchThumbColor","infoTextColor","BALLOON_BLASTER_DIFFICULTY_DESCRIPTIONS","easy","medium","hard"],"sourceRoot":"../../../../src","sources":["games/balloon-blaster/BalloonBlasterConstants.ts"],"mappings":";;AAEA;AACA,OAAO,MAAMA,2BAA2B,GAAG;EACzCC,aAAa,EAAE,GAAG;EAAE;EACpBC,SAAS,EAAE,CAAC;EACZC,sBAAsB,EAAE,GAAG;EAAE;EAC7BC,kBAAkB,EAAE,IAAI;EAAE;EAC1BC,OAAO,EAAE,CAAC,KAAK;EAAE;EACjBC,kBAAkB,EAAE,CAAC,GAAG;EAAE;EAC1BC,wBAAwB,EAAE,GAAG;EAAE;EAC/BC,oBAAoB,EAAE,IAAI;EAAE;EAC5BC,YAAY,EAAE,EAAE;EAChBC,kBAAkB,EAAE,EAAE;EACtBC,aAAa,EAAE,IAAI;EAAE;EACrBC,cAAc,EAAE,CAAC;EAAE;EACnBC,iBAAiB,EAAE,GAAG,CAAC;AACzB,CAAU;AAEV,OAAO,MAAMC,gCAAgC,GAAG;EAC9CC,cAAc,EAAE;IACdC,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDC,UAAU,EAAE;IACVF,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAAC;EACDE,eAAe,EAAE;IACfH,OAAO,EAAE,EAAE;IACXC,SAAS,EAAE;EACb,CAA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MATION_CONFIG as ANIMATION_CONFIG, BALLOON_BLASTER_COLORS as COLORS, BALLOON_TYPES, BALLOON_SPECIAL_ITEMS as SPECIAL_ITEMS } from "./BalloonBlasterConstants.js";
5
- const {
6
- width,
7
- height
8
- } = Dimensions.get('window');
9
-
10
- // Constants now imported from BalloonBlasterConstants.ts
11
- // Re-export for backward compatibility
12
- export { GAME_CONFIG, ANIMATION_CONFIG, COLORS, BALLOON_TYPES, SPECIAL_ITEMS };
13
-
14
- // Types
15
-
16
- export class BalloonBlasterService {
17
- gameTimerRef = null;
18
- balloonSpawnRef = null;
19
- animationRef = null;
20
- comboTimeoutRef = null;
21
- particles = [];
22
- constructor(balloonAnimations, particleAnimations) {
23
- this.balloonAnimations = balloonAnimations;
24
- this.particleAnimations = particleAnimations;
25
- }
26
- startGameTimer(onTick) {
27
- this.clearGameTimer();
28
- this.gameTimerRef = setInterval(onTick, 1000);
29
- }
30
- startBalloonSpawning(spawnBalloon, customSpawnInterval) {
31
- this.clearBalloonSpawn();
32
- const spawnInterval = customSpawnInterval || GAME_CONFIG.BALLOON_SPAWN_INTERVAL;
33
- const spawnLoop = () => {
34
- const balloon = this.createRandomBalloon();
35
- spawnBalloon(balloon);
36
-
37
- // Reduced random variation for more consistent spawning
38
- const randomVariation = (Math.random() - 0.5) * 150; // Further reduced for more consistent spawning
39
- const nextSpawnTime = spawnInterval + randomVariation;
40
- this.balloonSpawnRef = setTimeout(spawnLoop, Math.max(200, nextSpawnTime)); // Reduced minimum to 200ms for faster spawning
41
- };
42
-
43
- // Spawn initial balloons immediately for instant action
44
- for (let i = 0; i < 3; i++) {
45
- // 3 balloons for immediate start
46
- setTimeout(() => {
47
- const initialBalloon = this.createRandomBalloon();
48
- spawnBalloon(initialBalloon);
49
- }, i * 50); // Very fast stagger for immediate appearance
50
- }
51
-
52
- // Start continuous spawning loop immediately
53
- this.balloonSpawnRef = setTimeout(spawnLoop, 100); // Almost immediate continuous spawning
54
- }
55
- startPhysicsLoop(updateBalloon, removeBalloon, getBalloons) {
56
- let lastTime = performance.now();
57
- const targetFPS = 60;
58
- const targetFrameTime = 1000 / targetFPS;
59
- const updateLoop = currentTime => {
60
- const deltaTime = currentTime - lastTime;
61
-
62
- // Frame rate limiting - only update if enough time has passed
63
- if (deltaTime < targetFrameTime) {
64
- this.animationRef = requestAnimationFrame(updateLoop);
65
- return;
66
- }
67
- lastTime = currentTime;
68
- const deltaMultiplier = deltaTime / 16.67; // Normalize to 60fps baseline
69
-
70
- // Always update particles for smooth animation with delta time
71
- this.updateParticles(deltaMultiplier);
72
- const balloons = getBalloons();
73
-
74
- // Use for loop instead of forEach for better performance
75
- for (let i = 0; i < balloons.length; i++) {
76
- const balloon = balloons[i];
77
- if (!balloon || balloon.isPopped) continue;
78
-
79
- // Physics calculations with delta time
80
- const newVelocityY = balloon.velocity.y + GAME_CONFIG.GRAVITY * deltaMultiplier;
81
- let newX = balloon.position.x + balloon.velocity.x * deltaMultiplier;
82
- const newY = balloon.position.y + newVelocityY * deltaMultiplier;
83
- const newRotation = balloon.rotation + balloon.rotationSpeed * deltaMultiplier;
84
-
85
- // Remove balloons that float off screen (top only)
86
- if (newY < -100) {
87
- removeBalloon(balloon.id);
88
- continue;
89
- }
90
-
91
- // Remove balloons that go too far below screen (they should only move upward)
92
- if (newY > height + 100) {
93
- // Remove balloons that somehow drift too far down
94
- removeBalloon(balloon.id);
95
- continue;
96
- }
97
-
98
- // Simplified wall bounce logic
99
- let newVelocityX = balloon.velocity.x;
100
- if (newX <= 0) {
101
- newX = 0;
102
- newVelocityX = Math.abs(newVelocityX) * 0.8; // Bounce right with damping
103
- } else if (newX >= width - GAME_CONFIG.BALLOON_SIZE) {
104
- newX = width - GAME_CONFIG.BALLOON_SIZE;
105
- newVelocityX = -Math.abs(newVelocityX) * 0.8; // Bounce left with damping
106
- }
107
-
108
- // Batch update for better performance
109
- updateBalloon(balloon.id, {
110
- position: {
111
- x: newX,
112
- y: newY
113
- },
114
- velocity: {
115
- x: newVelocityX,
116
- y: newVelocityY
117
- },
118
- rotation: newRotation
119
- });
120
- }
121
- this.animationRef = requestAnimationFrame(updateLoop);
122
- };
123
- this.animationRef = requestAnimationFrame(updateLoop);
124
- }
125
- createRandomBalloon() {
126
- // 10% chance for special items
127
- const isSpecial = Math.random() < 0.1;
128
- const type = isSpecial ? SPECIAL_ITEMS[Math.floor(Math.random() * SPECIAL_ITEMS.length)] : BALLOON_TYPES[Math.floor(Math.random() * BALLOON_TYPES.length)];
129
-
130
- // Use fallback if type is undefined
131
- const balloonType = type || BALLOON_TYPES[0];
132
-
133
- // FORCE all balloons to spawn from bottom with better random X distribution
134
- const balloonSize = GAME_CONFIG.BALLOON_SIZE;
135
- const margin = balloonSize / 2; // Add margin from edges
136
- const availableWidth = width - margin * 2 - balloonSize;
137
- const spawnX = margin + Math.random() * availableWidth;
138
- const spawnY = height - 30; // Spawn slightly below screen for gradual appearance
139
-
140
- // Simple upward velocity
141
- const velocityX = (Math.random() - 0.5) * GAME_CONFIG.INITIAL_VELOCITY_X_RANGE;
142
- const velocityY = GAME_CONFIG.INITIAL_VELOCITY_Y;
143
- return {
144
- id: `balloon_${Date.now()}_${Math.random()}`,
145
- type: balloonType,
146
- position: {
147
- x: spawnX,
148
- y: spawnY
149
- },
150
- velocity: {
151
- x: velocityX,
152
- y: velocityY
153
- },
154
- rotation: 0,
155
- rotationSpeed: (Math.random() - 0.5) * GAME_CONFIG.ROTATION_SPEED_RANGE,
156
- isPopped: false,
157
- spawnTime: Date.now(),
158
- isBomb: 'isBomb' in balloonType && balloonType.isBomb,
159
- isBonus: 'isBonus' in balloonType && balloonType.isBonus
160
- };
161
- }
162
- createPopParticles(balloon) {
163
- // Aggressive particle limiting to prevent performance issues during rapid popping
164
- const maxTotalParticles = 15; // Reduced maximum particles on screen at once
165
- if (this.particles.length >= maxTotalParticles) {
166
- // Remove half of existing particles to make room for new ones
167
- this.particles.splice(0, Math.floor(this.particles.length / 2));
168
- }
169
- const particles = [];
170
- const particleCount = Math.min(GAME_CONFIG.PARTICLE_COUNT, 6); // Limit particles per balloon to 6
171
-
172
- // Calculate balloon center for particle spawn
173
- const balloonCenterX = balloon.position.x + GAME_CONFIG.BALLOON_SIZE / 2;
174
- const balloonCenterY = balloon.position.y + GAME_CONFIG.BALLOON_SIZE / 2;
175
- for (let i = 0; i < particleCount; i++) {
176
- const angle = i / particleCount * Math.PI * 2;
177
- const speed = 5 + Math.random() * 4; // Increased speed for better visibility
178
-
179
- particles.push({
180
- id: `particle_${balloon.id}_${i}_${Date.now()}_${Math.random()}`,
181
- // More unique ID
182
- position: {
183
- x: balloonCenterX,
184
- // Center particles exactly on balloon center
185
- y: balloonCenterY
186
- },
187
- velocity: {
188
- x: Math.cos(angle) * speed,
189
- y: Math.sin(angle) * speed - 3 // Stronger upward bias for visibility
190
- },
191
- color: COLORS.PARTICLE_COLORS[i % COLORS.PARTICLE_COLORS.length] || '#FF6B6B',
192
- size: 4 + Math.random() * 3,
193
- // Slightly smaller particles (4-7px) for better performance
194
- lifetime: 0,
195
- maxLifetime: Math.min(GAME_CONFIG.PARTICLE_LIFETIME, 800) // Reduced lifetime for better performance
196
- });
197
- }
198
-
199
- // Create new particles array instead of mutating existing one
200
- this.particles = [...this.particles, ...particles];
201
- return particles;
202
- }
203
- updateParticles(deltaMultiplier = 1) {
204
- // Optimized particle update with delta time
205
- const deltaTime = 16 * deltaMultiplier; // Scale with actual frame time
206
- const gravity = 0.08 * deltaMultiplier; // Scale gravity with delta time
207
-
208
- // Use filter to create new array instead of mutating existing one
209
- const updatedParticles = [];
210
- for (let i = 0; i < this.particles.length; i++) {
211
- const particle = this.particles[i];
212
- if (!particle) continue;
213
-
214
- // Create a new particle object to avoid mutation
215
- const updatedParticle = {
216
- ...particle
217
- };
218
- updatedParticle.lifetime += deltaTime;
219
- if (updatedParticle.lifetime >= updatedParticle.maxLifetime) {
220
- // Skip expired particle (don't add to updatedParticles)
221
- continue;
222
- }
223
-
224
- // Update particle physics with delta time scaling
225
- updatedParticle.position = {
226
- x: updatedParticle.position.x + updatedParticle.velocity.x * deltaMultiplier,
227
- y: updatedParticle.position.y + updatedParticle.velocity.y * deltaMultiplier
228
- };
229
- updatedParticle.velocity = {
230
- x: updatedParticle.velocity.x * Math.pow(0.99, deltaMultiplier),
231
- y: (updatedParticle.velocity.y + gravity) * Math.pow(0.99, deltaMultiplier)
232
- };
233
- updatedParticles.push(updatedParticle);
234
- }
235
-
236
- // Replace particles array with updated one
237
- this.particles = updatedParticles;
238
- }
239
- getParticles() {
240
- return this.particles;
241
- }
242
- checkBalloonPop(balloon, slicePath) {
243
- if (balloon.isPopped || slicePath.length < 2) return false;
244
- const balloonCenter = {
245
- x: balloon.position.x + GAME_CONFIG.BALLOON_SIZE / 2,
246
- y: balloon.position.y + GAME_CONFIG.BALLOON_SIZE / 2
247
- };
248
- const balloonRadius = GAME_CONFIG.BALLOON_SIZE / 2;
249
-
250
- // Check if slice path intersects with balloon
251
- for (let i = 0; i < slicePath.length - 1; i++) {
252
- const p1 = slicePath[i];
253
- const p2 = slicePath[i + 1];
254
- if (!p1 || !p2) continue;
255
- const distance = this.distanceFromPointToLine(balloonCenter, p1, p2);
256
- if (distance <= balloonRadius) {
257
- return true;
258
- }
259
- }
260
- return false;
261
- }
262
- distanceFromPointToLine(point, lineStart, lineEnd) {
263
- const A = point.x - lineStart.x;
264
- const B = point.y - lineStart.y;
265
- const C = lineEnd.x - lineStart.x;
266
- const D = lineEnd.y - lineStart.y;
267
- const dot = A * C + B * D;
268
- const lenSq = C * C + D * D;
269
- if (lenSq === 0) return Math.sqrt(A * A + B * B);
270
- let param = dot / lenSq;
271
- param = Math.max(0, Math.min(1, param));
272
- const xx = lineStart.x + param * C;
273
- const yy = lineStart.y + param * D;
274
- const dx = point.x - xx;
275
- const dy = point.y - yy;
276
- return Math.sqrt(dx * dx + dy * dy);
277
- }
278
- resetAnimations() {
279
- this.balloonAnimations.clear();
280
- this.particleAnimations.clear();
281
- this.particles = [];
282
- }
283
- cleanup() {
284
- this.clearGameTimer();
285
- this.clearBalloonSpawn();
286
- this.clearAnimationLoop();
287
- this.clearComboTimeout();
288
- this.particles = [];
289
- }
290
- clearGameTimer() {
291
- if (this.gameTimerRef) {
292
- clearInterval(this.gameTimerRef);
293
- this.gameTimerRef = null;
294
- }
295
- }
296
- clearBalloonSpawn() {
297
- if (this.balloonSpawnRef) {
298
- clearTimeout(this.balloonSpawnRef);
299
- this.balloonSpawnRef = null;
300
- }
301
- }
302
- clearAnimationLoop() {
303
- if (this.animationRef) {
304
- cancelAnimationFrame(this.animationRef);
305
- this.animationRef = null;
306
- }
307
- }
308
- clearComboTimeout() {
309
- if (this.comboTimeoutRef) {
310
- clearTimeout(this.comboTimeoutRef);
311
- this.comboTimeoutRef = null;
312
- }
313
- }
314
- }
315
- export const createBalloonBlasterService = (balloonAnimations, particleAnimations) => {
316
- return new BalloonBlasterService(balloonAnimations, particleAnimations);
317
- };
318
- //# sourceMappingURL=BalloonBlasterService.js.map
1
+ "use strict";import{Dimensions}from 'react-native';import{BALLOON_BLASTER_GAME_CONFIG as GAME_CONFIG,BALLOON_BLASTER_ANIMATION_CONFIG as ANIMATION_CONFIG,BALLOON_BLASTER_COLORS as COLORS,BALLOON_TYPES,BALLOON_SPECIAL_ITEMS as SPECIAL_ITEMS}from "./BalloonBlasterConstants.js";const{width,height}= Dimensions.get('window');export{GAME_CONFIG,ANIMATION_CONFIG,COLORS,BALLOON_TYPES,SPECIAL_ITEMS};export class BalloonBlasterService{gameTimerRef = null;balloonSpawnRef = null;animationRef = null;comboTimeoutRef = null;particles = [];constructor(balloonAnimations,particleAnimations){this.balloonAnimations = balloonAnimations;this.particleAnimations = particleAnimations;}startGameTimer(onTick){this.clearGameTimer();this.gameTimerRef = setInterval(onTick,1000);}startBalloonSpawning(spawnBalloon,customSpawnInterval){this.clearBalloonSpawn();const spawnInterval = customSpawnInterval || GAME_CONFIG.BALLOON_SPAWN_INTERVAL;const spawnLoop =()=>{const balloon = this.createRandomBalloon();spawnBalloon(balloon);const randomVariation =(Math.random()- 0.5)* 150;const nextSpawnTime = spawnInterval + randomVariation;this.balloonSpawnRef = setTimeout(spawnLoop,Math.max(200,nextSpawnTime));};for(let i = 0;i < 3;i++){setTimeout(()=>{const initialBalloon = this.createRandomBalloon();spawnBalloon(initialBalloon);},i * 50);}this.balloonSpawnRef = setTimeout(spawnLoop,100);}startPhysicsLoop(updateBalloon,removeBalloon,getBalloons){let lastTime = performance.now();const targetFPS = 60;const targetFrameTime = 1000 / targetFPS;const updateLoop = currentTime =>{const deltaTime = currentTime - lastTime;if(deltaTime < targetFrameTime){this.animationRef = requestAnimationFrame(updateLoop);return;}lastTime = currentTime;const deltaMultiplier = deltaTime / 16.67;this.updateParticles(deltaMultiplier);const balloons = getBalloons();for(let i = 0;i < balloons.length;i++){const balloon = balloons[i];if(!balloon || balloon.isPopped)continue;const newVelocityY = balloon.velocity.y + GAME_CONFIG.GRAVITY * deltaMultiplier;let newX = balloon.position.x + balloon.velocity.x * deltaMultiplier;const newY = balloon.position.y + newVelocityY * deltaMultiplier;const newRotation = balloon.rotation + balloon.rotationSpeed * deltaMultiplier;if(newY < -100){removeBalloon(balloon.id);continue;}if(newY > height + 100){removeBalloon(balloon.id);continue;}let newVelocityX = balloon.velocity.x;if(newX <= 0){newX = 0;newVelocityX = Math.abs(newVelocityX)* 0.8;}else if(newX >= width - GAME_CONFIG.BALLOON_SIZE){newX = width - GAME_CONFIG.BALLOON_SIZE;newVelocityX = -Math.abs(newVelocityX)* 0.8;}updateBalloon(balloon.id,{position:{x:newX,y:newY},velocity:{x:newVelocityX,y:newVelocityY},rotation:newRotation});}this.animationRef = requestAnimationFrame(updateLoop);};this.animationRef = requestAnimationFrame(updateLoop);}createRandomBalloon(){const isSpecial = Math.random()< 0.1;const type = isSpecial ? SPECIAL_ITEMS[Math.floor(Math.random()* SPECIAL_ITEMS.length)]:BALLOON_TYPES[Math.floor(Math.random()* BALLOON_TYPES.length)];const balloonType = type || BALLOON_TYPES[0];const balloonSize = GAME_CONFIG.BALLOON_SIZE;const margin = balloonSize / 2;const availableWidth = width - margin * 2 - balloonSize;const spawnX = margin + Math.random()* availableWidth;const spawnY = height - 30;const velocityX =(Math.random()- 0.5)* GAME_CONFIG.INITIAL_VELOCITY_X_RANGE;const velocityY = GAME_CONFIG.INITIAL_VELOCITY_Y;return{id:`balloon_${Date.now()}_${Math.random()}`,type:balloonType,position:{x:spawnX,y:spawnY},velocity:{x:velocityX,y:velocityY},rotation:0,rotationSpeed:(Math.random()- 0.5)* GAME_CONFIG.ROTATION_SPEED_RANGE,isPopped:false,spawnTime:Date.now(),isBomb:'isBomb' in balloonType && balloonType.isBomb,isBonus:'isBonus' in balloonType && balloonType.isBonus};}createPopParticles(balloon){const maxTotalParticles = 15;if(this.particles.length >= maxTotalParticles){this.particles.splice(0,Math.floor(this.particles.length / 2));}const particles = [];const particleCount = Math.min(GAME_CONFIG.PARTICLE_COUNT,6);const balloonCenterX = balloon.position.x + GAME_CONFIG.BALLOON_SIZE / 2;const balloonCenterY = balloon.position.y + GAME_CONFIG.BALLOON_SIZE / 2;for(let i = 0;i < particleCount;i++){const angle = i / particleCount * Math.PI * 2;const speed = 5 + Math.random()* 4;particles.push({id:`particle_${balloon.id}_${i}_${Date.now()}_${Math.random()}`,position:{x:balloonCenterX,y:balloonCenterY},velocity:{x:Math.cos(angle)* speed,y:Math.sin(angle)* speed - 3},color:COLORS.PARTICLE_COLORS[i % COLORS.PARTICLE_COLORS.length] || '#FF6B6B',size:4 + Math.random()* 3,lifetime:0,maxLifetime:Math.min(GAME_CONFIG.PARTICLE_LIFETIME,800)});}this.particles = [...this.particles,...particles];return particles;}updateParticles(deltaMultiplier = 1){const deltaTime = 16 * deltaMultiplier;const gravity = 0.08 * deltaMultiplier;const updatedParticles = [];for(let i = 0;i < this.particles.length;i++){const particle = this.particles[i];if(!particle)continue;const updatedParticle ={...particle};updatedParticle.lifetime += deltaTime;if(updatedParticle.lifetime >= updatedParticle.maxLifetime){continue;}updatedParticle.position ={x:updatedParticle.position.x + updatedParticle.velocity.x * deltaMultiplier,y:updatedParticle.position.y + updatedParticle.velocity.y * deltaMultiplier};updatedParticle.velocity ={x:updatedParticle.velocity.x * Math.pow(0.99,deltaMultiplier),y:(updatedParticle.velocity.y + gravity)* Math.pow(0.99,deltaMultiplier)};updatedParticles.push(updatedParticle);}this.particles = updatedParticles;}getParticles(){return this.particles;}checkBalloonPop(balloon,slicePath){if(balloon.isPopped || slicePath.length < 2)return false;const balloonCenter ={x:balloon.position.x + GAME_CONFIG.BALLOON_SIZE / 2,y:balloon.position.y + GAME_CONFIG.BALLOON_SIZE / 2};const balloonRadius = GAME_CONFIG.BALLOON_SIZE / 2;for(let i = 0;i < slicePath.length - 1;i++){const p1 = slicePath[i];const p2 = slicePath[i + 1];if(!p1 || !p2)continue;const distance = this.distanceFromPointToLine(balloonCenter,p1,p2);if(distance <= balloonRadius){return true;}}return false;}distanceFromPointToLine(point,lineStart,lineEnd){const A = point.x - lineStart.x;const B = point.y - lineStart.y;const C = lineEnd.x - lineStart.x;const D = lineEnd.y - lineStart.y;const dot = A * C + B * D;const lenSq = C * C + D * D;if(lenSq === 0)return Math.sqrt(A * A + B * B);let param = dot / lenSq;param = Math.max(0,Math.min(1,param));const xx = lineStart.x + param * C;const yy = lineStart.y + param * D;const dx = point.x - xx;const dy = point.y - yy;return Math.sqrt(dx * dx + dy * dy);}resetAnimations(){this.balloonAnimations.clear();this.particleAnimations.clear();this.particles = [];}cleanup(){this.clearGameTimer();this.clearBalloonSpawn();this.clearAnimationLoop();this.clearComboTimeout();this.particles = [];}clearGameTimer(){if(this.gameTimerRef){clearInterval(this.gameTimerRef);this.gameTimerRef = null;}}clearBalloonSpawn(){if(this.balloonSpawnRef){clearTimeout(this.balloonSpawnRef);this.balloonSpawnRef = null;}}clearAnimationLoop(){if(this.animationRef){cancelAnimationFrame(this.animationRef);this.animationRef = null;}}clearComboTimeout(){if(this.comboTimeoutRef){clearTimeout(this.comboTimeoutRef);this.comboTimeoutRef = null;}}}export const createBalloonBlasterService =(balloonAnimations,particleAnimations)=>{return new BalloonBlasterService(balloonAnimations,particleAnimations);};