config.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. var GLOBAL_GAME_CONFIG = {
  2. global: {
  3. // Framerate
  4. fps: 60,
  5. // If true, will use requestAnimationFrame HTML5 function instead of timers
  6. // _Theoretically_ shall produce smoother animation, but needs testing across browsers
  7. useRAF: true,
  8. externalSoundURL: "https://googledrive.com/host/0B9PYxO5Fpny6TzUzVzd4dW1GaDQ/jellyquest/sounds/"
  9. },
  10. // *** Gameplay
  11. // Scoring parameteres
  12. score: {
  13. // Base score that we give for chains of 1, 2, 3, 4, 5, etc.
  14. scoreForChains: [10, 10, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
  15. cookieScore: 250,
  16. singleShapeScore: 5
  17. },
  18. gameplay: {
  19. minChain: 2,
  20. minBonusChain: 10,
  21. largeBonusChain: 105,
  22. extraMovesBonus: 10,
  23. bombExplosionRadius: 2,
  24. explosionFruitDamage: 5,
  25. initialPowerupDrop: 0,
  26. maxMoves: 100
  27. },
  28. // Describes purchaseable powerups
  29. powerups: {
  30. list: [
  31. { id: "ExtraMoves1", icon: "ExtraMoves1", type: "ExtraMoves", starCost: 5, extraMoves: 1},
  32. { id: "ExtraMoves2", icon: "ExtraMoves2", type: "ExtraMoves", starCost: 10, extraMoves: 2},
  33. { id: "ExtraMoves3", icon: "ExtraMoves3", type: "ExtraMoves", starCost: 15, extraMoves: 3},
  34. { id: "Shuffle1", icon: "Shuffle1", type: "Shuffle1", starCost: 10, shuffles: 1},
  35. { id: "BombChain", icon: "BombChain", type: "BombChain", starCost: 25, bonusChainReduction: 1},
  36. { id: "BonusPack1", icon: "BonusPack1", type: "BonusPack", starCost: 15, extraInitialPowerups: 1}
  37. ],
  38. style: {
  39. starCountStyle: { style: "bold 40px verdana, helvetica, sans-serif", color: "#7D3100" },
  40. starCostStyle: { style: "bold 30px verdana, helvetica, sans-serif", color: "#7D3100" },
  41. starCostDisabledStyle: { style: "bold 30px verdana, helvetica, sans-serif", color: "#999999" },
  42. gameShopButtonStarCount: { style: "bold 30px verdana, helvetica, sans-serif", color: "#7D3100" },
  43. powerupDescription: { style: "bold 20px verdana, helvetica, sans-serif", color: "#81432E" }
  44. }
  45. },
  46. // Field size and visual position
  47. defaultField: {
  48. // Number of columns on a game field
  49. columnCount: 10,
  50. // Number of rows on a game field
  51. rowCount: 10,
  52. // Size and top/left pixel coordinates of the field
  53. visualRectangle: { x: 5, y: 82, width: 640 - 5 * 2, height: 640 - 5 * 2 }
  54. },
  55. // *** Visual attributes
  56. // Describes backgrounds for our level zones. Expects image files as "forest_clean"/"forest_dirty"
  57. backgrounds: [
  58. { fromLevel: 1, name: "land" },
  59. { fromLevel: 11, name: "ice" },
  60. { fromLevel: 21, name: "volcano" },
  61. { fromLevel: 30, name: "boss" }
  62. ],
  63. transitions: {
  64. standard: {
  65. out: {
  66. type: "fadeOut",
  67. duration: 300
  68. },
  69. in: {
  70. type: "fadeIn",
  71. duration: 400
  72. }
  73. }
  74. },
  75. // Tweakable animation parameters
  76. animation: {
  77. tutorialDelay: 500,
  78. // *** Delays between game states
  79. // Delay after line removal is started AND collapse kicks-in. The larger it is, the large is cartoon effect of "no earth under the feet".
  80. afterMatchCompleteDelay: 50,
  81. // Delay after collapse of shapes is complete and combo matching/line clearing/powerups kicks-in
  82. // Negative values are allowed and mean that we will in fact start match3 BEFORE collapse is fully complete.
  83. afterCollapseCompleteDelay: -300,
  84. // *** Physics, collapse and gravity
  85. // Collapse of existing shapes AND drop of new shapes will happen in parallel?
  86. // If false, collapse of existing shapes will complete first, then new ones will drop.
  87. parallelCollapseAndDrop: true,
  88. // Tiny delay between each new row for refilled/collapsed shapes. Creates effect of bottom-up "wave" fill.
  89. // Note: if you make it smaller than individualShapeCollapseDelay, shapeDef may overlap as they fall :)
  90. rowCollapseDelay: 65,
  91. // Random delay between individual shapeDef collapse in a single row (between 0 and this value)
  92. individualShapeCollapseDelay: 0,
  93. // Gravity (in pixels per seconds^2). Gravity of 7000 corresponds to 1 meter-high game field on Earth. :)
  94. shapeFreeFallGravityConstant: 9000,
  95. // Each shapeDef jumps up for this period of time before falling down.
  96. jumpUpTime: 100,
  97. // Each shapeDef jumps up by this amount of pixels
  98. jumpUpDistance: 20,
  99. // Fall down penetration time
  100. fallDownPenetrationTime: 150,
  101. // Fall down penetration in pixels
  102. fallDownPenetrationDistance: 10,
  103. // Fall down time (in millis)
  104. fallDownBounceBackTime: 300,
  105. // *** Player moves
  106. // Time (milliseconds) for a successful swap
  107. successfulSwapTime: 250,
  108. // Time (milliseconds) for rejected swap (one direction, actual time is twice as big)
  109. rejectedSwapTime: 250,
  110. blockSwapTime: 200,
  111. blockSwapRatio: 0.2,
  112. swapShapeScaleUp: 0.2,
  113. swapShapeScaleDown: -0.05,
  114. // *** Combo message
  115. // Amount of time (millis) to pause the game when the combo message is shown
  116. comboMessageDelay: 350
  117. },
  118. // Animation and display of HUD
  119. hud: {
  120. // Count speed of game score (score points per second)
  121. gameScoreFillSpeed: 700,
  122. collectiblessProgressFillSpeed: 0.5,
  123. // Fill speed of game score progress (score points per second)
  124. gameScoreProgressFillSpeed: 1000,
  125. minMovesBlink: 5
  126. },
  127. // Style of visual and text elements
  128. style: {
  129. tutorialText: { style: "bold 22px verdana, helvetica, sans-serif", color: "#404040" },
  130. fruitCounterText: { style: "bold 20px verdana, helvetica, sans-serif", color: "#5B3A49" }
  131. },
  132. info: {
  133. text: { style: "30px verdana, helvetica, sans-serif", color: "#715139" }
  134. },
  135. goal: {
  136. style: {
  137. goalLabel: { style: "30px verdana, helvetica, sans-serif", color: "#715139" },
  138. goalText: { style: "30px verdana, helvetica, sans-serif", color: "#715139" }
  139. }
  140. },
  141. levelComplete: {
  142. style: {
  143. label: { style: "30px verdana, helvetica, sans-serif", color: "#715139" },
  144. level: { style: "30px verdana, helvetica, sans-serif", color: "#715139" },
  145. levelScore: { style: "30px verdana, helvetica, sans-serif", color: "#715139" },
  146. hint: { style: "italic 25px verdana, helvetica, sans-serif", color: "#715139" },
  147. totalScore: { style: "30px verdana, helvetica, sans-serif", color: "#715139" }
  148. }
  149. },
  150. // *** Game sound
  151. sound: {
  152. blockVoices: [
  153. { file: "block_voice1", deferred: true },
  154. { file: "block_voice2", deferred: true },
  155. { file: "block_voice3", deferred: true },
  156. { file: "block_voice4", deferred: true },
  157. { file: "block_voice5", deferred: true }
  158. ],
  159. musicMenu: { file: "musicMenu" }, // Main menu music
  160. musicGame: { file: "musicGame" }, // Music playing during the game
  161. moveAccepted: [
  162. { file: "chainremoved1" }, // Player successfully taped the chain and remove jellies
  163. { file: "chainremoved2" }, // Player successfully taped the chain and remove jellies
  164. { file: "chainremoved3" } // Player successfully taped the chain and remove jellies
  165. ],
  166. moveAcceptedLarge: { file: "hugechain" }, // Player successfully taped the chain and remove jellies
  167. moveRejected: [
  168. { file: "moverejected1"}, // Player taped the chain, but it cannot be removed (only single element is there)
  169. { file: "moverejected2"}, // Player taped the chain, but it cannot be removed (only single element is there)
  170. { file: "moverejected3"} // Player taped the chain, but it cannot be removed (only single element is there)
  171. ],
  172. levelComplete: { file: "levelcomplete" }, // Level won!
  173. gameOver: { file: "gameover" }, // Level lost, out of moves
  174. buttonPressed: { file: "buttonpressed" }, // Tap the button
  175. purchaseComplete: { file: "purchasecomplete" }, // Purchased thing in game store
  176. purchaseFailed: { file: "purchasefailed" }, // Cannot purchase thing in game store, can be the same as moverejected
  177. powerupgranted: { file: "powerupgranted" }, // Player earned powerup (by removing HUGE chain)
  178. bonusmoves: { file: "powerupgranted" }, // Bonus moves granted (powerup collected)
  179. cookieRemoved: { file: "cookieremoved" }, // Bonus moves granted (powerup collected)
  180. starEarned: [
  181. { file: "starearned" }, // Player earned star (played on level complete screen AND in the game screen, but we can make it separate sound if needed or mute it in game itself)
  182. { file: "starearned2" }, // Player earned star (played on level complete screen AND in the game screen, but we can make it separate sound if needed or mute it in game itself)
  183. { file: "starearned3" } // Player earned star (played on level complete screen AND in the game screen, but we can make it separate sound if needed or mute it in game itself)
  184. ],
  185. explosion: { file: "bombexplosion" }, // Explosion!
  186. shuffle: { file: "shuffle" } // Player activated shuffle powerup
  187. },
  188. // SHORTCUT: Duplicate unlocks here (for display) and in powerups (for actual unlock)
  189. treasures: [
  190. { name: "BonusBubbles", level: 2, icon: "ExtraBubbleThumb", hintKey: "treasure.ExtraBubbleThumb" },
  191. { name: "BonusCoins", level: 3, icon: "BonusCoinsThumb", hintKey: "treasure.BonusCoins" },
  192. { name: "BonusRowColumnClear", level: 5, icon: "WiperPowerupThumb", hintKey: "treasure.BonusRowColumnClear" },
  193. { name: "BonusBomb", level: 10, icon: "BonusBombThumb", hintKey: "treasure.BonusBomb" }
  194. ],
  195. nextMove: {
  196. firstTimeout: 5000,
  197. nextTimeout: 1000
  198. },
  199. highlight: {
  200. firstTimeout: 1,
  201. nextTimeout: 3000
  202. },
  203. bonusesForExtraMoves: {
  204. timeout: 150
  205. },
  206. comixes: {
  207. backgroundColor: "#000000",
  208. firstFrameDelay: 100,
  209. fadeInTime: 400,
  210. frameDelay: 3000,
  211. entries: {
  212. intro1: {
  213. pages: [
  214. ["ComixFrame_1_1", "ComixFrame_1_2", "ComixFrame_1_3", "ComixContinue"],
  215. ["ComixFrame_2_1", "ComixFrame_2_2", "ComixContinue"]
  216. ]
  217. },
  218. intro3: {
  219. pages: [
  220. ["ComixFrame_3_1", "ComixFrame_3_3", "ComixContinue"]
  221. ]
  222. },
  223. outro: {
  224. pages: [
  225. ["ComixFrame_4_1", "ComixContinue"],
  226. ["ComixFrame_4_2", "ComixFrame_4_3", "ComixContinue"]
  227. ]
  228. }
  229. }
  230. }
  231. }