home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / angelpang.swf / scripts / frame_2 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  7.4 KB  |  285 lines

  1. function Rand()
  2. {
  3.    cor = random(4) + 1;
  4.    var xxx = 0;
  5.    while(xxx < 21)
  6.    {
  7.       this.ball.in_ball.gotoAndStop(cor);
  8.       this["mball" + xxx].in_ball.gotoAndStop(cor);
  9.       this["sball" + xxx].in_ball.gotoAndStop(cor);
  10.       this["ssball" + xxx].in_ball.gotoAndStop(cor);
  11.       this["sssball" + xxx].in_ball.gotoAndStop(cor);
  12.       xxx++;
  13.    }
  14. }
  15. function TimeScore2()
  16. {
  17.    var tSco_a = Math.floor(this.Score / 1000000) + 1;
  18.    var tSco_a_c = this.Score % 1000000;
  19.    var tSco_b = Math.floor(tSco_a_c / 100000) + 1;
  20.    var tSco_b_c = tSco_a_c % 100000;
  21.    var tSco_c = Math.floor(tSco_b_c / 10000) + 1;
  22.    var tSco_c_c = tSco_b_c % 10000;
  23.    var tSco_d = Math.floor(tSco_c_c / 1000) + 1;
  24.    var tSco_d_c = tSco_c_c % 1000;
  25.    var tSco_e = Math.floor(tSco_d_c / 100) + 1;
  26.    var tSco_e_c = tSco_d_c % 100;
  27.    var tSco_f = Math.floor(tSco_e_c / 10) + 1;
  28.    this.Score2_mc.mc6.gotoAndStop(tSco_a);
  29.    this.Score2_mc.mc5.gotoAndStop(tSco_b);
  30.    this.Score2_mc.mc4.gotoAndStop(tSco_c);
  31.    this.Score2_mc.mc3.gotoAndStop(tSco_d);
  32.    this.Score2_mc.mc2.gotoAndStop(tSco_e);
  33.    this.Score2_mc.mc1.gotoAndStop(tSco_f);
  34.    if(Math.floor(this.Score / 1000000) > 0)
  35.    {
  36.       this.Score2_mc.mc6._visible = true;
  37.    }
  38.    if(Math.floor(this.Score / 100000) > 0)
  39.    {
  40.       this.Score2_mc.mc5._visible = true;
  41.    }
  42.    if(Math.floor(this.Score / 10000) > 0)
  43.    {
  44.       this.Score2_mc.mc4._visible = true;
  45.    }
  46.    if(Math.floor(this.Score / 1000) > 0)
  47.    {
  48.       this.Score2_mc.mc3._visible = true;
  49.    }
  50.    if(Math.floor(this.Score / 100) > 0)
  51.    {
  52.       this.Score2_mc.mc2._visible = true;
  53.    }
  54.    if(Math.floor(this.Score / 10) > 0)
  55.    {
  56.       this.Score2_mc.mc1._visible = true;
  57.    }
  58. }
  59. function TimeScore()
  60. {
  61.    var tSco_a = Math.floor(this.Score / 1000000) + 1;
  62.    var tSco_a_c = this.Score % 1000000;
  63.    var tSco_b = Math.floor(tSco_a_c / 100000) + 1;
  64.    var tSco_b_c = tSco_a_c % 100000;
  65.    var tSco_c = Math.floor(tSco_b_c / 10000) + 1;
  66.    var tSco_c_c = tSco_b_c % 10000;
  67.    var tSco_d = Math.floor(tSco_c_c / 1000) + 1;
  68.    var tSco_d_c = tSco_c_c % 1000;
  69.    var tSco_e = Math.floor(tSco_d_c / 100) + 1;
  70.    var tSco_e_c = tSco_d_c % 100;
  71.    var tSco_f = Math.floor(tSco_e_c / 10) + 1;
  72.    this.Score_mc.mc6.gotoAndStop(tSco_a);
  73.    this.Score_mc.mc5.gotoAndStop(tSco_b);
  74.    this.Score_mc.mc4.gotoAndStop(tSco_c);
  75.    this.Score_mc.mc3.gotoAndStop(tSco_d);
  76.    this.Score_mc.mc2.gotoAndStop(tSco_e);
  77.    this.Score_mc.mc1.gotoAndStop(tSco_f);
  78.    if(Math.floor(this.Score / 1000000) > 0)
  79.    {
  80.       this.Score_mc.mc6._visible = true;
  81.    }
  82.    if(Math.floor(this.Score / 100000) > 0)
  83.    {
  84.       this.Score_mc.mc5._visible = true;
  85.    }
  86.    if(Math.floor(this.Score / 10000) > 0)
  87.    {
  88.       this.Score_mc.mc4._visible = true;
  89.    }
  90.    if(Math.floor(this.Score / 1000) > 0)
  91.    {
  92.       this.Score_mc.mc3._visible = true;
  93.    }
  94.    if(Math.floor(this.Score / 100) > 0)
  95.    {
  96.       this.Score_mc.mc2._visible = true;
  97.    }
  98.    if(Math.floor(this.Score / 10) > 0)
  99.    {
  100.       this.Score_mc.mc1._visible = true;
  101.    }
  102. }
  103. GGG = 5;
  104. jump = 150;
  105. MMM_Time = 20;
  106. last_game = false;
  107. SoundObj = new Sound(this);
  108. SoundObj.attachSound("bg_m");
  109. SoundObj2 = new Sound(this);
  110. SoundObj2.attachSound("cl_m");
  111. stop();
  112. _root.big1 = 3;
  113. _root.big2 = 4;
  114. _root.big3 = 5;
  115. _root.big4 = 6;
  116. _root.big5 = 7;
  117. tans = 80;
  118. all_obj_remove = false;
  119. volume_controler.gotoAndStop(soundFrame);
  120. gun = 1;
  121. minX = 37;
  122. minY = 25;
  123. maxX = 620;
  124. maxY = 380;
  125. hero.speed = 9;
  126. this.onEnterFrame = function()
  127. {
  128.    rt_txt = rt;
  129.    TimeScore();
  130.    if(this.vol == 1)
  131.    {
  132.       soundOn();
  133.       this.vol = 2;
  134.    }
  135.    if(this.vol == 0)
  136.    {
  137.       soundOff();
  138.       this.vol = 2;
  139.    }
  140.    if(canPlay)
  141.    {
  142.       this.time._width = w;
  143.       if(cnt == 16)
  144.       {
  145.          SoundObj.stop();
  146.          SoundObj2.start();
  147.          hero.gotoAndStop(1);
  148.          time_bar_start.stop();
  149.          w -= 2;
  150.          ii = 0;
  151.          Score += 10;
  152.          if(time._width == 0 || time._width == 1)
  153.          {
  154.             SoundObj2.stop();
  155.             cnt = 0;
  156.             level_up_font.play();
  157.          }
  158.          player_move = false;
  159.          hero.gotoAndStop(1);
  160.          GGG = 6;
  161.       }
  162.       if(gun == 3)
  163.       {
  164.          hero.player.Att_go.gotoAndStop(3);
  165.          hero.player.gun_box.gotoAndStop(2);
  166.       }
  167.       if(gun == 2)
  168.       {
  169.          hero.player.Att_go.gotoAndStop(2);
  170.          hero.player.gun_box.gotoAndStop(1);
  171.       }
  172.       if(gun == 1)
  173.       {
  174.          hero.player.Att_go.gotoAndStop(1);
  175.          hero.player.gun_box.gotoAndStop(1);
  176.       }
  177.       if(gun == 7)
  178.       {
  179.          hero.player.Att_go.gotoAndStop(1);
  180.          hero.player.gun_box.gotoAndStop(1);
  181.       }
  182.       if(player_move)
  183.       {
  184.          if(Key.isDown(39))
  185.          {
  186.             if(player_move == false)
  187.             {
  188.                hero.gotoAndStop(1);
  189.             }
  190.             if(hero._x < this.maxX)
  191.             {
  192.                hero.speed = 9;
  193.                hero.gotoAndStop("right");
  194.                hero._x += hero.speed;
  195.             }
  196.          }
  197.          else if(Key.isDown(37))
  198.          {
  199.             if(player_move == false)
  200.             {
  201.                hero.gotoAndStop(1);
  202.             }
  203.             if(hero._x > this.minX)
  204.             {
  205.                hero.speed = 9;
  206.                hero.gotoAndStop("left");
  207.                hero._x -= hero.speed;
  208.             }
  209.          }
  210.          else
  211.          {
  212.             hero.gotoAndStop("stop");
  213.          }
  214.          if(Key.isDown(32))
  215.          {
  216.             if(gun == 1)
  217.             {
  218.                if(A1)
  219.                {
  220.                   arrow_1._x = hero._x - 4;
  221.                   arrow_1.gotoAndPlay(2);
  222.                   hero.gotoAndStop("shoot");
  223.                   player_move = false;
  224.                }
  225.             }
  226.             if(gun == 2)
  227.             {
  228.                if(A2)
  229.                {
  230.                   arrow_2._x = hero._x - 4;
  231.                   arrow_2.gotoAndPlay(2);
  232.                   hero.gotoAndStop("shoot");
  233.                   player_move = false;
  234.                }
  235.             }
  236.             if(gun == 7)
  237.             {
  238.                if(A7)
  239.                {
  240.                   arrow_7._x = hero._x - 4;
  241.                   arrow_7.play();
  242.                   hero.gotoAndStop("shoot");
  243.                   player_move = false;
  244.                }
  245.                if(A8)
  246.                {
  247.                   arrow_8.play();
  248.                   arrow_8._x = hero._x - 4;
  249.                   hero.gotoAndStop("shoot");
  250.                   player_move = false;
  251.                }
  252.             }
  253.             if(gun == 3)
  254.             {
  255.                if(A3)
  256.                {
  257.                   arrow_3._x = hero._x - 4;
  258.                   arrow_3._y = hero._y - 5;
  259.                   arrow_3.play();
  260.                   hero.gotoAndStop("shoot");
  261.                   player_move = false;
  262.                }
  263.                if(A4)
  264.                {
  265.                   arrow_4.play();
  266.                   arrow_4._x = hero._x - 4;
  267.                   arrow_4._y = hero._y - 5;
  268.                   hero.gotoAndStop("shoot");
  269.                   player_move = false;
  270.                }
  271.                if(A5)
  272.                {
  273.                   arrow_5.play();
  274.                   arrow_5._x = hero._x - 4;
  275.                   arrow_5._y = hero._y - 5;
  276.                   hero.gotoAndStop("shoot");
  277.                   player_move = false;
  278.                }
  279.             }
  280.          }
  281.       }
  282.    }
  283. };
  284. this.nextFrame();
  285.