home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / goobers.swf / scripts / frame_92 / DoAction.as
Encoding:
Text File  |  2007-03-28  |  2.1 KB  |  73 lines

  1. function create_new_string(curr_lev, curr_rnd, xc, yc, sx, sy, nsx, nsy)
  2. {
  3.    var depth = 0;
  4.    var j = 0;
  5.    while(j < nsx)
  6.    {
  7.       var k = 0;
  8.       while(k < nsy)
  9.       {
  10.          this.enemy.duplicateMovieClip("enemy" + depth,depth);
  11.          this["enemy" + depth].x = xc - nsx * sx / 2 + (j + 0.5) * sx;
  12.          this["enemy" + depth].y = yc - dimy / 2 + (nsy - 1) * sy + (k + 1) * sy;
  13.          this["enemy" + depth].velx = 2 + 2 * curr_lev;
  14.          this["enemy" + depth].vely = 5;
  15.          this["enemy" + depth].num_frames_x = 15 - curr_lev;
  16.          this["enemy" + depth].num_frames_y = 35;
  17.          this["enemy" + depth].gotoAndStop(curr_lev);
  18.          depth++;
  19.          k++;
  20.       }
  21.       j++;
  22.    }
  23.    this.num_enemy_ships = this.num_ships_x * this.num_ships_y;
  24. }
  25. function create_boss(curr_lev, xc, yc)
  26. {
  27.    this.boss._visible = true;
  28.    this.boss.x = this.boss.start_x = xc;
  29.    this.boss.y = this.boss.start_y = yc - this.area_dimy / 2 - 20;
  30.    this.boss.left = this.boss.start_x - this.area_dimx + 15;
  31.    this.boss.right = this.boss.start_x + this.area_dimx - 15;
  32.    this.boss.bottom = this.boss.start_y + this.area_dimy + 30;
  33.    this.boss.frame = 0;
  34.    this.boss.health = 100;
  35.    this.boss.velx = 2 + 2 * curr_lev;
  36.    this.boss.vely = 5;
  37.    this.boss.num_frames_x = 15 - curr_lev;
  38.    this.boss.num_frames_y = 50;
  39.    this.boss.gotoAndStop(curr_lev);
  40.    this.boss.status = "alive";
  41. }
  42. stop();
  43. fscommand("allowscale",false);
  44. Array.prototype.take_away = function(e)
  45. {
  46.    var j = e;
  47.    while(j < this.length)
  48.    {
  49.       this[j] = this[j + 1];
  50.       j++;
  51.    }
  52.    this.pop();
  53. };
  54. dimx = 750;
  55. dimy = 525;
  56. start_x = 52;
  57. xctr = _root.play_area._x;
  58. yctr = _root.play_area._y;
  59. area_dimx = 200;
  60. area_dimy = 160;
  61. space_x = this.enemy._width + 30;
  62. space_y = this.enemy._height + 5;
  63. num_ships_x = 5;
  64. num_ships_y = 3;
  65. num_lives = 5;
  66. num_levels = 5;
  67. current_level = 1;
  68. rounds = 3;
  69. current_round = 1;
  70. num_enemy_ships = num_ships_x * num_ships_y;
  71. create_new_string(current_level,current_round,xctr,yctr,space_x,space_y,num_ships_x,num_ships_y);
  72. score = 0;
  73.