home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / roam-and-protect.swf / scripts / frame_11 / DoAction.as
Encoding:
Text File  |  2005-09-29  |  1.8 KB  |  73 lines

  1. function checkhit(bullet)
  2. {
  3.    xloc = eval(bullet)._x;
  4.    yloc = eval(bullet)._y;
  5.    e = 0;
  6.    e;
  7.    while(e < enlist.length)
  8.    {
  9.       thisen = enlist[e];
  10.       if(eval(thisen).hittest(xloc,yloc,false))
  11.       {
  12.          if(eval(thisen)._currentframe < 6)
  13.          {
  14.             _root.hitSound.start();
  15.             eval(bullet).exp = "true";
  16.             eval(bullet).gotoAndPlay("explode");
  17.             eval(thisen).gotoAndPlay("red");
  18.             eval(thisen).power.gotoAndPlay(2);
  19.             if(weapon == "bullet")
  20.             {
  21.                eval(thisen).hits -= 1;
  22.             }
  23.             else if(weapon == "laser")
  24.             {
  25.                eval(thisen).hits -= 2;
  26.             }
  27.             else if(weapon == "phaser")
  28.             {
  29.                eval(thisen).hits -= 3;
  30.             }
  31.             else if(weapon == "tazer")
  32.             {
  33.                eval(thisen).hits -= 4;
  34.             }
  35.          }
  36.       }
  37.       e++;
  38.    }
  39. }
  40. function checkhit2(Ebullet)
  41. {
  42.    xloc = eval(Ebullet)._x;
  43.    yloc = eval(Ebullet)._y;
  44.    thisen = "chopper";
  45.    if(eval(thisen).hittest(xloc,yloc,false))
  46.    {
  47.       _root.chopper.hits -= 1;
  48.       chopper.chopper.field.gotoAndPlay(2);
  49.       eval(Ebullet).exp = "true";
  50.       eval(Ebullet).gotoAndPlay("explode");
  51.    }
  52. }
  53. _root.survived = 0;
  54. lives = 3;
  55. _root.score = 0;
  56. _root.shiptocnt = 0;
  57. _root.fightertocnt = 0;
  58. _root.bombertocnt = 0;
  59. stagew = 600;
  60. stageh = 350;
  61. guageson = "false";
  62. trucksmove = 0.5;
  63. debug = true;
  64. _root.intermission = false;
  65. _root.weapon = "bullet";
  66. _root.engineSound = new Sound();
  67. _root.engineSound.attachSound("engine");
  68. _root.hitSound = new Sound();
  69. _root.hitSound.attachSound("hit");
  70. _root.collectSound = new Sound();
  71. _root.collectSound.attachSound("collect");
  72. _root.field1.gotoAndPlay(1);
  73.