You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

79 lines
1.2 KiB

  1. define([
  2. 'js/rendering/effects'
  3. ], function (
  4. effects
  5. ) {
  6. return {
  7. type: 'explosion',
  8. count: 10,
  9. blueprint: null,
  10. particles: null,
  11. init: function (blueprint) {
  12. this.blueprint = {
  13. new: true,
  14. blueprint: $.extend(true, {
  15. color: {
  16. start: ['fcfcfc', '929398'],
  17. end: ['505360', '3c3f4c']
  18. },
  19. scale: {
  20. start: {
  21. min: 8,
  22. max: 18
  23. },
  24. end: {
  25. min: 4,
  26. max: 12
  27. }
  28. },
  29. speed: {
  30. start: {
  31. min: 4,
  32. max: 24
  33. },
  34. end: {
  35. min: 2,
  36. max: 18
  37. }
  38. },
  39. particlesPerWave: 14,
  40. particleSpacing: 0,
  41. lifetime: {
  42. min: 1,
  43. max: 3
  44. },
  45. randomColor: true,
  46. randomScale: true,
  47. randomSpeed: true,
  48. frequency: 1
  49. }, blueprint.blueprint, {
  50. spawnType: 'burst',
  51. emitterLifetime: -1,
  52. chance: null,
  53. scale: {
  54. start: {
  55. min: 6,
  56. max: 16
  57. },
  58. end: {
  59. min: 0,
  60. max: 10
  61. }
  62. }
  63. })
  64. };
  65. },
  66. explode: function (blueprint) {
  67. this.particles = this.obj.addComponent('particles', this.blueprint);
  68. this.particles.emitter.update(0.2);
  69. this.particles.emitter.emit = false;
  70. }
  71. };
  72. });