Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///STEP EVENT FOR ENEMY THAT CREATES PARTICLE OBJECT:
  2.  
  3. if Brain.active_character = char_id and Brain.GameState = GameStates.ability_2 {
  4.     if sprite_index = ani_release_and_notch {
  5.         if image_index >= 4 and image_index < 5 {
  6.             image_index = 5;
  7.             image_speed = .125;
  8.             var creator = instance_create(x,y, Power_shot)
  9.             if Brain.stats[char_id, 10] > x_pos {
  10.                 p_dir = "right"
  11.             }
  12.             else if Brain.stats[char_id, 10] < x_pos {
  13.                 p_dir = "left"
  14.             }
  15.             with (creator) {
  16.                 host_x_pos = other.x_pos;
  17.                 host_y_pos = other.y_pos;
  18.                 p_dir = other.p_dir
  19.                 host_id = other.char_id
  20.             }
  21.         }
  22.         if image_index >= 21 {
  23.             sprite_index = ani_idle;
  24.             image_index = 0;
  25.             image_speed = .125;
  26.         }
  27.     }
  28. }
  29.  
  30. ///CREATE EVENT FOR PARTICLE OBJECT/PROJECTILE (CREATES THE PARTICLE SYSTEM)
  31.  
  32. count = 0
  33. count2 = false;
  34.  
  35. //Creating Particle System
  36. PowershotPartSystem = part_system_create();
  37. part_system_depth(PowershotPartSystem, 0);
  38.  
  39. //Creating Particle Types
  40. Powershot = part_type_create();
  41. part_type_sprite(Powershot, spr_dot, 0, 0, 0);
  42. part_type_size(Powershot, 1, 1, 0, 0);
  43. part_type_scale(Powershot, 1, 1);
  44. part_type_orientation(Powershot, 0, 0, 0, 0, 0);
  45. part_type_color3(Powershot, 16580608, 8404992, 16566925);
  46. part_type_alpha3(Powershot, 1, 0.70, 0.24);
  47. part_type_blend(Powershot, 1);
  48. part_type_life(Powershot, 15, 22);
  49. part_type_speed(Powershot, 1, 3.5, 0, 0);
  50. part_type_direction(Powershot, 0, 360, 0, 15);
  51. part_type_gravity(Powershot, 0, 90);
  52.  
  53. //Creating Emitters
  54. PowershotEmitter = part_emitter_create(PowershotPartSystem);
  55.  
  56. //Adjusting Emitter positions. Starting Emitter Streams or Bursts.
  57. xp = x;
  58. yp = y+20;
  59. part_emitter_region(PowershotPartSystem, PowershotEmitter, xp, xp, yp, yp, ps_shape_rectangle, ps_distr_linear);
  60. part_emitter_stream(PowershotPartSystem, PowershotEmitter, Powershot, 10);
  61.  
  62.  
  63.  
  64.  
  65. ///STEP EVENT FOR PARTICLE OBJECT/PROJECTILE
  66.  
  67. if Brain.stats[host_id, 1] = 0{part_type_color3(Powershot, 16580608, 8404992, 16566925);}
  68. else if Brain.stats[host_id, 1] = 1 {part_type_color3(Powershot, 8421631, 255, 128);}
  69.  
  70. if !count2 {
  71.     if p_dir == "right"{
  72.         xp+=25/3
  73.         yp-=5/3
  74.         image_xscale = 1
  75.         }
  76.     if p_dir == "left"{
  77.         xp-=25/3
  78.         yp+=5/3
  79.         image_xscale = -1
  80.         }
  81.     part_system_depth(PowershotPartSystem, -y-100)
  82.     part_emitter_region(PowershotPartSystem, PowershotEmitter, xp-5, xp+5, yp-1, yp+1, ps_shape_ellipse, ps_distr_linear);
  83.     Camera.x = xp
  84.     Camera.y = yp
  85.     depth = -yp-104
  86.    
  87.     if count = 3 {
  88.         count = 0
  89.         if p_dir == "right" {
  90.             host_x_pos = host_x_pos + 1
  91.             if (host_x_pos >= Brain.field_width) {
  92.             part_emitter_stream(PowershotPartSystem, PowershotEmitter, Powershot, 0);
  93.             count2 = true
  94.             }
  95.             if Brain.occupied[host_x_pos, host_y_pos] != "none" {
  96.                 Brain.damage[host_x_pos, host_y_pos] = floor(random_range(50,75.99))
  97.             }
  98.         }
  99.         else if p_dir == "left" {
  100.             host_x_pos = host_x_pos - 1
  101.             if host_x_pos <= 0 {
  102.                 part_emitter_stream(PowershotPartSystem, PowershotEmitter, Powershot, 0);
  103.                 count2 = true
  104.             }
  105.             if Brain.occupied[host_x_pos, host_y_pos] != "none" {
  106.                 Brain.damage[host_x_pos, host_y_pos] = floor(random_range(50,75.99))
  107.             }
  108.         }
  109.     }
  110.     count++
  111. }
  112. if count2 {
  113.     Camera.x = xp
  114.     Camera.y = yp
  115.     depth = -yp-104
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement