SHARE
TWEET

Untitled

a guest Aug 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this.options = {
  2.   root_mode: "invasion",
  3.   map_size: 30
  4. };
  5.  
  6. this.tick = function(game){
  7.   if (game.step == 1800){
  8.     for (var i=0;i<game.ships.length;i++){
  9.       game.ships[i].set({stats:66666666,type:605, shield: 400, crystals:720, x:150, y:150, vx:0, vy:0});
  10.     }
  11.   }
  12.   if(game.step == delay*2){
  13.     killasteroids(game);
  14.   }
  15.   var delay = 3600;
  16.   if(game.step < 300 + delay && game.step % 60 === 0){
  17.     game.addCollectible({code:21, x:150, y:150});
  18.   }
  19.   if(game.step >= 300 + delay && game.step < 2700 + delay && (game.step - delay) % 60 === 0){
  20.     var angle = Math.random()*Math.PI*2;
  21.     game.addAlien({code:11, level:2, crystal_drop:30, x: Math.cos(angle)*120, y: Math.sin(angle)*120}); //40 Red Chickens
  22.   }
  23.   if(game.step >= 7200 && game.step % 60 === 0){
  24.     killAllChickens(game);
  25.   }
  26.   if(game.step >= 300 + delay && game.step < 3900 + delay && (game.step - delay) % 720 == 300){
  27.     game.addAlien({code:15, level:0, crystal_drop:150, x: Math.cos(angle)*120, y: Math.sin(angle)*120}); //5 Yellow Hirsutes
  28.   }
  29.   if(game.step >= 3900 + delay && game.step < 7500 + delay && (game.step - delay) % 180 == 120){
  30.     game.addAlien({code:16, level:2, crystal_drop:60, x: Math.cos(angle)*120, y: Math.sin(angle)*120}); //20 Red Piranhas
  31.   }
  32.   if(game.step == 7500 + delay){
  33.     game.addAlien({code:20, level:1, crystal_drop:2000, x: Math.cos(angle)*120, y: Math.sin(angle)*120}); //20 Red Piranhas
  34.   }
  35. };
  36.  
  37. this.event = function(event,game){
  38.   switch (event.name){
  39.     case "alien_destroyed":
  40.       if (event.alien.code == 11 && event.alien.level == 2){
  41.         for(let i = 0; i<4; i++){
  42.           game.addAlien({code:11,level:1, x:event.alien.x + event.alien.vy*3, y:event.alien.y - event.alien.vx*3, vx:event.alien.vy, vy:-1*event.alien.vx, crystal_drop:0});
  43.         }
  44.       }
  45.       else if (event.alien.code == 16 && event.alien.level == 2){
  46.         for(var i = 0; i<2; i++){
  47.           game.addAlien({code:16,level:1, x:event.alien.x + event.alien.vy*3, y:event.alien.y - event.alien.vx*3, vx:event.alien.vy, vy:-1*event.alien.vx, crystal_drop:0});
  48.         }  
  49.       }
  50.     break;
  51.   }
  52. };
  53.  
  54. killasteroids = function(game){
  55.   for(var i = 0; i < game.aliens.length; i++){
  56.     game.asteroids[i].set({size:10, kill:true});
  57.   }
  58. };
  59.  
  60. killAllChickens = function(game){
  61.   for(var i = 0; i < game.aliens.length; i++){
  62.     if(game.aliens[i].code == 10){
  63.       game.aliens[i].set({kill: true});
  64.     }
  65.   }
  66. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top