1
0

explosions.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (c) 2013 Fabrice ECAILLE aka Febbweiss
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  5. *
  6. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  9. */
  10. var EXPLOSION_BIG = IMAGES_PREFIX + "explosion_big.png",
  11. EXPLOSION_BIG_RATE = 50,
  12. EXPLOSION_SMALL = IMAGES_PREFIX + "explosion_small.png",
  13. EXPLOSION_SMALL_RATE = 50;
  14. var EXPLOSIONS = {
  15. BIG : [
  16. {
  17. animation : new $.gQ.Animation({
  18. imageURL : EXPLOSION_BIG,
  19. numberOfFrame : 8,
  20. delta : 128,
  21. rate : EXPLOSION_BIG_RATE,
  22. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  23. }),
  24. width : 128,
  25. height: 128
  26. },
  27. {
  28. animation : new $.gQ.Animation({
  29. imageURL : EXPLOSION_BIG,
  30. offsety : 128,
  31. numberOfFrame : 8,
  32. delta : 128,
  33. rate : EXPLOSION_BIG_RATE,
  34. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  35. }),
  36. width : 128,
  37. height: 128
  38. },
  39. {
  40. animation : new $.gQ.Animation({
  41. imageURL : EXPLOSION_BIG,
  42. offsety : 256,
  43. numberOfFrame : 8,
  44. delta : 128,
  45. rate : EXPLOSION_BIG_RATE,
  46. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  47. }),
  48. width : 128,
  49. height: 128
  50. },
  51. {
  52. animation : new $.gQ.Animation({
  53. imageURL : EXPLOSION_BIG,
  54. offsety : 384,
  55. numberOfFrame : 8,
  56. delta : 128,
  57. rate : EXPLOSION_BIG_RATE,
  58. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  59. }),
  60. width : 128,
  61. height: 128
  62. },
  63. {
  64. animation : new $.gQ.Animation({
  65. imageURL : EXPLOSION_BIG,
  66. offsety : 512,
  67. numberOfFrame : 8,
  68. delta : 128,
  69. rate : EXPLOSION_BIG_RATE,
  70. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  71. }),
  72. width : 128,
  73. height: 128
  74. },
  75. {
  76. animation : new $.gQ.Animation({
  77. imageURL : EXPLOSION_BIG,
  78. offsety : 640,
  79. numberOfFrame : 8,
  80. delta : 128,
  81. rate : EXPLOSION_BIG_RATE,
  82. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK
  83. }),
  84. width : 128,
  85. height: 128
  86. },
  87. {
  88. animation : new $.gQ.Animation({
  89. imageURL : EXPLOSION_BIG,
  90. offsety : 768,
  91. numberOfFrame : 8,
  92. delta : 128,
  93. rate : EXPLOSION_BIG_RATE,
  94. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK | $.gQ.ANIMATION_ONCE
  95. }),
  96. width : 128,
  97. height: 128
  98. },
  99. {
  100. animation : new $.gQ.Animation({
  101. imageURL : EXPLOSION_BIG,
  102. offsety : 896,
  103. numberOfFrame : 8,
  104. delta : 128,
  105. rate : EXPLOSION_BIG_RATE,
  106. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK | $.gQ.ANIMATION_ONCE
  107. }),
  108. width : 128,
  109. height: 128
  110. }
  111. ],
  112. SMALL : [
  113. {
  114. animation : new $.gQ.Animation({
  115. imageURL : EXPLOSION_SMALL,
  116. numberOfFrame : 10,
  117. delta : 64,
  118. rate : EXPLOSION_SMALL_RATE,
  119. type : $.gQ.ANIMATION_HORIZONTAL | $.gQ.ANIMATION_CALLBACK | $.gQ.ANIMATION_ONCE
  120. }),
  121. width : 64,
  122. height: 64
  123. }
  124. ]
  125. }