home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / rocketcar2.swf / scripts / frame_9 / DoAction.as < prev   
Encoding:
Text File  |  2008-09-24  |  2.1 KB  |  110 lines

  1. function changeLvl()
  2. {
  3.    if(_root.fade._currentframe == 1)
  4.    {
  5.       _root.carp1.yvel = 0;
  6.       _root.carp2.yvel = 0;
  7.       fade.gotoAndStop(2);
  8.    }
  9. }
  10. function resetLvl()
  11. {
  12.    if(_root.fade._currentframe == 1)
  13.    {
  14.       fuel = 0;
  15.       HUD.bar.fFuel = 1;
  16.       _root.carp1.yvel = 0;
  17.       _root.carp2.yvel = 0;
  18.       _root.fade.gotoAndStop(2);
  19.    }
  20. }
  21. function gravity(type)
  22. {
  23.    _root.gravityType = type;
  24.    _root.car.dir = type;
  25.    _root.car.flipSide = true;
  26.    _root.wait = true;
  27. }
  28. function kill()
  29. {
  30.    _root.car.dead = true;
  31. }
  32. function smoke()
  33. {
  34.    var _loc2_ = "ball" + depthHolder;
  35.    _root.attachMovie("ball",_loc2_,depthHolder);
  36.    _root[_loc2_]._x = _root.fake._x - 40;
  37.    _root[_loc2_]._y = _root.fake._y - 10;
  38.    depthHolder++;
  39. }
  40. function fadeR()
  41. {
  42.    if(_root.reset)
  43.    {
  44.       _root.gotoAndPlay("reset");
  45.       return undefined;
  46.    }
  47.    _root.gravityType = "normal";
  48.    _root.level += 1;
  49.    _root.fuel = 0;
  50.    _root.score += 100;
  51.    _root.HUD.bar.fFuel = 1;
  52.    _root.fuelCollect = false;
  53.    _root.fuelFade = true;
  54.    _root.starCollect = false;
  55.    _root.details.tutswitch = false;
  56.    _root.tutorialDone = false;
  57.    _root.nextFrame();
  58. }
  59. function stopSFX()
  60. {
  61.    steamSide.stop();
  62.    steamSideB.stop();
  63.    steam.stop();
  64.    _root.boss.ufoS.stop();
  65. }
  66. stop();
  67. ls();
  68. if(_root.sound)
  69. {
  70.    carEngine.start(0,999999);
  71. }
  72. _root.engineFrame = _root._currentframe - 1;
  73. depthHolder = 0;
  74. fuel = 0;
  75. level = 1;
  76. score = 0;
  77. gravityType = "normal";
  78. paused = false;
  79. depthHolder = 0;
  80. car.onEnterFrame = function()
  81. {
  82.    with(_root.car)
  83.    {
  84.       if(_root.sound)
  85.       {
  86.          if(ySpeed > 2)
  87.          {
  88.             if(_root.bg.hitTest(_x,_y + 10,true))
  89.             {
  90.                _root.cSound();
  91.             }
  92.          }
  93.          if(_root.bg.hitTest(_x - _width / 2 - 5,_y - 20,true))
  94.          {
  95.             if(xSpeed < -5)
  96.             {
  97.                _root.cSound();
  98.             }
  99.          }
  100.          if(xSpeed > 5)
  101.          {
  102.             if(_root.bg.hitTest(_x + _width / 2 + 5,_y - 20,true))
  103.             {
  104.                _root.cSound();
  105.             }
  106.          }
  107.       }
  108.    }
  109. };
  110.