Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Ammutaan luoteja spiraalin muotoisesti
- case spr_powerup_spiraali:
- i = instance_create_depth(x,y,0, obj_ammus);
- i.direction = image_angle + aika * 100; //suunta muuttuu ajan suhteen
- i.speed = speed + 5;
- break;
- //Jätetään maahan vauhdittomia luoteja miinoina
- case 66:
- if (aika % 30 == 1) { ///Sekunnin välein (jos aika on jaollinen 30:lla (ruudunpäivitysnopeus))
- i = instance_create_depth(x,y,0, obj_ammus);
- }
- break;
- case spr_powerup_sarja:
- //Luodaan ensimmäinen ammus
- i1 = instance_create_depth(x,y,0, obj_ammus);
- i1.speed = speed + 15;
- //Luodaan toinen ammus
- i2 = instance_create_depth(x,y,0, obj_ammus);
- i2.speed = speed + 15;
- // % palauttaa jakojäännöksen: 1 % 2 = 1, 2 % 2 = 0, 3 % 2 = 1 jne
- if (current_second % 2 == 0) { //Suoritetaan joka toinen sekunti (kun sekunti jaollinen kahdella eli parillinen)
- i1.direction = image_angle + 45;
- i2.direction = image_angle - 45;
- }
- else {
- i1.direction = image_angle + 180 + 45;
- i2.direction = image_angle + 180 - 45;
- }
- break;
- case spr_powerup_keha:
- for(var suunta = 0; suunta < 360; suunta += 1) {
- i = instance_create_depth(x,y,0, obj_ammus);
- i.speed = speed + 15;
- i.direction = suunta;
- }
- obj_alus.mode = -1;
- break;
- case spr_powerup_boost:
- repeat(3) {
- i = instance_create_depth(x,y,0, obj_ammus);
- i.speed = speed + 15;
- i.direction = image_angle + random_range( -10,10 );
- }
- break;
- default:
- if !keyboard_check(ord("X")) or (voi_ampua == false) break;
- i = instance_create_depth(x,y,0, obj_ammus);
- i.speed = speed + 15;
- i.direction = image_angle;
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement