Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Ammutaan luoteja spiraalin muotoisesti
  2. case spr_powerup_spiraali:
  3.     i = instance_create_depth(x,y,0, obj_ammus);
  4.    
  5.     i.direction = image_angle + aika * 100; //suunta muuttuu ajan suhteen
  6.     i.speed = speed + 5;
  7. break;
  8.  
  9. //Jätetään maahan vauhdittomia luoteja miinoina
  10. case 66:
  11.     if (aika % 30 == 1) { ///Sekunnin välein (jos aika on jaollinen 30:lla (ruudunpäivitysnopeus))
  12.         i = instance_create_depth(x,y,0, obj_ammus);
  13.     }
  14. break;
  15.  
  16. case spr_powerup_sarja:
  17.     //Luodaan ensimmäinen ammus
  18.     i1 = instance_create_depth(x,y,0, obj_ammus);
  19.     i1.speed = speed + 15;
  20.    
  21.     //Luodaan toinen ammus
  22.     i2 = instance_create_depth(x,y,0, obj_ammus);
  23.     i2.speed = speed + 15;
  24.    
  25.     // % palauttaa jakojäännöksen: 1 % 2 = 1, 2 % 2 = 0, 3 % 2 = 1 jne
  26.     if (current_second % 2 == 0) { //Suoritetaan joka toinen sekunti (kun sekunti jaollinen kahdella eli parillinen)
  27.         i1.direction = image_angle + 45;
  28.         i2.direction = image_angle - 45;
  29.     }
  30.     else {
  31.         i1.direction = image_angle + 180 + 45;
  32.         i2.direction = image_angle + 180 - 45;
  33.     }
  34. break;
  35.    
  36. case spr_powerup_keha:
  37.     for(var suunta = 0; suunta < 360; suunta += 1) {
  38.         i = instance_create_depth(x,y,0, obj_ammus);
  39.         i.speed = speed + 15;
  40.         i.direction = suunta;
  41.     }
  42.     obj_alus.mode = -1;
  43. break;
  44.        
  45. case spr_powerup_boost:
  46.     repeat(3) {
  47.         i = instance_create_depth(x,y,0, obj_ammus);
  48.         i.speed = speed + 15;
  49.         i.direction = image_angle + random_range( -10,10 );
  50.     }
  51. break;
  52.        
  53. default:
  54.     if !keyboard_check(ord("X")) or (voi_ampua == false) break;
  55.     i = instance_create_depth(x,y,0, obj_ammus);
  56.     i.speed = speed + 15;
  57.     i.direction = image_angle;
  58. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement