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